From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web11.5491.1646213190108894408 for ; Wed, 02 Mar 2022 01:26:30 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=ASXAdw4e; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: chasel.chiu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646213190; x=1677749190; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=ZprTJryXrEU8t3XnYM65HYiDV051hFoiaMwwHLDyn5k=; b=ASXAdw4eR1SQr9SxhR8jwWa/iLmU7C8eHC9oet0wDEtIYT6E+J2W60Sc A2imD1K6n2otCPSLGotK+BK/Jn7F9t7ajknTKhZ3/3E40P/hYal+jL6iu T818d9bMpcJp9scfx7fwgE5LqYbNZcC2WYgFINCwhx+5QPA4oNhO9LZiG C+EpifN2ORJ3d1ezUbpicr2946nRJIkA/l9QZNGzkOE9178JcPNX3B5bC BvYf1DmasoaCfdapWOgQ4Vp333uKXNdzhExugEoDotI8W48C7Wu63fAxF VhZC9foDX8HK711NdRjzs6kLYg3kUGd3wOSexYnvdvphryIiGKSUUzm4G A==; X-IronPort-AV: E=McAfee;i="6200,9189,10273"; a="236869218" X-IronPort-AV: E=Sophos;i="5.90,148,1643702400"; d="scan'208";a="236869218" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Mar 2022 01:26:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,148,1643702400"; d="scan'208";a="641632372" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga004.jf.intel.com with ESMTP; 02 Mar 2022 01:26:27 -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; Wed, 2 Mar 2022 01:26:27 -0800 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) 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; Wed, 2 Mar 2022 01:26:26 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) 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.21 via Frontend Transport; Wed, 2 Mar 2022 01:26:26 -0800 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.43) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Wed, 2 Mar 2022 01:26:26 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hvjYeOPLgdWTFGyg7ZAqPIz/cZT8lzsGBS8UyyuggQtSrkudOqK5ZHigamAdIjEF1BiZ9NauFYFSCk1HgYAAWcL1EYfodineDFRS1xz8MI+ACUdCfCHB0EwcaiyAtzs5pmW7GE3e1gIRrWXKDBAwwk9MK/McMs1IqrlBgeSD6HZgVImjn6sB8yKBtivo8URr0O3ZqsuYaIj4wQBsBOfZaJlT1sLm0Z614JWfxk9mU8sqvKCJLiebimUIyMru65amFueaUF/PHFcdGMh74f9DeY3HD58e/zfDMR2MG0wWFxFuwj2s4SS8E7WQParEWBIqHF9psgbGr4IFRklYabKtsw== 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=s/sJrhCmmAe5ihGQRQubXsBerFkiApmLagXEytE+pIQ=; b=HLcEpL5Huy9j+Zx77D6NQ+ava0hQuNFJqmCVGFBSAlagjKYURHlS7X04ULmB3pWm+A0NJxq6ksbxB4CHp7R+btP+ZQW/fb5fGmMdZzUgLGoPdt1RKlsgcai3Lk+6FAl/j76MSh4zMAFwX0WaQL+AYw+nUv9bghPx8S7g+X1I7Vm0NUgNgLilbAvEoeDRp7MOJZq4e2+r59IlsgJ+CGEn93VH+HzWqU7bW0eU+GDsdSd1u2/LrPdEHcGP0wbjSYLarixzPj6TDGlPoOSIsNwMDjcgMNa4GA3cE0SzNMYC6LpsxI8mv0tAvOtdOOOJdxc/EiLFojQPcWFKSju4WPXoJA== 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 BN9PR11MB5483.namprd11.prod.outlook.com (2603:10b6:408:104::10) by PH0PR11MB4789.namprd11.prod.outlook.com (2603:10b6:510:38::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.14; Wed, 2 Mar 2022 09:26:24 +0000 Received: from BN9PR11MB5483.namprd11.prod.outlook.com ([fe80::8c4b:e24c:c69f:7809]) by BN9PR11MB5483.namprd11.prod.outlook.com ([fe80::8c4b:e24c:c69f:7809%6]) with mapi id 15.20.5038.014; Wed, 2 Mar 2022 09:26:24 +0000 From: "Chiu, Chasel" To: "Pu, Yu" , "devel@edk2.groups.io" Subject: Re: [PATCH v1 3/7] IntelFsp2Pkg: Invoke GetPhysicalAddressBits() and remove the duplicated code Thread-Topic: [PATCH v1 3/7] IntelFsp2Pkg: Invoke GetPhysicalAddressBits() and remove the duplicated code Thread-Index: AQHYLha4a0I4nUxkgEKpxrrDozRMpqyr0sgQ Date: Wed, 2 Mar 2022 09:26:24 +0000 Message-ID: References: <20220302091859.2783-1-yu.pu@intel.com> <20220302091859.2783-4-yu.pu@intel.com> In-Reply-To: <20220302091859.2783-4-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: 6387d00c-796f-4a1b-5ff0-08d9fc2eb869 x-ms-traffictypediagnostic: PH0PR11MB4789: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: zCUIGCkbaZznpsH2GIQVSHukUXCM2CRDYWXG3B4JjqIST5pbfVZqYhuYX05bnQY09PRgFF6nq2RQ9ZUofTiXgsYi89tw6YPRKP2kHdvB753n4e0abXjAnZH37szzJZlR9iJ6PItvNDmil6KEWYJjKesZ6a+oDPEXOO0t00zTmtZkWUyqAP7uWeolrMJhqfQeCNUB5ufzZ6g3HCkzwmjoaoOcDD+Kpe9IvC7jRsWKMvyaLIQx5Zu0JM+YxWlATr71bKt9Rn3WUbai/qMn7gGjWHT/4tIKjAkDGWzozQR4OsqexxzkZOonUpPbVvxWlioTtSYDQCnYXifVH5b3L9cZjBflAyAv4+7DknC8MkKT8cFaLU8fIeEwvyZyTSZ5cFzw4gAOhd6/GKlwbiI5t4sgxQ+PJcKAONvwcbhmRVrzsuQPmACplrcKeofGZ1tgTCVfMw1kGK9bgJ//Rfb9nwfaGI75cKoOf+WicrNzksxNnQ+wCejEZVEHtyOamKatFtKByHRhLp77nwAK2eJqmzWBxtbDtpVLzYQG3aBezDcDjwVFtWpH2Rvxf2Y0xiewdEORxEUe2HxRAOBvpaAG05xAQWBQMnmCv11sLctMQb16kb20biqeQTtu9Fl3VWf6OlwOrrLLirheyddYxErkFfniDtvgdfAjP5hd/oqMHkWSY56wnT03ECrSfW4eRQK43SeCvaZX+7S7tOMq8sJcUKX7sOqIziLjwZs034MR05V/3nnVaF6E9DYNQvBEhRENWo4CufPZ01JdR0R4fQD4cZOVzzsx8B2n/BID9hU54cu5A8Pk7B1S4YPQqvLsM04q2nGP x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN9PR11MB5483.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(83380400001)(71200400001)(2906002)(55016003)(9686003)(26005)(186003)(33656002)(53546011)(6506007)(7696005)(38070700005)(38100700002)(19627235002)(316002)(110136005)(86362001)(66946007)(66556008)(66476007)(66446008)(64756008)(76116006)(8676002)(122000001)(508600001)(52536014)(8936002)(82960400001)(5660300002)(966005)(11716005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?E/SWLLD0WSI8OON0XPQNCYfYqrq4j76h1YwfzffNV6zBXpRQu87q1gGNc3mh?= =?us-ascii?Q?i018B5C0rtHk8Rnft/C7MArOBM4GkJnfcl+XXNs813sfVXZC/Dr2Oz3AktoM?= =?us-ascii?Q?UfyM/xBSNJosGCY3WNJPjqVfg5AA3e456bG9zPx7+A7UqzFar263rrgUbwvx?= =?us-ascii?Q?4hwYMSZV5wmrFRpsHOtr9xkrdMSq4QLNplrJ90NTMzwE5B8vbVI9DzbC0vqO?= =?us-ascii?Q?Lk2gBy0N3/yQNEkxNxoXlqPyM+qDOPT3OAK+KSnRGIzIFSJzOqhzC4CcwE2n?= =?us-ascii?Q?AB4GtbYd+qgONv6UmXRv4kg10OAT71rKRgKLAjaXyjSIPaktEH2zsKl8B8ij?= =?us-ascii?Q?hiyDc1uG8pepNKOLfKTIKKAqNxRt/EMlAV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nZ4ghDwUvo8FcM8aZrwEZ6OFYJZdp5whT1npighOAlVMRyePcR5uUGwcYP?= =?us-ascii?Q?sw+ED3srTgNc9taG9IGq45Jty6HmFZtLGGWcOa+aQLZKmsWPeB7t4J5XLGdQ?= =?us-ascii?Q?nWWLZE25N0lh6RXV2ii5mmbpVAnuUU03IYbSU+ODyqv456clLpCpIrG8PCyH?= =?us-ascii?Q?k9XGqdGvBPGIOZVRGOqCQpCer4e+DSnBfDmhDSEY10Q+4jjbAv5ktLtis6Yz?= =?us-ascii?Q?tQKfyH15c8GeoRrQnNmq1QT7E3QIPPFH+s58x/1jSCmlI3T2TDMW2+vls7+q?= =?us-ascii?Q?aZqm8VzzdLmEz01cA0edFvtDQvz7DhuYmnHJQ3diAc/RRh9pBAklNHrPcZEx?= =?us-ascii?Q?GmEYXU7xvEy0h+eTxPeW2Zw=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN9PR11MB5483.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6387d00c-796f-4a1b-5ff0-08d9fc2eb869 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Mar 2022 09:26:24.1619 (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: Pz+olAfVy+KFBWtJkgEZU32Cs5TKagsqDzLwiKeko+rGHGn9kt8TzpDdllDV7qiSUpvZErCyzWJBE9peL3IeIg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4789 Return-Path: chasel.chiu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thanks Yu! Reviewed-by: Chasel Chiu > -----Original Message----- > From: Pu, Yu > Sent: Wednesday, March 2, 2022 5:19 PM > To: devel@edk2.groups.io > Cc: Pu, Yu ; Chiu, Chasel > Subject: [PATCH v1 3/7] IntelFsp2Pkg: Invoke GetPhysicalAddressBits() and > remove the duplicated code >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3394 >=20 > Invoke GetPhysicalAddressBits() defined in UefiCpuPkg for CPU physical ad= dress > mask calculation and remove the duplicated code in > edk2\IntelFsp2Pkg\Library\BaseCacheLib\CacheLib.c. >=20 > Cc: Chasel Chiu >=20 > Signed-off-by: Yu Pu > --- > IntelFsp2Pkg/Library/BaseCacheLib/CacheLib.c | 10 ++-------- > IntelFsp2Pkg/Library/BaseCacheLib/BaseCacheLib.inf | 2 ++ > 2 files changed, 4 insertions(+), 8 deletions(-) >=20 > diff --git a/IntelFsp2Pkg/Library/BaseCacheLib/CacheLib.c > b/IntelFsp2Pkg/Library/BaseCacheLib/CacheLib.c > index f879c268e7ec..3f8ed122b2be 100644 > --- a/IntelFsp2Pkg/Library/BaseCacheLib/CacheLib.c > +++ b/IntelFsp2Pkg/Library/BaseCacheLib/CacheLib.c > @@ -9,6 +9,7 @@ > #include #include #include > +#include #include > "CacheLibInternal.h" /**@@ -388,15 +389,8 @@ SetCacheAttributes ( > UINT32 UsedMsrNum; EFI_MEMORY_CACHE_TYPE > UsedMemoryCacheType; UINT64 ValidMtrrAddressMask;- UIN= T32 > Cpuid_RegEax; - AsmCpuid (CPUID_EXTENDED_FUNCTION, &Cpuid_RegEax, > NULL, NULL, NULL);- if (Cpuid_RegEax >=3D CPUID_VIR_PHY_ADDRESS_SIZE) {- > AsmCpuid (CPUID_VIR_PHY_ADDRESS_SIZE, &Cpuid_RegEax, NULL, NULL, > NULL);- ValidMtrrAddressMask =3D (LShiftU64 ((UINT64)1, (Cpuid_RegEax = & > 0xFF)) - 1) & (~(UINT64)0x0FFF);- } else {- ValidMtrrAddressMask =3D = (LShiftU64 > ((UINT64)1, 36) - 1) & (~(UINT64)0x0FFF);- }+ GetPhysicalAddressBits(NU= LL, > &ValidMtrrAddressMask); // // Check for invalid parameterdiff --git > a/IntelFsp2Pkg/Library/BaseCacheLib/BaseCacheLib.inf > b/IntelFsp2Pkg/Library/BaseCacheLib/BaseCacheLib.inf > index 9a513fb6df77..e6b14ae4a802 100644 > --- a/IntelFsp2Pkg/Library/BaseCacheLib/BaseCacheLib.inf > +++ b/IntelFsp2Pkg/Library/BaseCacheLib/BaseCacheLib.inf > @@ -21,9 +21,11 @@ > [Packages] MdePkg/MdePkg.dec+ UefiCpuPkg/UefiCpuPkg.dec > IntelFsp2Pkg/IntelFsp2Pkg.dec [LibraryClasses] BaseMemoryLib > CacheAsRamLib+ UefiCpuLib -- > 2.30.0.windows.2