From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web11.1746.1646417393682591055 for ; Fri, 04 Mar 2022 10:09:54 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=S0NBcLqJ; spf=pass (domain: intel.com, ip: 134.134.136.31, mailfrom: guo.dong@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646417393; x=1677953393; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=a6BMJF0V68uJ8REcfXhbthg8XR+FLoNUb0oqfUR68gA=; b=S0NBcLqJkCTMTfSYAXiHIya+CT6e8mdCO0HnKjwkdqvbf4hnvYzzyBSX oUQcISF9BCToA7DH59gMZGoAK6LxaDBEEpDHXEmRwXTLMpob3LxGkQ3vY O1TOfI793tzlmgEv4oNaAJXSt1NLC6BGWCuBq1Re6JPzJdcEe5mLuHyU5 nUFc5q4sw8I4O8zDexKnkF449dEmdbiOOOJWNorHpyFZHOZ3KdBOEeal3 2HfA7/u5/GCHt7UowKR75N+JfKFz6x9pKoPuwxHxcD0w+Ubl1VrMlv5XE LC4ztwliY/IuMaXU/hh/w3l4bXPOpLEbSSN8qbocLTG1IbVbI2NjrJqRk A==; X-IronPort-AV: E=McAfee;i="6200,9189,10276"; a="314745666" X-IronPort-AV: E=Sophos;i="5.90,155,1643702400"; d="scan'208";a="314745666" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Mar 2022 10:09:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,155,1643702400"; d="scan'208";a="642586990" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga004.jf.intel.com with ESMTP; 04 Mar 2022 10:09:52 -0800 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Fri, 4 Mar 2022 10:09:52 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21 via Frontend Transport; Fri, 4 Mar 2022 10:09:52 -0800 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (104.47.73.170) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.21; Fri, 4 Mar 2022 10:09:51 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gKOciHdluzAdmMuGC2TJNesq6gwd1tOTaVXBKekljG65xbGqwe5gfpdY4l23C/FC/wUCwXx+ejPsjKpPtK8hpMnLeCI33fb7UdJc1Tt35xdPbsNdQ6aWoiSMPt5Di1Znmg2A724SvUaeqZ877eEjFT3X5fsRENGgAGTnp1DkEUzB5co5kWUjuZ6am9Yto+r8NsopM18U6bSv0OTXxiZO25L5pzrmJdKDYJ7EwJCy3WkxDak2tjPukvr+7fF5IWv+PHOjiZGq+ENDyXBTqe5DzTnZ3qbqcT8/kMUFU1jXLIoOpaNxMlyfSEK2nanPP8cOezftl/Rhq0BDMhh38SJsBw== 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=Ii+k/PxYdxyLIzQlrDj4E6EWDAXigdaRxlhVJEZ/GRM=; b=eGOCW57hqfvTHyNwNAu0dmYflwPCyq3KNcDfPgnK8SjCrBp5WsoVtfiJGiUBSzMXwh5gcOO9XeWIcX2dvpR1Xq/B1Pk2Oylu3jlfOeSC22AbL73/SSTxL56UU7uYTzdx7OufEESIoOFQg9bwvq/QlrbeH46tCtpqL66Ct6lBL/9eiJ0Outz4Cskd48FVZdsKnYxtiUfjriPHKGbNrO7oIhcX1gd8oBcimUGJhya3Vp4YmCa1wqXySYsZ09gh6c6HOFhsRCHI1qenrSzhl5VySxPKdO+BtyCQq15UdWepLOOmRRtIBRW3oQdDHffOTqV3xUm6PcPuNuzPEoQVBVWayw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from BYAPR11MB3622.namprd11.prod.outlook.com (2603:10b6:a03:fe::30) by BL3PR11MB5715.namprd11.prod.outlook.com (2603:10b6:208:352::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.14; Fri, 4 Mar 2022 18:09:49 +0000 Received: from BYAPR11MB3622.namprd11.prod.outlook.com ([fe80::45c8:c9c6:42a:a43d]) by BYAPR11MB3622.namprd11.prod.outlook.com ([fe80::45c8:c9c6:42a:a43d%4]) with mapi id 15.20.5038.014; Fri, 4 Mar 2022 18:09:49 +0000 From: "Guo Dong" To: "Pu, Yu" , "devel@edk2.groups.io" CC: "Ni, Ray" Subject: Re: [PATCH v1 7/7] UefiPayloadPkg: Invoke GetPhysicalAddressBits() and remove the duplicated code Thread-Topic: [PATCH v1 7/7] UefiPayloadPkg: Invoke GetPhysicalAddressBits() and remove the duplicated code Thread-Index: AQHYLhbAXw2ejfRshk67xPisQb/g46yvidng Date: Fri, 4 Mar 2022 18:09:49 +0000 Message-ID: References: <20220302091859.2783-1-yu.pu@intel.com> <20220302091859.2783-8-yu.pu@intel.com> In-Reply-To: <20220302091859.2783-8-yu.pu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.401.20 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: 956321d1-ad85-41e5-1cd0-08d9fe0a2c17 x-ms-traffictypediagnostic: BL3PR11MB5715:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: LJIo0Bz42pu7T/BjDJ/wT9fMHJZ2xOqEVjreEFkiHsbQMZUQqQHNz4bg1zFJEvoY4eTbcpv/dQVHdO54dwy3il0Fy1GGipr5X/yLOl58/pYheI2XEkNDDZwSq3JLGpcnE39GErq7t7e1Lvr3E2k8ZTc6RAIEOeuO7LX2W90S0RYOaqz2Ke4+gl80LqLl0xuUyV8yiYjELpjAhyNvSzNgoL9Q6ms9Qj/JEHmMRSdDTQeH+tHkc/LAW9xvONojTZP23XsyU8ThXvFOZRO80VI9UW24PtVJjsXxrGSXUzJyBy7+dzUtT9EoB8oKolcu+ozt+uwwJAVsU0d2G8LoT5k2/MZ/pmYBtq9GVLiy68J1la43oEuo4mW8DCimPOIrDMdQB1bKlPyKXp1ABmMLnce2EvpalOVTHIl7J9CCqPW5PyZj39CFON+lDIP6QaR6R3/sUS6TTLCZ/qXPmAAdi6pVa1k6heFV48CA+WymwEODp8GrbrqZO8b+X2QhofLNQBaiwlu/Kp01mIhGpFgltRprC/k7wUgCr2mYtwMd51xLeF4f4JWwKAXdH7FM1GmB89Ts9fpxZ4z1i/+3FmBdIPdF/e4CFNArnCaRdWHvMX049PKN31EEaRml9yWmlq/dNpEuyzOB77HsZEA14SxpKJyJ1AzW5NHGc+vYCfpGXM9Tl2/kCJru+u3JCA2poLZi3l4dn1C9qFensp64xtkeVEFHGORp5pG79PS7I6LRjiONFmbk2ldSM+5plMwOVtYWmiLl2Ucg1cG4Y4cFt6Jonr0Ymogz2avx+RBGMRKoxzW1X7I= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR11MB3622.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(2906002)(38100700002)(4326008)(76116006)(8676002)(82960400001)(66556008)(64756008)(66476007)(66446008)(66946007)(8936002)(38070700005)(5660300002)(122000001)(86362001)(52536014)(186003)(107886003)(83380400001)(9686003)(53546011)(71200400001)(55016003)(508600001)(7696005)(6506007)(966005)(110136005)(316002)(33656002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?CvvHech5qIKg/MaHWF7cQx+fQU3dEjLIJVEnVHgfRR9d48IK3TxNgpWFC+10?= =?us-ascii?Q?PlX+rPTdPpS85Nb5CHqjWPv9RFKdDV9mCHVrnR4s8rkXBfaBeSzoGfo4vLyS?= =?us-ascii?Q?dK3kUFmwKERW5JV1iexBaU+V03OWExJYL4CvuWleiFZAZ8j4mp+J0XRw1KCR?= =?us-ascii?Q?4ccNE5RikaJVUuPfsF1xzGiYRtEp9PxLhr3y0bXVBG8+HaJhRGDhkLEmrg7x?= =?us-ascii?Q?MKkw79AWVVzmChhyl/MTvX7/LWcmQ/oVOYQMKuGGvEMszRzry8B/2ztPdh6C?= =?us-ascii?Q?WVkCfd1msdh7hM+OMmIyP2EDFEMzgdsgup79UERvWcSwSRwykTL32xLLuty0?= =?us-ascii?Q?19k6RF6X1ssXGGTRQsrcP/P0FYFWeFNUyaQJwPm6P6rAu0wBrJl3HDkCGzO5?= =?us-ascii?Q?fqljKiVDUghHkSVyPC5gz3DJ19ptqBcWUWzr7TohN6AIiUcCOJfvUdtjyKv8?= =?us-ascii?Q?54BnDxbM3yAjm2txJlGTYYfVfin92cG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Ygu5jIUBDB7Wp0HtiLSxxohJ9E0PmeMt2DcgO1OjYeRNT?= =?us-ascii?Q?8hN0GEtdFv2npNWP6vv1gyZafjLOAO53o4RMabIQJ1R77JOWhqja7QjkHbOX?= =?us-ascii?Q?nRgmlkDB810qSEX/Qpph8iBRxzDgfhDxtOqnDyvLzimBy78qX4h/fZb2hovl?= =?us-ascii?Q?38OY1Ces24nEavB72fy74/Do2NWN2Gb7p1SY/pIwhMsJQi/rei3l9q/dIA2c?= =?us-ascii?Q?M2cQdEXM5SH8JAoStAEfbV9VjFinQjWco921gLeWjqRYLOlFG/epGf464+an?= =?us-ascii?Q?CcrTUOewzZvJQ3MaFFxanNRfwk0=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BYAPR11MB3622.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 956321d1-ad85-41e5-1cd0-08d9fe0a2c17 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Mar 2022 18:09:49.1538 (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: eIQNAUbOGOPBKHaEkiaNsjQy2kxLAi8Gm5qRIGyTahGibg6maSaic+zl/Dne/DZKBqYUKYSZhn4eTfm4C34LZA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR11MB5715 Return-Path: guo.dong@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Guo Dong -----Original Message----- From: Pu, Yu =20 Sent: Wednesday, March 2, 2022 2:19 AM To: devel@edk2.groups.io Cc: Pu, Yu ; Dong, Guo ; Ni, Ray Subject: [PATCH v1 7/7] UefiPayloadPkg: Invoke GetPhysicalAddressBits() and= remove the duplicated code REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3394 Invoke GetPhysicalAddressBits() defined in UefiCpuPkg for CPU physical addr= ess mask calculation and remove the duplicated code in UefiPayloadPkg\UefiP= ayloadEntry Cc: Guo Dong Cc: Ray Ni Signed-off-by: Yu Pu --- UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c | 10 ++-------- UefiP= ayloadPkg/UefiPayloadEntry/X64/VirtualMemory.c | 9 ++------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c b/UefiPaylo= adPkg/UefiPayloadEntry/UefiPayloadEntry.c index 0fed1e36918a..4378aa4f1d97 100644 --- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c +++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c @@ -4,6 +4,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/+#include #include "UefiPayloadEntry.h" @@ -341,7 +342,6 @@ BuildGenericHo= b ( VOID ) {- UINT32 RegEax; UINT8 = PhysicalAddressBits; EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttrib= ute; @@ -351,13 +351,7 @@ BuildGenericHob ( // // Build CPU memory space and IO space hob //- AsmCpuid (0x80000= 000, &RegEax, NULL, NULL, NULL);- if (RegEax >=3D 0x80000008) {- AsmCpu= id (0x80000008, &RegEax, NULL, NULL, NULL);- PhysicalAddressBits =3D (UI= NT8)RegEax;- } else {- PhysicalAddressBits =3D 36;- }+ PhysicalAddres= sBits =3D GetPhysicalAddressBits(NULL, NULL); BuildCpuHob (PhysicalAddre= ssBits, 16); diff --git a/UefiPayloadPkg/UefiPayloadEntry/X64/VirtualMemory= .c b/UefiPayloadPkg/UefiPayloadEntry/X64/VirtualMemory.c index ac0d58e685c8..c61aeeda7f2e 100644 --- a/UefiPayloadPkg/UefiPayloadEntry/X64/VirtualMemory.c +++ b/UefiPayloadPkg/UefiPayloadEntry/X64/VirtualMemory.c @@ -25,6 +25,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #include #include +#include= #include #include #include @@ -738,13 +739,7 @@ Cr= eateIdentityMappingPageTables ( if (Hob !=3D NULL) { PhysicalAddressBits =3D ((EFI_HOB_CPU *)Hob)->S= izeOfMemorySpace; } else {- AsmCpuid (0x80000000, &RegEax, NULL, NULL,= NULL);- if (RegEax >=3D 0x80000008) {- AsmCpuid (0x80000008, &RegE= ax, NULL, NULL, NULL);- PhysicalAddressBits =3D (UINT8)RegEax;- } e= lse {- PhysicalAddressBits =3D 36;- }+ PhysicalAddressBits =3D G= etPhysicalAddressBits (NULL, NULL); } //--=20 2.30.0.windows.2