From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.136; helo=mga12.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (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 DE325211D2318 for ; Tue, 5 Mar 2019 01:55:10 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Mar 2019 01:55:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,443,1544515200"; d="scan'208";a="325523786" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga005.fm.intel.com with ESMTP; 05 Mar 2019 01:55:10 -0800 Received: from fmsmsx161.amr.corp.intel.com (10.18.125.9) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 5 Mar 2019 01:55:07 -0800 Received: from shsmsx106.ccr.corp.intel.com (10.239.4.159) by FMSMSX161.amr.corp.intel.com (10.18.125.9) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 5 Mar 2019 01:55:07 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.163]) by SHSMSX106.ccr.corp.intel.com ([169.254.10.144]) with mapi id 14.03.0415.000; Tue, 5 Mar 2019 17:55:05 +0800 From: "Zeng, Star" To: "Dong, Eric" , "edk2-devel@lists.01.org" CC: "Ni, Ray" , "Laszlo Ersek (lersek@redhat.com)" , "Gao, Liming" , "Zeng, Star" Thread-Topic: [edk2] [Patch v2 2/4] UefiCpuPkg/RegisterCpuFeaturesLib: Optimize PCD PcdCpuFeaturesUserConfiguration. Thread-Index: AQHUz/FQmIsggD36J06rrk2ACv1MzKX80cpw Date: Tue, 5 Mar 2019 09:55:04 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483104028C6C4@shsmsx102.ccr.corp.intel.com> References: <20190301053957.3572-1-eric.dong@intel.com> <20190301053957.3572-3-eric.dong@intel.com> In-Reply-To: <20190301053957.3572-3-eric.dong@intel.com> Accept-Language: zh-CN, 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: Tue, 05 Mar 2019 09:55:11 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable It should be an incompatible change to remove PcdCpuFeaturesUserConfigurati= on. Please add upgrade notes for it. I know upgrade notes for 2019 Q1 stable ta= g 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. 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: Optimize = PCD PcdCpuFeaturesUserConfiguration. Merge PcdCpuFeaturesUserConfiguration into PcdCpuFeaturesSetting. Use PcdCpuFeaturesSetting as input for the user input feature setting Use P= cdCpuFeaturesSetting as output for the final CPU feature setting BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=3D1375 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(-) diff --git a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitializ= e.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 b= uffer + @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, Supported= FeatureMask); 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->BitMa= skSize, CpuFeaturesData->CapabilityPcd); ASSERT (CpuFeaturesData->SettingPcd !=3D NULL); - SupportedMaskAnd (CpuFeaturesData->SettingPcd, CpuFeaturesData->Configur= ationPcd); - - // - // Save PCDs and display CPU PCDs - // - SetCapabilityPcd (CpuFeaturesData->CapabilityPcd); - SetSettingPcd (CpuFeaturesData->SettingPcd); + SupportedMaskAnd (CpuFeaturesData->SettingPcd, PcdGetPtr=20 + (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,=20 + CpuFeaturesData->BitMaskSize); SetSettingPcd=20 + (CpuFeaturesData->SettingPcd); + for (ProcessorNumber =3D 0; ProcessorNumber < NumberOfCpus; ProcessorNum= ber++) { CpuInitOrder =3D &CpuFeaturesData->InitOrder[ProcessorNumber]; Entry =3D GetFirstNode (&CpuFeaturesData->FeatureList); diff --git a/U= efiCpuPkg/Library/RegisterCpuFeaturesLib/DxeRegisterCpuFeaturesLib.inf b/Ue= fiCpuPkg/Library/RegisterCpuFeaturesLib/DxeRegisterCpuFeaturesLib.inf 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.inf b/U= efiCpuPkg/Library/RegisterCpuFeaturesLib/PeiRegisterCpuFeaturesLib.inf index f3907e25d3..659aa9eaaf 100644 --- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/PeiRegisterCpuFeaturesLib.i= nf +++ 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/U= efiCpuPkg/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 cb= 05fa2660..cd9b2d1b03 100644 --- a/UefiCpuPkg/UefiCpuPkg.dec +++ b/UefiCpuPkg/UefiCpuPkg.dec @@ -261,10 +261,6 @@ # @Prompt SMM CPU Synchronization Method. gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmSyncMode|0x00|UINT8|0x60000014 =20 - ## Specifies user's desired settings for enabling/disabling processor fe= atures. - # @Prompt User settings for enabling/disabling processor features. - gUefiCpuPkgTokenSpaceGuid.PcdCpuFeaturesUserConfiguration|{0x00, 0x00, 0= x00, 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, 0x= 00, 0x00, 0x00, 0x00, 0x00}|VOID*|0x00000018 =20 - ## Specifies actual settings for processor features, each bit correspond= ing to a specific feature. - # @Prompt Actual processor feature settings. + ## As input, specifies user's desired settings for enabling/disabling pr= ocessor features. + ## As output, specifies actual settings for processor features, each bit= corresponding to a specific feature. + # @Prompt As input, specifies user's desired processor feature settings.= 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 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel