From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.126; helo=mga18.intel.com; envelope-from=eric.dong@intel.com; receiver=edk2-devel@lists.01.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 64A35211D07AE for ; Wed, 6 Mar 2019 18:48:52 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Mar 2019 18:48:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,450,1544515200"; d="scan'208";a="152756851" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga001.fm.intel.com with ESMTP; 06 Mar 2019 18:48:52 -0800 Received: from fmsmsx115.amr.corp.intel.com (10.18.116.19) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 6 Mar 2019 18:48:51 -0800 Received: from shsmsx108.ccr.corp.intel.com (10.239.4.97) by fmsmsx115.amr.corp.intel.com (10.18.116.19) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 6 Mar 2019 18:48:51 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.163]) by SHSMSX108.ccr.corp.intel.com ([169.254.8.57]) with mapi id 14.03.0415.000; Thu, 7 Mar 2019 10:48:49 +0800 From: "Dong, Eric" To: "Zeng, Star" , "edk2-devel@lists.01.org" CC: "Ni, Ray" , "Laszlo Ersek (lersek@redhat.com)" , "Gao, Liming" Thread-Topic: [edk2] [Patch v2 2/4] UefiCpuPkg/RegisterCpuFeaturesLib: Optimize PCD PcdCpuFeaturesUserConfiguration. Thread-Index: AQHUz/FbaR8TP8CCn0CCSY9TB+W7IaX8TQQAgAAAfYCAAzKyUA== Date: Thu, 7 Mar 2019 02:48:49 +0000 Message-ID: References: <20190301053957.3572-1-eric.dong@intel.com> <20190301053957.3572-3-eric.dong@intel.com> <0C09AFA07DD0434D9E2A0C6AEB0483104028C6C4@shsmsx102.ccr.corp.intel.com> <0C09AFA07DD0434D9E2A0C6AEB0483104028C6E6@shsmsx102.ccr.corp.intel.com> In-Reply-To: <0C09AFA07DD0434D9E2A0C6AEB0483104028C6E6@shsmsx102.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch v2 2/4] UefiCpuPkg/RegisterCpuFeaturesLib: Optimize PCD PcdCpuFeaturesUserConfiguration. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2019 02:48:53 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Star, Thanks for your comments. It's more clear when mine. Will update it in my n= ext version changes. Also I will add this change info in the upgrade notes. Thanks, Eric > -----Original Message----- > From: Zeng, Star > Sent: Tuesday, March 5, 2019 5:57 PM > To: Dong, Eric ; edk2-devel@lists.01.org > Cc: Ni, Ray ; Laszlo Ersek (lersek@redhat.com) > ; Gao, Liming ; Zeng, Star > > Subject: RE: [edk2] [Patch v2 2/4] UefiCpuPkg/RegisterCpuFeaturesLib: > Optimize PCD PcdCpuFeaturesUserConfiguration. >=20 > And suggest update the title to be like "UefiCpuPkg: Retire > PcdCpuFeaturesUserConfiguration". >=20 > Thanks, > Star > -----Original Message----- > From: Zeng, Star > Sent: Tuesday, March 5, 2019 5:55 PM > To: Dong, Eric ; edk2-devel@lists.01.org > Cc: Ni, Ray ; Laszlo Ersek (lersek@redhat.com) > ; Gao, Liming ; Zeng, Star > > Subject: RE: [edk2] [Patch v2 2/4] UefiCpuPkg/RegisterCpuFeaturesLib: > Optimize PCD PcdCpuFeaturesUserConfiguration. >=20 > It should be an incompatible change to remove > PcdCpuFeaturesUserConfiguration. > Please add upgrade notes for it. I know upgrade notes for 2019 Q1 stable = tag > is at https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Releas= e- > Notes. I do not know where is the link for 2019 Q1 stable tag. Liming may > know it. >=20 >=20 > Thanks, > Star > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Eric Dong > Sent: Friday, March 1, 2019 1:40 PM > To: edk2-devel@lists.01.org > Subject: [edk2] [Patch v2 2/4] UefiCpuPkg/RegisterCpuFeaturesLib: Optimiz= e > PCD PcdCpuFeaturesUserConfiguration. >=20 > Merge PcdCpuFeaturesUserConfiguration into PcdCpuFeaturesSetting. > Use PcdCpuFeaturesSetting as input for the user input feature setting Use > PcdCpuFeaturesSetting as output for the final CPU feature setting >=20 > BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=3D1375 >=20 > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Eric Dong > --- > .../RegisterCpuFeaturesLib/CpuFeaturesInitialize.c | 71 +++++-----------= ------ > .../DxeRegisterCpuFeaturesLib.inf | 3 +- > .../PeiRegisterCpuFeaturesLib.inf | 3 +- > .../RegisterCpuFeaturesLib/RegisterCpuFeatures.h | 1 - > UefiCpuPkg/UefiCpuPkg.dec | 9 +-- > 5 files changed, 21 insertions(+), 66 deletions(-) >=20 > diff --git > a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c > b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c > index bae92b89a6..d877caff74 100644 > --- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c > +++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c > @@ -21,16 +21,21 @@ CHAR16 *mRegisterTypeStr[] =3D {L"MSR", L"CR", > L"MMIO", L"CACHE", L"SEMAP", L"INVA > Worker function to save PcdCpuFeaturesCapability. >=20 > @param[in] SupportedFeatureMask The pointer to CPU feature bits mask > buffer > + @param[in] FeatureMaskSize CPU feature bits mask buffer size. > + > **/ > VOID > SetCapabilityPcd ( > - IN UINT8 *SupportedFeatureMask > + IN UINT8 *SupportedFeatureMask, > + IN UINT32 FeatureMaskSize > ) > { > EFI_STATUS Status; > UINTN BitMaskSize; >=20 > BitMaskSize =3D PcdGetSize (PcdCpuFeaturesCapability); > + ASSERT (FeatureMaskSize =3D=3D BitMaskSize); > + > Status =3D PcdSetPtrS (PcdCpuFeaturesCapability, &BitMaskSize, > SupportedFeatureMask); > ASSERT_EFI_ERROR (Status); > } > @@ -53,48 +58,6 @@ SetSettingPcd ( > ASSERT_EFI_ERROR (Status); > } >=20 > -/** > - Worker function to get PcdCpuFeaturesSupport. > - > - @return The pointer to CPU feature bits mask buffer. > -**/ > -UINT8 * > -GetSupportPcd ( > - VOID > - ) > -{ > - UINT8 *SupportBitMask; > - > - SupportBitMask =3D AllocateCopyPool ( > - PcdGetSize (PcdCpuFeaturesSupport), > - PcdGetPtr (PcdCpuFeaturesSupport) > - ); > - ASSERT (SupportBitMask !=3D NULL); > - > - return SupportBitMask; > -} > - > -/** > - Worker function to get PcdCpuFeaturesUserConfiguration. > - > - @return The pointer to CPU feature bits mask buffer. > -**/ > -UINT8 * > -GetConfigurationPcd ( > - VOID > - ) > -{ > - UINT8 *SupportBitMask; > - > - SupportBitMask =3D AllocateCopyPool ( > - PcdGetSize (PcdCpuFeaturesUserConfiguration), > - PcdGetPtr (PcdCpuFeaturesUserConfiguration) > - ); > - ASSERT (SupportBitMask !=3D NULL); > - > - return SupportBitMask; > -} > - > /** > Collects CPU type and feature information. >=20 > @@ -287,7 +250,6 @@ CpuInitDataInitialize ( > // Get support and configuration PCDs > // > CpuFeaturesData->SupportPcd =3D GetSupportPcd (); > - CpuFeaturesData->ConfigurationPcd =3D GetConfigurationPcd (); } >=20 > /** > @@ -610,16 +572,9 @@ AnalysisProcessorFeatures ( > // > // Calculate the last setting > // > - > CpuFeaturesData->SettingPcd =3D AllocateCopyPool (CpuFeaturesData- > >BitMaskSize, CpuFeaturesData->CapabilityPcd); > ASSERT (CpuFeaturesData->SettingPcd !=3D NULL); > - SupportedMaskAnd (CpuFeaturesData->SettingPcd, CpuFeaturesData- > >ConfigurationPcd); > - > - // > - // Save PCDs and display CPU PCDs > - // > - SetCapabilityPcd (CpuFeaturesData->CapabilityPcd); > - SetSettingPcd (CpuFeaturesData->SettingPcd); > + SupportedMaskAnd (CpuFeaturesData->SettingPcd, PcdGetPtr > + (PcdCpuFeaturesSetting)); >=20 > // > // Dump the last CPU feature list > @@ -643,14 +598,20 @@ AnalysisProcessorFeatures ( > } > DEBUG ((DEBUG_INFO, "PcdCpuFeaturesSupport:\n")); > DumpCpuFeatureMask (CpuFeaturesData->SupportPcd); > - DEBUG ((DEBUG_INFO, "PcdCpuFeaturesUserConfiguration:\n")); > - DumpCpuFeatureMask (CpuFeaturesData->ConfigurationPcd); > DEBUG ((DEBUG_INFO, "PcdCpuFeaturesCapability:\n")); > DumpCpuFeatureMask (CpuFeaturesData->CapabilityPcd); > - DEBUG ((DEBUG_INFO, "PcdCpuFeaturesSetting:\n")); > + DEBUG ((DEBUG_INFO, "Origin PcdCpuFeaturesSetting:\n")); > + DumpCpuFeatureMask (PcdGetPtr (PcdCpuFeaturesSetting)); > + DEBUG ((DEBUG_INFO, "Final PcdCpuFeaturesSetting:\n")); > DumpCpuFeatureMask (CpuFeaturesData->SettingPcd); > ); >=20 > + // > + // Save PCDs and display CPU PCDs > + // > + SetCapabilityPcd (CpuFeaturesData->CapabilityPcd, > + CpuFeaturesData->BitMaskSize); SetSettingPcd > + (CpuFeaturesData->SettingPcd); > + > for (ProcessorNumber =3D 0; ProcessorNumber < NumberOfCpus; > ProcessorNumber++) { > CpuInitOrder =3D &CpuFeaturesData->InitOrder[ProcessorNumber]; > Entry =3D GetFirstNode (&CpuFeaturesData->FeatureList); diff --git > a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/DxeRegisterCpuFeaturesLib.i > nf > b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/DxeRegisterCpuFeaturesLib.i > nf > index 362e0c6cd1..957ca87ff1 100644 > --- > a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/DxeRegisterCpuFeaturesLib.i > nf > +++ > b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/DxeRegisterCpuFeaturesLi > +++ b.inf > @@ -56,9 +56,8 @@ > [Pcd] > gUefiCpuPkgTokenSpaceGuid.PcdCpuS3DataAddress #= # > CONSUMES > gUefiCpuPkgTokenSpaceGuid.PcdCpuFeaturesSupport #= # > CONSUMES > - gUefiCpuPkgTokenSpaceGuid.PcdCpuFeaturesUserConfiguration #= # > CONSUMES > gUefiCpuPkgTokenSpaceGuid.PcdCpuFeaturesCapability #= # > PRODUCES > - gUefiCpuPkgTokenSpaceGuid.PcdCpuFeaturesSetting #= # > PRODUCES > + gUefiCpuPkgTokenSpaceGuid.PcdCpuFeaturesSetting #= # > PRODUCES ## CONSUMES >=20 > [Depex] > gEfiMpServiceProtocolGuid AND gEdkiiCpuFeaturesSetDoneGuid diff --git > a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/PeiRegisterCpuFeaturesLib.in > f > b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/PeiRegisterCpuFeaturesLib.in > f > index f3907e25d3..659aa9eaaf 100644 > --- > a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/PeiRegisterCpuFeaturesLib.in > f > +++ > b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/PeiRegisterCpuFeaturesLi > +++ b.inf > @@ -57,9 +57,8 @@ > [Pcd] > gUefiCpuPkgTokenSpaceGuid.PcdCpuS3DataAddress #= # > CONSUMES > gUefiCpuPkgTokenSpaceGuid.PcdCpuFeaturesSupport #= # > CONSUMES > - gUefiCpuPkgTokenSpaceGuid.PcdCpuFeaturesUserConfiguration #= # > CONSUMES > gUefiCpuPkgTokenSpaceGuid.PcdCpuFeaturesCapability #= # > PRODUCES > - gUefiCpuPkgTokenSpaceGuid.PcdCpuFeaturesSetting #= # > PRODUCES > + gUefiCpuPkgTokenSpaceGuid.PcdCpuFeaturesSetting #= # > CONSUMES ## PRODUCES >=20 > [Depex] > gEfiPeiMpServicesPpiGuid AND gEdkiiCpuFeaturesSetDoneGuid diff --git > a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeatures.h > b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeatures.h > index 21dd5773a6..3e0a342fd1 100644 > --- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeatures.h > +++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeatures.h > @@ -83,7 +83,6 @@ typedef struct { > CPU_FEATURES_INIT_ORDER *InitOrder; > UINT8 *SupportPcd; > UINT8 *CapabilityPcd; > - UINT8 *ConfigurationPcd; > UINT8 *SettingPcd; >=20 > UINT32 NumberOfCpus; > diff --git a/UefiCpuPkg/UefiCpuPkg.dec b/UefiCpuPkg/UefiCpuPkg.dec > index cb05fa2660..cd9b2d1b03 100644 > --- a/UefiCpuPkg/UefiCpuPkg.dec > +++ b/UefiCpuPkg/UefiCpuPkg.dec > @@ -261,10 +261,6 @@ > # @Prompt SMM CPU Synchronization Method. >=20 > gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmSyncMode|0x00|UINT8|0x60000 > 014 >=20 > - ## Specifies user's desired settings for enabling/disabling processor > features. > - # @Prompt User settings for enabling/disabling processor features. > - gUefiCpuPkgTokenSpaceGuid.PcdCpuFeaturesUserConfiguration|{0x00, > 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}|VOID*|0x00000017 > - > ## Specifies the On-demand clock modulation duty cycle when ACPI > feature is enabled. > # @Prompt The encoded values for target duty cycle modulation. > # @ValidRange 0x80000001 | 0 - 15 > @@ -292,8 +288,9 @@ > # @ValidList 0x80000001 | 0 > gUefiCpuPkgTokenSpaceGuid.PcdCpuFeaturesCapability|{0x00, 0x00, 0x00, > 0x00, 0x00, 0x00, 0x00, 0x00}|VOID*|0x00000018 >=20 > - ## Specifies actual settings for processor features, each bit correspo= nding > to a specific feature. > - # @Prompt Actual processor feature settings. > + ## As input, specifies user's desired settings for enabling/disabling > processor features. > + ## As output, specifies actual settings for processor features, each b= it > corresponding to a specific feature. > + # @Prompt As input, specifies user's desired processor feature setting= s. As > output, specifies actual processor feature settings. > # @ValidList 0x80000001 | 0 > gUefiCpuPkgTokenSpaceGuid.PcdCpuFeaturesSetting|{0x00, 0x00, 0x00, > 0x00, 0x00, 0x00, 0x00, 0x00}|VOID*|0x00000019 >=20 > -- > 2.15.0.windows.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel