From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 415AD94123D for ; Wed, 20 Mar 2024 08:41:47 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=oFjwhb+W+vDvbP4+nWAs5AkvRf/jThpr3y8vcmfdcqE=; c=relaxed/simple; d=groups.io; h=From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20240206; t=1710924106; v=1; b=ZsoocW0t+FQz99ACoH/meJzxbl3QRMIFIrtJGNynC2sQbPpIU2VayTY18iEE90NTGfD695Ax Bx42K/310//y50grbU7w6U77rOW1dV+eR2djeFNjOQciJb1grDtMsx0LxKlfYVuqSNlASKbSq/7 xFxb+gBuoeMni5LkAEAOszkUv2noqTvWE2smzuNVYutDwFJ1kiHPURsA2tjcPujmNTipHfkwHR3 1lMKZTCYhcDrAboAq/I3efA0scCBQdWQFneXH1Qf6j65bp/x+bNeeJQV3w3TflMaWEe69qfVQIb mjj9HdynPDfL4v8J7LWvBBmgopo5nAef+vbccAhSwIX6Q== X-Received: by 127.0.0.2 with SMTP id gYXWYY7687511xwKMM84vgq1; Wed, 20 Mar 2024 01:41:46 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) by mx.groups.io with SMTP id smtpd.web11.39120.1710924105286428533 for ; Wed, 20 Mar 2024 01:41:45 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,11018"; a="5695203" X-IronPort-AV: E=Sophos;i="6.07,139,1708416000"; d="scan'208";a="5695203" X-Received: from orviesa007.jf.intel.com ([10.64.159.147]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Mar 2024 01:41:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,139,1708416000"; d="scan'208";a="14492558" X-Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orviesa007.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 20 Mar 2024 01:41:45 -0700 X-Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 20 Mar 2024 01:41:44 -0700 X-Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 20 Mar 2024 01:41:43 -0700 X-Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Wed, 20 Mar 2024 01:41:43 -0700 X-Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.100) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Wed, 20 Mar 2024 01:41:43 -0700 X-Received: from IA0PR11MB8355.namprd11.prod.outlook.com (2603:10b6:208:480::14) by PH0PR11MB7588.namprd11.prod.outlook.com (2603:10b6:510:28b::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7339.21; Wed, 20 Mar 2024 08:41:41 +0000 X-Received: from IA0PR11MB8355.namprd11.prod.outlook.com ([fe80::d2f:72a5:6a4f:d7a8]) by IA0PR11MB8355.namprd11.prod.outlook.com ([fe80::d2f:72a5:6a4f:d7a8%3]) with mapi id 15.20.7409.008; Wed, 20 Mar 2024 08:41:41 +0000 From: "sunceping" To: Gerd Hoffmann CC: "devel@edk2.groups.io" , "Aktas, Erdem" , "Yao, Jiewen" , "Xu, Min M" , "Reshetova, Elena" , "Sun, CepingX" Subject: Re: [edk2-devel] [PATCH V1 1/1] OvmfPkg/QemuBootOrderLib: Measure the etc/boot-menu-wait Thread-Topic: [PATCH V1 1/1] OvmfPkg/QemuBootOrderLib: Measure the etc/boot-menu-wait Thread-Index: AQHadFI2hTrvbrZBC0u8PfZjHflJorEz8V0AgAFlYtCAAaUlgIAJRAbQ Date: Wed, 20 Mar 2024 08:41:41 +0000 Message-ID: References: <20240312235146.3777997-1-cepingx.sun@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: IA0PR11MB8355:EE_|PH0PR11MB7588:EE_ x-ms-office365-filtering-correlation-id: 5e1bccdc-8bca-4114-cb77-08dc48b990be x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: NbeOmwGFAh6eCGc8yCFNpqM0aBiedftpOKVUvgvk3vNfrCnmAQM0epzcTKsrsl2W1a+S5g/iHC4X3w0VwFEpSMw3ur4tNTRMawjrRcewdUZNitbMBBTXuDuF7FA1w0u10fP+Cvb02NY4+xef3DSridofG8UUV19rK0prrppNrPv1MuhL//+UbgEdlKLujgppUctx3I666uDDjkMPyGXmG0UWgEFpkWY6MfDP4sWCi6RbQlxUTu4cnihhVEDMANkwCdMl3OXehtaExzde+y3RtW9qG1LnyEz4JqbxacTifSfaEEDLz7KANXSgZS5ZQrOBuJWxGIdZ7zTPN7V8QgGdVIIfsDDzteFbKkhV0wK+PSo3P9XFiGxKchZA2ulvhItw6uEALpMqO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7eCtHZU0i04pG4nPNHUBhGAQl?= =?us-ascii?Q?V3VjuEcxWFoVk/fUmHvX/ccYEHSGvwqI3JZfYeC5CVgVc7bQHqH6r0xq9CQ1?= =?us-ascii?Q?k0OFfNVAplMF0UM8DEMP+6ctNQTEDFTGmvYg9P2yx4s+W6nfyvW/aPNhvRCY?= =?us-ascii?Q?kfdlyHZWuFgOg1RSpyDEwSQSakxjnl4M3BkPnv73?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: IA0PR11MB8355.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5e1bccdc-8bca-4114-cb77-08dc48b990be X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Mar 2024 08:41:41.4070 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 1+842KFXXNzG0d+jxPGgIfoXmvISul1XsBOOxuq06K+NyCBEIg8sKJPq8gMcEDceQukFy+iluKxVPLTyY9/PAQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB7588 X-OriginatorOrg: intel.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Wed, 20 Mar 2024 01:41:45 -0700 Reply-To: devel@edk2.groups.io,cepingx.sun@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: zKkmdZl1BDpDUeCrXiFKSi34x7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=ZsoocW0t; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io On Thursday, March 14, 2024 5:31 PM Gerd Hoffmann wrote: > Load, measure and cache all fw_cfg entries we care about early in the PEI= phase > (or SEC phase for pei-less builds), so we can > (a) easily have a fixed order, and > (b) store them all in HOBs? >=20 > Which implies SEC/PEI must read all relevant fw_cfg entries, even in case= they > are used only later in the DXE phase. >=20 > Advantage is we have a single cache which can be used in all firmware pha= ses. > When using global variables in DXE we still can end up reading entries mu= ltiple > times, either because entries are needed by both PEI and DXE, or because > multiple DXE modules need them (global variables are per module). >=20 We have some concerns that in above solution the size of a single cache is = large ( because all fw_cfg data need to be read from qemu).=20 Further more this is not a lazy mode which means some fw_cfg data=20 may be read but it is not to be consumed later.=20 We propose below solution : Add a new API in QemuFwCfgLib, RETURN_STATUS QemuFwCfgGetData(fw_cfg_name, *size, *value, FW_CFG_GET_DATA_= FLAG flag).=09 Input: @fw_cfg_name: The fw_cfg file name . @size: Number of bytes in the file. @value: Value of fw_cfg item read.=20 @flag: Bitmap providing additional information(cache? measurement ?) #define FW_CFG_GET_DATA_CACHE 0x00000001 #define FW_CFG_GET_DATA_MEASUREMENT 0x00000002 Output: @return: RETURN_NOT_FOUND: The fw_cfg file is not found RETURN_UNSUPPORTED: The fw_cfg is unavailable. RETURN_BUFFER_TOO_SMALL: The required buffer size is in @s= ize. RETURN_SUCCESS: The fw_cfg file is found and load the dat= a successfully. Description: This function finds fw_cfg item and reads its data into value. And it als= o provides callers with options to cache and/or measurement.=20 Pros: Caller can decide how to get the fw_cfg data from QEMU (cache? Measurement?= ) And it can reduce the code complexity because it pack 3 fw_cfg call=20 (QemuFwCfgFindFile/QemuFwCfgSelectItem/QemuFwCfgReadBytes) into one call.= =20 What's your thought? Thanks Ceping -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#116915): https://edk2.groups.io/g/devel/message/116915 Mute This Topic: https://groups.io/mt/104880546/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-