From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (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 0DB718046C for ; Tue, 21 Mar 2017 01:07:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490083663; x=1521619663; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=9k86SkFm+zYdM0EnboyQCWykqyV1jFkHSYQux7rVkcQ=; b=B4VGSTfDFcWgMGgLHWZ4XEuuiN4/yJbg7dGpSLEOUoA09e0UFjOW9ySP 74ocMigdyOisbUXzUNPIOrC1/CgOwQ==; Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Mar 2017 01:07:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,198,1486454400"; d="scan'208";a="79301405" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga006.fm.intel.com with ESMTP; 21 Mar 2017 01:07:29 -0700 Received: from fmsmsx120.amr.corp.intel.com (10.18.124.208) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 21 Mar 2017 01:07:29 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx120.amr.corp.intel.com (10.18.124.208) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 21 Mar 2017 01:07:29 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.177]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.204]) with mapi id 14.03.0248.002; Tue, 21 Mar 2017 16:07:27 +0800 From: "Tian, Feng" To: "Fan, Jeff" , "edk2-devel@lists.01.org" CC: "Kinney, Michael D" , "Tian, Feng" Thread-Topic: [PATCH v5 00/11] Add CPU features driver Thread-Index: AQHSoVK+Wx/qBfAw9k+pkbWeNqGTsaGe8ahg Date: Tue, 21 Mar 2017 08:07:26 +0000 Message-ID: <7F1BAD85ADEA444D97065A60D2E97EE5699BC28E@SHSMSX101.ccr.corp.intel.com> References: <20170320081939.6196-1-jeff.fan@intel.com> In-Reply-To: <20170320081939.6196-1-jeff.fan@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 v5 00/11] Add CPU features driver X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Mar 2017 08:07:43 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Series Reviewed-by: Feng Tian Thanks Feng -----Original Message----- From: Fan, Jeff=20 Sent: Monday, March 20, 2017 4:20 PM To: edk2-devel@lists.01.org Cc: Tian, Feng ; Kinney, Michael D Subject: [PATCH v5 00/11] Add CPU features driver This serial of patches will add CPU featuers initialization on boot time. 1) One new Register CPU Features Library and instances are added to provide= the capability to register CPU feature's detect/initialize services. 2) One new NULL class CPU Commong Features Library instance is added to pro= vide detect/initialize servcies of CPU features defined in SDM. 3) New CPU features PEI/DXE drivers are added to initialize CPU features in= PEI phase or DXE phase, by consuming Register CPU Features Library. https://bugzilla.tianocore.org/show_bug.cgi?id=3D421 The whole updated UefiCpuPkg v5 could be accessed at https://github.com/Jef= fFan/edk2/tree/CpuFeaturesV5/UefiCpuPkg for review. v2: #9: Format debug messages. #10: 1. Using MSR_IA32_EFER to enable/disable NX feature instead of using MSR_IA32_MISC_ENABLE. 2. Fix bug that SMX and VMX feature is swapped. v3: #9: Trim white space at end of line. #10: Add AesniGetConfigData() to get current register state. v4: #3, #8, #9: Fix GCC complied issue. v5: #3: Set DestinationRegisterTableList[Index].RegisterTableEntry before RegisterTableEntry is updated. #10: Move MSR reading from AesniGetConfigData() to AesniSupport(). Cc: Feng Tian Cc: Michael Kinney Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan Jeff Fan (11): UefiCpuPkg/AcpiCpuData: Update RegisterTableEntry type UefiCpuPkg/CpuS3DataDxe: Consume the existing PcdCpuS3DataAddress UefiCpuPkg/PiSmmCpuDxeSmm: Skip if AllocatedSize is 0 UefiCpuPkg/Msr: Add CPUID signature check MACROs UefiCpuPkg/UefiCpuPkg.dec: Add a set of CPU features PCDs UefiCpuPkg: Add GUID gEdkiiCpuFeaturesSetDoneGuid UefiCpuPkg: Add GUID gEdkiiCpuFeaturesInitDoneGuid UefiCpuPkg/Include/Library: Add Register CPU Features Library UefiCpuPkg: Add PEI/DXE Register CPU Features Library instances UefiCpuPkg: Add NULL CPU Common Features Library instance UefiCpuPkg: Add CPU Features PEI/DXE drivers UefiCpuPkg/CpuFeatures/CpuFeaturesDxe.c | 122 +++ UefiCpuPkg/CpuFeatures/CpuFeaturesDxe.inf | 53 ++ UefiCpuPkg/CpuFeatures/CpuFeaturesDxe.uni | 22 + UefiCpuPkg/CpuFeatures/CpuFeaturesDxeExtra.uni | 20 + UefiCpuPkg/CpuFeatures/CpuFeaturesPei.c | 75 ++ UefiCpuPkg/CpuFeatures/CpuFeaturesPei.inf | 49 ++ UefiCpuPkg/CpuFeatures/CpuFeaturesPei.uni | 22 + UefiCpuPkg/CpuFeatures/CpuFeaturesPeiExtra.uni | 20 + UefiCpuPkg/CpuS3DataDxe/CpuS3Data.c | 56 +- UefiCpuPkg/Include/AcpiCpuData.h | 6 +- UefiCpuPkg/Include/Guid/CpuFeaturesInitDone.h | 26 + UefiCpuPkg/Include/Guid/CpuFeaturesSetDone.h | 26 + .../Include/Library/RegisterCpuFeaturesLib.h | 516 ++++++++++++ UefiCpuPkg/Include/Register/Msr/AtomMsr.h | 22 +- UefiCpuPkg/Include/Register/Msr/BroadwellMsr.h | 21 +- UefiCpuPkg/Include/Register/Msr/Core2Msr.h | 19 +- UefiCpuPkg/Include/Register/Msr/CoreMsr.h | 18 +- UefiCpuPkg/Include/Register/Msr/GoldmontMsr.h | 18 +- UefiCpuPkg/Include/Register/Msr/HaswellEMsr.h | 18 +- UefiCpuPkg/Include/Register/Msr/HaswellMsr.h | 20 +- UefiCpuPkg/Include/Register/Msr/IvyBridgeMsr.h | 18 +- UefiCpuPkg/Include/Register/Msr/NehalemMsr.h | 21 +- UefiCpuPkg/Include/Register/Msr/P6Msr.h | 23 +- UefiCpuPkg/Include/Register/Msr/Pentium4Msr.h | 15 +- UefiCpuPkg/Include/Register/Msr/PentiumMMsr.h | 18 +- UefiCpuPkg/Include/Register/Msr/PentiumMsr.h | 20 +- UefiCpuPkg/Include/Register/Msr/SandyBridgeMsr.h | 19 +- UefiCpuPkg/Include/Register/Msr/SilvermontMsr.h | 22 +- UefiCpuPkg/Include/Register/Msr/SkylakeMsr.h | 19 +- UefiCpuPkg/Include/Register/Msr/Xeon5600Msr.h | 19 +- UefiCpuPkg/Include/Register/Msr/XeonDMsr.h | 19 +- UefiCpuPkg/Include/Register/Msr/XeonE7Msr.h | 18 +- UefiCpuPkg/Include/Register/Msr/XeonPhiMsr.h | 18 +- UefiCpuPkg/Library/CpuCommonFeaturesLib/Aesni.c | 127 +++ UefiCpuPkg/Library/CpuCommonFeaturesLib/C1e.c | 79 ++ .../Library/CpuCommonFeaturesLib/ClockModulation.c | 106 +++ .../CpuCommonFeaturesLib/CpuCommonFeatures.h | 867 +++++++++++++++++= ++++ .../CpuCommonFeaturesLib/CpuCommonFeaturesLib.c | 227 ++++++ .../CpuCommonFeaturesLib/CpuCommonFeaturesLib.inf | 68 ++ .../CpuCommon= FeaturesLib/CpuCommonFeaturesLib.uni | 25 + UefiCpuPkg/Library/CpuCommonFeaturesLib/Eist.c | 81 ++ .../Library/CpuCommonFeaturesLib/ExecuteDisable.c | 91 +++ .../Library/CpuCommonFeaturesLib/FastStrings.c | 52 ++ .../Library/CpuCommonFeaturesLib/FeatureControl.c | 314 ++++++++ .../CpuCommonFeaturesLib/LimitCpuIdMaxval.c | 82 ++ .../Library/CpuCommonFeaturesLib/MachineCheck.c | 231 ++++++ .../Library/CpuCommonFeaturesLib/MonitorMwait.c | 79 ++ .../Library/CpuCommonFeaturesLib/PendingBreak.c | 90 +++ UefiCpuPkg/Library/CpuCommonFeaturesLib/X2Apic.c | 81 ++ .../RegisterCpuFeaturesLib/CpuFeaturesInitialize.c | 745 +++++++++++++++++= + .../DxeRegisterCpuFeaturesLib.c | 266 +++++++ .../DxeRegisterCpuFeaturesLib.inf | 62 ++ .../PeiRegisterCpuFeaturesLib.c | 390 +++++++++ .../PeiRegisterCpuFeaturesLib.inf | 64 ++ .../RegisterCpuFeaturesLib/RegisterCpuFeatures.h | 193 +++++ .../RegisterCpuFeaturesDxe.uni | 22 + .../RegisterCpuFeaturesLib.c | 770 +++++++++++++++++= + UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c | 32 +- UefiCpuPkg/UefiCpuPkg.dec | 50 +- UefiCpuPkg/UefiCpuPkg.dsc | 14 +- 60 files changed, 6545 insertions(+), 61 deletions(-) create mode 100644 = UefiCpuPkg/CpuFeatures/CpuFeaturesDxe.c create mode 100644 UefiCpuPkg/CpuFeatures/CpuFeaturesDxe.inf create mode 100644 UefiCpuPkg/CpuFeatures/CpuFeaturesDxe.uni create mode 100644 UefiCpuPkg/CpuFeatures/CpuFeaturesDxeExtra.uni create mode 100644 UefiCpuPkg/CpuFeatures/CpuFeaturesPei.c create mode 100644 UefiCpuPkg/CpuFeatures/CpuFeaturesPei.inf create mode 100644 UefiCpuPkg/CpuFeatures/CpuFeaturesPei.uni create mode 100644 UefiCpuPkg/CpuFeatures/CpuFeaturesPeiExtra.uni create mode 100644 UefiCpuPkg/Include/Guid/CpuFeaturesInitDone.h create mode 100644 UefiCpuPkg/Include/Guid/CpuFeaturesSetDone.h create mode 100644 UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h create mode 100644 UefiCpuPkg/Library/CpuCommonFeaturesLib/Aesni.c create mode 100644 UefiCpuPkg/Library/CpuCommonFeaturesLib/C1e.c create mode 100644 UefiCpuPkg/Library/CpuCommonFeaturesLib/ClockModulation= .c create mode 100644 UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeatur= es.h create mode 100644 UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeatur= esLib.c create mode 100644 UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeatur= esLib.inf create mode 100644 UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeatur= esLib.uni create mode 100644 UefiCpuPkg/Library/CpuCommonFeaturesLib/Eist.c create mode 100644 UefiCpuPkg/Library/CpuCommonFeaturesLib/ExecuteDisable.= c create mode 100644 UefiCpuPkg/Library/CpuCommonFeaturesLib/FastStrings.c create mode 100644 UefiCpuPkg/Library/CpuCommonFeaturesLib/FeatureControl.= c create mode 100644 UefiCpuPkg/Library/CpuCommonFeaturesLib/LimitCpuIdMaxva= l.c create mode 100644 UefiCpuPkg/Library/CpuCommonFeaturesLib/MachineCheck.c create mode 100644 UefiCpuPkg/Library/CpuCommonFeaturesLib/MonitorMwait.c create mode 100644 UefiCpuPkg/Library/CpuCommonFeaturesLib/PendingBreak.c create mode 100644 UefiCpuPkg/Library/CpuCommonFeaturesLib/X2Apic.c create mode 100644 UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesIn= itialize.c create mode 100644 UefiCpuPkg/Library/RegisterCpuFeaturesLib/DxeRegisterCp= uFeaturesLib.c create mode 100644 UefiCpuPkg/Library/RegisterCpuFeaturesLib/DxeRegisterCp= uFeaturesLib.inf create mode 100644 UefiCpuPkg/Library/RegisterCpuFeaturesLib/PeiRegisterCp= uFeaturesLib.c create mode 100644 UefiCpuPkg/Library/RegisterCpuFeaturesLib/PeiRegisterCp= uFeaturesLib.inf create mode 100644 UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFe= atures.h create mode 100644 UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFe= aturesDxe.uni create mode 100644 UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFe= aturesLib.c -- 2.9.3.windows.2