From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web10.2536.1646451784633778026 for ; Fri, 04 Mar 2022 19:43:04 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=WBBqEVpc; spf=pass (domain: intel.com, ip: 134.134.136.20, 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=1646451784; x=1677987784; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=M0mV6iMFZpzFeBK8/CWBcYNaaUmeSfncBV0LRz6D/ko=; b=WBBqEVpcbIwlIQnznV+o6guxYm0TWhgx0SxKvxzvp/kLihvgo3aEjcfv p7hAj9B2qx7skuDoLRrd4nO7QTkkOy8FhSFjvKcmnCFwYTPjlQ9S+R/Ol AfFOOpIUmwtAznzAD+LHYt5G6/9AmI+h/0Uyg6CXnVL8I4dI/iyhF4jag zWMzJ3bs6CdTHxlLN4JWkLokgfhRCLyocm745n+dM8TNjdMGU4s79Z/un tnZ/cqWQos7AFQib9mQlDdKz6fluDI+ByjaffH1LA62pntTQsLFSqB+FX YhKAlpNEaTHDV4Iqquqw1VN9YNIEfuPUX689S4Wmt6qlTeRpwMsd1MK0h g==; X-IronPort-AV: E=McAfee;i="6200,9189,10276"; a="241536068" X-IronPort-AV: E=Sophos;i="5.90,157,1643702400"; d="scan'208";a="241536068" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Mar 2022 19:43:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,157,1643702400"; d="scan'208";a="552465525" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga008.jf.intel.com with ESMTP; 04 Mar 2022 19:43:03 -0800 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) 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.2308.21; Fri, 4 Mar 2022 19:43:03 -0800 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX608.amr.corp.intel.com (10.22.229.21) 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 19:43:02 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) 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.21 via Frontend Transport; Fri, 4 Mar 2022 19:43:02 -0800 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.41) 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.21; Fri, 4 Mar 2022 19:43:02 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y/K1ILPmElRsMKrwg9wqy7KEPvLQGdP4TqqK2kqDuGRKFqFgepE0cw4wPIo/SwwVxoUHWObtTVWm0nctVe3Cy8i4FkqSFisliflZeSuXNHGZm57jmlPDlsENzlymSabEEpjoUOmAxFEI54iq5i2jlvIDgfdOq1E3SzV30q0r+P2P4w/yBlIn9KhRp2/jNfm62jpEB2lU0EK9ceVIdUM8ltXrVaOMRgvs2eGGgT3Bq93F/iNKsEC9AbPD8j6XdfTmPiIQqBm/iJMSIUTF9aeHGDhLNRxL6rsw514XcJgjAp9tCa0EzZg4YKRPnbP035q6MROcFA+Hl46CJHj9o+X6Lg== 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=ycc5FklydNmabQJhPPVVlD4bL/WfQNORiDFhzMIds4Q=; b=SjRRNBGIdjgEt7zuuZHIsAiBZjvYFpq16mryJNUov2H5pv7BXoWNoUbPMIvEsXCeZ6lrx3FiEDj59lyIYJvyXz2L4L53+q1/u+asC6nEiVqv21qZ5xnnvl2ru8dkiri66x+8v79KzMwAWRRDvo8AwN6ramm2K1JhW/I9DQdNZN9Dlw9vVW+v8hOmnyoCQRvSBoCDWOZ/cVHXlNPBIOea/7xGCbovmfql3jwktXTDVxVe4akrp6oV84A2VsSwahXVdQuXPSxBshwW5gmC9PztzeMQ6DNmjl0plR7HuOmpflohY92LJmQ23f87jBwYbw0QQ7WyODbMcZ97wO4mqFJn+g== 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 SN6PR11MB3421.namprd11.prod.outlook.com (2603:10b6:805:cd::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.14; Sat, 5 Mar 2022 03:43:00 +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; Sat, 5 Mar 2022 03:43:00 +0000 From: "Guo Dong" To: "devel@edk2.groups.io" , "Dong, Guo" , "Pu, Yu" CC: "Ni, Ray" Subject: Re: [edk2-devel] [PATCH v1 7/7] UefiPayloadPkg: Invoke GetPhysicalAddressBits() and remove the duplicated code Thread-Topic: [edk2-devel] [PATCH v1 7/7] UefiPayloadPkg: Invoke GetPhysicalAddressBits() and remove the duplicated code Thread-Index: AQHYLhbAXw2ejfRshk67xPisQb/g46yvidnggACfrvA= Date: Sat, 5 Mar 2022 03:43:00 +0000 Message-ID: References: <20220302091859.2783-1-yu.pu@intel.com> <20220302091859.2783-8-yu.pu@intel.com> <16D93FE5C3E39310.28436@groups.io> In-Reply-To: <16D93FE5C3E39310.28436@groups.io> 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: 5076dd14-6eda-4c23-0ccf-08d9fe5a3f02 x-ms-traffictypediagnostic: SN6PR11MB3421: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: P9iwKkPMWIG/F6BzKll7ZAhzTul6NjMNSLf59lZblf1HfH6Og0PxI4XMA7LMc3mCxj0nXXQUXpYPs/idxBdwvgZRyShBNmkAOKaa2SrFdmhdKyIzZ1h/X+ukPuacvbizh+eTurKns2njx3W7dx/+Vl/WKVRh0suxwRE6kvO5oBOjhRwaD/1zO7eZMun+RngeSqPijO1QX5aSc+XKd+uczRDncdlOKjEFJsZsu3C2rzkpVEC0AnjYv6N8NL8eBjb/eZlc6rXq0I5FmI53/uAxx081/HYJtb26xEG0IRE+kiMqI2HK0F8TJ/xo45t36CLJ9ZGZ0PjIORAERsLacJQefNJ59IqNCAgfy2Shbx6fiN2yz7n3GZ6yf+uwbaKpejZQoII7w1VvtwdIkh4eZFE/qr/dJK1R8M162/4Ij4ISA1Xcbo8o2pX5sa0+KZyq1UbGz22s/BujP4Wn0EbswdxPV3jNXuY15BT5rau90q+KeWsJEpFN9HmzI/6spz4s/LMNZSgzgP48Ca5MKgelrQGX77wL1WbboD+4O9zqropQIyqPLbTCj0sIP2WQNDiBber6tD2Kms98eQmUPeKTsZ2ufOlrpmpEwSC5MnZnMQ8Tv7Wc5i7kI6c7fLroHmf/vM1RsTvgn6QZ6Ip940gaiZrVl6ly5ehkvo2HyEx0+YXEs8wLDLnS1NBkI2ffvvYGjqcCwTqXvR8QCLRebq2FXGotH6arJYZLV2igXetR+VOiStmPRqUiIlOBTEHmyUmpgWKHIqOV+LL/I1grvt8R0syn7QXwm/MWKmXyAgvoOghmg6IMR0Md49dsYQ3NTZBtILTeD6RJLeB6Ugv6+aT/pMyq7Q== 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)(110136005)(53546011)(55016003)(83380400001)(316002)(966005)(8936002)(86362001)(52536014)(6636002)(186003)(38070700005)(33656002)(7696005)(6506007)(82960400001)(122000001)(71200400001)(5660300002)(107886003)(76116006)(38100700002)(508600001)(8676002)(66946007)(64756008)(4326008)(66446008)(66476007)(9686003)(66556008)(2906002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?LsLLlgkS3H4Tk5us4CBnyxmlKu9ZItDB2IHgFjdhGfi4gKwKKoRIb6QUTt+F?= =?us-ascii?Q?b0dzF19J4vsIiIshM4ChnF26gM90vAiaZhOounWChOViA7C7bZJVy9dwBfkX?= =?us-ascii?Q?icF/RrFlmV+H145yrIVQP2MB65ALHTd7WNizrtvYcKFD11p73qLCdZbcTUEc?= =?us-ascii?Q?l1FBWXYLLjgu+rHilLOZxJ4Zfe/vksjsuHBSJK95n+C0H9z6rAYSV+4z39oI?= =?us-ascii?Q?U9px4oPvO1ZYafFGimQP+YMLOIWJ9PNNy/6fz4KIxaLLMC6qW/mM1MfnU2Nh?= =?us-ascii?Q?gPYbp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HJ9EkBd?= =?us-ascii?Q?WTBwTE+vx9GE2P0w5tJTgBeuaS6OeOGmdG30gS8z3AmRQnSz7jo6cYNtYWWi?= =?us-ascii?Q?yuhj7pDEuDFPi8TJZqLQp/24VOOWiLoKv3hd7ClthhalorT77uIYLhjTthmh?= =?us-ascii?Q?+Hp53YmFKmPcXeownjZ8gd9ihp66INCfqwldqMDyaKaALvWmjn2cPAwNR3gS?= =?us-ascii?Q?JgVMI/1ZIxSQXpXsg4OhoUy1nywsTkiScHt0DUD0w45BfR1zRaiFsqg+hMLq?= =?us-ascii?Q?KgRPSeg0szCtu0VyZe5/qOVqkpqZGxBOi19hKzTPIyt5jo3IXTk1uS9BD9fE?= =?us-ascii?Q?3Oghh4bS1MNf9BVSd8jTEEBm+pUBZ5VGmfnKjgt9BGGIRNoQ3Xwot3isDKaQ?= =?us-ascii?Q?J3ecIQo4aCS+yse4Ipegu6FqQ0zl+5b1cWRVnHZJnKVlEz2ZoHO5a09CC+5j?= =?us-ascii?Q?msIvesG4iOEgWYD64VxOQKhue5DpLAvtH6vww7gWwObW5p4Ne13aRB+NdS1A?= =?us-ascii?Q?W72wR7j6mmrYr61emK80sNUEsEI=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: 5076dd14-6eda-4c23-0ccf-08d9fe5a3f02 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Mar 2022 03:43:00.6152 (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: oZ897z0bEDA2PTNfgEFS51k1OFUtvCu3+eshdDSWGlcWBk+P9vhQM+20JVFhRWRT3evqjNTAh7OOzB8yIPQzYA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB3421 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 Please double check, the commit message doesn't pass patch check. And it looks GetPhysicalAddressBits() is not an API from UefiCpuLib.h since= the build failed. Thanks, Guo -----Original Message----- From: devel@edk2.groups.io On Behalf Of Guo Dong Sent: Friday, March 4, 2022 11:10 AM To: Pu, Yu ; devel@edk2.groups.io Cc: Ni, Ray Subject: Re: [edk2-devel] [PATCH v1 7/7] UefiPayloadPkg: Invoke GetPhysical= AddressBits() and remove the duplicated code 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