From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web09.33644.1644844187438153648 for ; Mon, 14 Feb 2022 05:09:47 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=c0GQ2u6K; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: min.m.xu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644844187; x=1676380187; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=uz49huPohEhA74NQUQ0i3g7BKjDiL5pUUsrDRJWOFRo=; b=c0GQ2u6KTSPxt0+SVQpHmyC9R96GsZ0yNuk9EAgbVufsu3w/K+3iowyV iq+gQpP3xG2cUzWzRweREmGiOm6SlP34+3RwwjObLe6eH/hJN7fPHlfEs 5NDc2AXtgQnlJso/hMeocjCqjLdek30VaLobymiijL1bQHwr2bN6B0P7R lfg6qj9SxiMvzApKTExxefkNp9gs1JsHRwaBiVrarURXMYu/7XXlEJSA7 0ZfnXklhwUntPDl9Q9saC0Tn29b/tduuXluuEJ5ol7xVOiIyDg2//WdAE YDWLoExxJtn5i4BrCXZIObUIqbw72IPJ3UocL0vOa71EclMdyUexqB++w Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10257"; a="247679847" X-IronPort-AV: E=Sophos;i="5.88,367,1635231600"; d="scan'208";a="247679847" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2022 05:09:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,367,1635231600"; d="scan'208";a="495574466" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga006.jf.intel.com with ESMTP; 14 Feb 2022 05:09:40 -0800 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Mon, 14 Feb 2022 05:09:40 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Mon, 14 Feb 2022 05:09:40 -0800 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.173) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Mon, 14 Feb 2022 05:09:32 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vu+VWavqNEmE3KyI5NA4amAXgYqHk5Hk+90v6kQK0DtFcpSX5RiKLBclzLdsaURNGnsSB+W+agqK92+bYO5SPlBD7njHEjD/tJnGhfQWZA8/QhJ8LxacSEwOgoXfbNb19BhUpChKXAMcqS8Fm3HBt4IFHx1dmBcW9s+iAzG2GvVG09sowM77iaQ3+cv49IwVWkv0JVJH0EVAUaAZoV9Fdv0T1ISXYbSCSGTzWgrgKKoseCK74IEXA3voihWgP2RYJ7l9iNZ8VRUNLWwBkeHbqTypjH+Iuy/YEywq2UHddr88DGhb/3uw93A8jfXp23IRLWw2OBQZ9CRKsLF+Z6VV1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=dL7DCoYOCXgX1f6mieqRs/WguiUq0A0meUHYZ8Gdafg=; b=GVUPIrWPt7at1J440YFvwebeWIJE9nOfs/A5JXJC3mIlpOlPTIH8cF5Jc6v/ahv+Httfp+99JJA87aXXts9RqtDcmKaDtgN1TA1SosPDiM8fhOVXZCZzC1Ql0hVvC8wUvSqOhtqStKdbM1rbCBdLSI51SzgDhnT44RbBCvrALRnVBDYAxDc9Gupwmr8So6uSSaMw+SokgfZ9IQ7Fbvuj81NNC8XXK+7jVoYB7ZqT+awWbsBxzWW05uKF/lQzLgCpJZJIjkSD9GHA87pJGcz8jR5RtUgEMHzXVYCDWg8BuJRFN8th5rZ1+HhNgU87lX//H4DA2kmXMvC4q/IP2N7hqg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from PH0PR11MB5064.namprd11.prod.outlook.com (2603:10b6:510:3b::15) by BN6PR11MB1524.namprd11.prod.outlook.com (2603:10b6:405:d::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11; Mon, 14 Feb 2022 13:09:10 +0000 Received: from PH0PR11MB5064.namprd11.prod.outlook.com ([fe80::98f5:edb6:aee6:6886]) by PH0PR11MB5064.namprd11.prod.outlook.com ([fe80::98f5:edb6:aee6:6886%8]) with mapi id 15.20.4975.019; Mon, 14 Feb 2022 13:09:10 +0000 From: "Min Xu" To: Gerd Hoffmann CC: "devel@edk2.groups.io" , "Kinney, Michael D" , Brijesh Singh , "Aktas, Erdem" , James Bottomley , "Yao, Jiewen" , Tom Lendacky Subject: Re: [PATCH V2 09/10] OvmfPkg: Update DxeAcpiTimerLib to read HostBridgeDevId in PlatformInfoHob Thread-Topic: [PATCH V2 09/10] OvmfPkg: Update DxeAcpiTimerLib to read HostBridgeDevId in PlatformInfoHob Thread-Index: AQHYEbXXDF+Qh8cRTUSNSApL4sys3Kx25c4AgBJ+frCACYx5gIAAM7Mg Date: Mon, 14 Feb 2022 13:09:10 +0000 Message-ID: References: <20220125063318.862-1-min.m.xu@intel.com> <20220125063318.862-10-min.m.xu@intel.com> <20220127134850.q5rrxeefqyh3yrru@sirius.home.kraxel.org> <20220214100321.sdb4heedrrgqb33i@sirius.home.kraxel.org> In-Reply-To: <20220214100321.sdb4heedrrgqb33i@sirius.home.kraxel.org> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.200.16 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 91fb1666-b753-4cca-698c-08d9efbb3083 x-ms-traffictypediagnostic: BN6PR11MB1524:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: IXNNAJgIhspo0NaiMllfzy63zDv5QGJGyWVdZLri/KYA69jlMqtqCDny+w45nvSw+9igQVKI1k2JslzrXFj61jrFJ/q+vkr6rDU3+WoPeiD+svn4JDKWm/5hvhHWmD40slekirp+D6KgMZxqD7FYSVmQtFjM2pq6mJGzKqPas6zrN9rWE6OxMX91Aa8KHI+2jpMXlKUGgdEQKcN7vBcRcZ1kMzom7Efy+8GECn+oO1cbiZfK/2Ly5udGvrw1qmD+e9Z4vdmswIxMVBeKuPagD/E+CnTFc3onPZfOXqozMstm75zMXlTo0uqkUD00d3uLbESne4syPqvLeb6k1T6ZPPUlD/bhw246TNHKXJriazYVhHYkoQoDA4J3/XUJi7JZmLT2TUeehtZEKzckGBckoR1A9kc1PthIOB1VEn1uTqOlRfa7dnMj9gaZtbGP0GS79jg2q3UBMrKqvBcMk4/05glI0I3CLpW1dOp/87r9psk/BME9cITmFq1cB/FkXnKeJYdcSnrpJECjwnFh+vY25oUWisrQhqdsCnndFMjuO4U5INQbcVR7Uzl5mbH7Dhwmzf6fElARn4QA9uh1fEfWHLKw+LCGm2rOGuFVH5hzFeeMKNTVv9yCBXrEPJ0208vwqHQIkgKjBxXIbXq8b9VDSmGciIBTbtd4UAeQYFTn3Cbfwp4lgRaamjq33tO/CNOOJYrb0rBaYxwXkY0JoFgSNA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR11MB5064.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(122000001)(316002)(66476007)(55016003)(66946007)(66556008)(8676002)(66446008)(76116006)(64756008)(4326008)(7696005)(508600001)(71200400001)(38100700002)(6916009)(54906003)(9686003)(6506007)(5660300002)(2906002)(26005)(186003)(52536014)(38070700005)(33656002)(86362001)(8936002)(82960400001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?5iWEWPvuSTFYY5ZM5Y9qs1GfrZoviTRVHIt0paBQSrWeYQACOzBTcwnWBinx?= =?us-ascii?Q?1UfZVv4nFmg0bNr5wFy487wf2RtHNaMNb0rvcaXwcw+RzS3DPWHu/ksRugot?= =?us-ascii?Q?ZMxX2o2lW6I8yBr0IdF+krLyHxYnVScbq7Ais/fIpAWlLCAZsgwih19QfqFe?= =?us-ascii?Q?TmIk6A6YMxI1wz/oX5JFVenGMpsy0HZyW0/IzqxNe4D1inE7avhr7C4Gm5e/?= =?us-ascii?Q?dLkakMBxnJ27P9D0Ph1BXjjjdG0wz+cyyamfrJ1L6/VBbw1CurNp0l+93phw?= =?us-ascii?Q?hvqWa7iMS1Lk92vtESqymjzGsnaFMxUVvEQZpmRy2j67T4XNeijYt0qAIcgQ?= =?us-ascii?Q?PKxvd6roliDIg7k92VX1UrA5tfJLe9fMyVM4m4NpxpHcwFJLzydhaK5qdCib?= =?us-ascii?Q?UsO2CW4igI/rsBCte3zkbU3CFRL8pob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co+Xi5R/fdtdAs+Mu4spZLnCT1rb7fLqtbceqnxu4/tyV4gbva?= =?us-ascii?Q?xvKrwCa8scdPjQTkYbfedtZEOI9VZQ2pAHe5wmk6Vc6pUH2DN09dvirjA+9p?= =?us-ascii?Q?ZtsmjW3FkG2HQz1IAP+FC2ucmQVziOEBWE7D9ZXmrRlTxWKPuduOxRVFae8y?= =?us-ascii?Q?TG4JqxWd4ATm5l1SF/MrD+dsMrc0L5SnmIgBIHN5MRLmyeXz5yCSJBiYFpkj?= =?us-ascii?Q?uxo4n8bYmdKKWF3l1b/8BCH6j3mqAWaydODfOFdz9+J9zLxJkmbeZfSgNBch?= =?us-ascii?Q?jpCU3Hwh40AGN1CDf09rL2s=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5064.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 91fb1666-b753-4cca-698c-08d9efbb3083 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Feb 2022 13:09:10.0226 (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: 30qPnSlZuMFyDWJw1KOMZ5/UrgXa/gz83fjimsLGVUaULzzWmPyQDzF8YGjRBZ6hMSdlctxB/8eJUvYHk2lRLg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1524 Return-Path: min.m.xu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable On February 14, 2022 6:03 PM, Gerd Hoffmann wrote: > On Tue, Feb 08, 2022 at 08:20:20AM +0000, Xu, Min M wrote: > > On January 27, 2022 9:49 PM, Gerd Hoffmann wrote: > > > > + EFI_HOB_GUID_TYPE *GuidHob; > > > > + EFI_HOB_PLATFORM_INFO *PlatformInfo =3D NULL; > > > > > > > // Query Host Bridge DID to determine platform type > > > > + // Tdx guest stores the HostBridgePciDevId in a GuidHob. > > > > + // So we first check if this HOB exists > > > > > > Hmm, wouldn't it be better to create and use the PlatformInfo for > > > both PEI- based and PEI-less boot? > > > > > > > - HostBridgeDevId =3D PcdGet16 (PcdOvmfHostBridgePciDevId); > > > > + GuidHob =3D GetFirstGuidHob (&gUefiOvmfPkgTdxPlatformGuid); if > > > > + (GuidHob !=3D NULL) { > > > > + PlatformInfo =3D (EFI_HOB_PLATFORM_INFO > *)GET_GUID_HOB_DATA > > > (GuidHob); > > > > + HostBridgeDevId =3D PlatformInfo->HostBridgePciDevId; } else = { > > > > + HostBridgeDevId =3D PcdGet16 (PcdOvmfHostBridgePciDevId); } > > > > > > We would not need that kind of checks in the first place then. > > > > > As we agreed at the first stage, only OvmfPkg/PlatformPei will be refac= tored > with PlatformInitLib. > > OvmfPkg/Bhyve/PlatformPei and OvmfPkg/XenPlatformPei will be refactored > in the future. HostBridgeDevId is set to PcdOvmfHostBridgePciDevId in the= se 2 > platforms. > > So we have to check both EFI_HOB_PLATFORM_INFO and > PcdOvmfHostBridgePciDevId. >=20 > Ok. Can you add a comment explaining this? Sure. I will add the comment to explain it. Thanks Min