From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: eric.dong@intel.com) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by groups.io with SMTP; Mon, 08 Jul 2019 18:10:33 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Jul 2019 18:10:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,468,1557212400"; d="scan'208";a="167274353" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga007.fm.intel.com with ESMTP; 08 Jul 2019 18:10:33 -0700 Received: from FMSMSX109.amr.corp.intel.com (10.18.116.9) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 8 Jul 2019 18:10:32 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx109.amr.corp.intel.com (10.18.116.9) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 8 Jul 2019 18:10:32 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.3]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.109]) with mapi id 14.03.0439.000; Tue, 9 Jul 2019 09:10:31 +0800 From: "Dong, Eric" To: "Ni, Ray" , "devel@edk2.groups.io" CC: "Zeng, Star" Subject: Re: [PATCH] UefiCpuPkg/RegisterCpuFeaturesLib: Delete CPU_FEATURE_[BEFORE|AFTER] Thread-Topic: [PATCH] UefiCpuPkg/RegisterCpuFeaturesLib: Delete CPU_FEATURE_[BEFORE|AFTER] Thread-Index: AQHVMKYmYKP0C1fndUOSUC7fHrh99qbBhNQQ Date: Tue, 9 Jul 2019 01:10:30 +0000 Message-ID: References: <20190702071625.51680-1-ray.ni@intel.com> In-Reply-To: <20190702071625.51680-1-ray.ni@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 Return-Path: eric.dong@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Eric Dong > -----Original Message----- > From: Ni, Ray > Sent: Tuesday, July 2, 2019 3:16 PM > To: devel@edk2.groups.io > Cc: Dong, Eric ; Zeng, Star > Subject: [PATCH] UefiCpuPkg/RegisterCpuFeaturesLib: Delete > CPU_FEATURE_[BEFORE|AFTER] >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1366 >=20 > Commit b3c71b472dff2c02f0cc38d7a1959cfb2ba8420d supported MSR setting > in different scopes. It added below macro: > CPU_FEATURE_THREAD_BEFORE > CPU_FEATURE_THREAD_AFTER > CPU_FEATURE_CORE_BEFORE > CPU_FEATURE_CORE_AFTER > CPU_FEATURE_PACKAGE_BEFORE > CPU_FEATURE_PACKAGE_AFTER >=20 > And it re-interpreted CPU_FEATURE_BEFORE as > CPU_FEATURE_THREAD_BEFORE and CPU_FEATURE_AFTER as > CPU_FEATURE_THREAD_AFTER. >=20 > This patch retires CPU_FEATURE_BEFORE and CPU_FEATURE_AFTER > completely. >=20 > Signed-off-by: Ray Ni > Cc: Eric Dong > Cc: Star Zeng > --- > .../Include/Library/RegisterCpuFeaturesLib.h | 13 ++----------- > .../CpuCommonFeaturesLib/CpuCommonFeaturesLib.c | 8 ++++---- > .../RegisterCpuFeaturesLib.c | 14 +++++++------- > 3 files changed, 13 insertions(+), 22 deletions(-) >=20 > diff --git a/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h > b/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h > index 191348d770..6f964027be 100644 > --- a/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h > +++ b/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h > @@ -69,17 +69,8 @@ >=20 > #define CPU_FEATURE_BEFORE_ALL BIT23 > #define CPU_FEATURE_AFTER_ALL BIT24 > -// > -// CPU_FEATURE_BEFORE and CPU_FEATURE_AFTER only mean Thread > scope -// before and Thread scope after. > -// It will be replace with CPU_FEATURE_THREAD_BEFORE and -// > CPU_FEATURE_THREAD_AFTER, and should not be used anymore. > -// > -#define CPU_FEATURE_BEFORE BIT25 > -#define CPU_FEATURE_AFTER BIT26 > - > -#define CPU_FEATURE_THREAD_BEFORE CPU_FEATURE_BEFORE > -#define CPU_FEATURE_THREAD_AFTER CPU_FEATURE_AFTER > +#define CPU_FEATURE_THREAD_BEFORE BIT25 > +#define CPU_FEATURE_THREAD_AFTER BIT26 > #define CPU_FEATURE_CORE_BEFORE BIT27 > #define CPU_FEATURE_CORE_AFTER BIT28 > #define CPU_FEATURE_PACKAGE_BEFORE BIT29 > diff --git > a/UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeaturesLib.c > b/UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeaturesLib.c > index 7cc692efb6..7966428458 100644 > --- > a/UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeaturesLib.c > +++ > b/UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeaturesLib.c > @@ -2,7 +2,7 @@ > This library registers CPU features defined in Intel(R) 64 and IA-32 > Architectures Software Developer's Manual. >=20 > - Copyright (c) 2017, Intel Corporation. All rights reserved.
> + Copyright (c) 2017 - 2019, Intel Corporation. All rights > + reserved.
> SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > **/ > @@ -106,7 +106,7 @@ CpuCommonFeaturesLibConstructor ( > SmxSupport, > SmxInitialize, > CPU_FEATURE_SMX, > - CPU_FEATURE_LOCK_FEATURE_CONTROL_REGISTER | > CPU_FEATURE_BEFORE, > + CPU_FEATURE_LOCK_FEATURE_CONTROL_REGISTER | > + CPU_FEATURE_THREAD_BEFORE, > CPU_FEATURE_END > ); > ASSERT_EFI_ERROR (Status); > @@ -118,7 +118,7 @@ CpuCommonFeaturesLibConstructor ( > VmxSupport, > VmxInitialize, > CPU_FEATURE_VMX, > - CPU_FEATURE_LOCK_FEATURE_CONTROL_REGISTER | > CPU_FEATURE_BEFORE, > + CPU_FEATURE_LOCK_FEATURE_CONTROL_REGISTER | > + CPU_FEATURE_THREAD_BEFORE, > CPU_FEATURE_END > ); > ASSERT_EFI_ERROR (Status); > @@ -218,7 +218,7 @@ CpuCommonFeaturesLibConstructor ( > LmceSupport, > LmceInitialize, > CPU_FEATURE_LMCE, > - CPU_FEATURE_LOCK_FEATURE_CONTROL_REGISTER | > CPU_FEATURE_BEFORE, > + CPU_FEATURE_LOCK_FEATURE_CONTROL_REGISTER | > + CPU_FEATURE_THREAD_BEFORE, > CPU_FEATURE_END > ); > ASSERT_EFI_ERROR (Status); > diff --git > a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c > b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c > index fa0f0b41e2..c630277d9e 100644 > --- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c > +++ > b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c > @@ -871,24 +871,24 @@ RegisterCpuFeature ( > VA_START (Marker, InitializeFunc); > Feature =3D VA_ARG (Marker, UINT32); > while (Feature !=3D CPU_FEATURE_END) { > - ASSERT ((Feature & (CPU_FEATURE_BEFORE | CPU_FEATURE_AFTER)) > - !=3D (CPU_FEATURE_BEFORE | CPU_FEATURE_AFTER)); > + ASSERT ((Feature & (CPU_FEATURE_THREAD_BEFORE | > CPU_FEATURE_THREAD_AFTER)) > + !=3D (CPU_FEATURE_THREAD_BEFORE | > + CPU_FEATURE_THREAD_AFTER)); > ASSERT ((Feature & (CPU_FEATURE_BEFORE_ALL | > CPU_FEATURE_AFTER_ALL)) > !=3D (CPU_FEATURE_BEFORE_ALL | CPU_FEATURE_AFTER_ALL= )); > ASSERT ((Feature & (CPU_FEATURE_CORE_BEFORE | > CPU_FEATURE_CORE_AFTER)) > !=3D (CPU_FEATURE_CORE_BEFORE | CPU_FEATURE_CORE_AFT= ER)); > ASSERT ((Feature & (CPU_FEATURE_PACKAGE_BEFORE | > CPU_FEATURE_PACKAGE_AFTER)) > !=3D (CPU_FEATURE_PACKAGE_BEFORE | > CPU_FEATURE_PACKAGE_AFTER)); > - if (Feature < CPU_FEATURE_BEFORE) { > + if (Feature < CPU_FEATURE_THREAD_BEFORE) { > BeforeAll =3D ((Feature & CPU_FEATURE_BEFORE_ALL) !=3D 0) ? TRUE := FALSE; > AfterAll =3D ((Feature & CPU_FEATURE_AFTER_ALL) !=3D 0) ? TRUE : = FALSE; > Feature &=3D ~(CPU_FEATURE_BEFORE_ALL | CPU_FEATURE_AFTER_ALL); > ASSERT (FeatureMask =3D=3D NULL); > SetCpuFeaturesBitMask (&FeatureMask, Feature, BitMaskSize); > - } else if ((Feature & CPU_FEATURE_BEFORE) !=3D 0) { > - SetCpuFeaturesBitMask (&BeforeFeatureBitMask, Feature & > ~CPU_FEATURE_BEFORE, BitMaskSize); > - } else if ((Feature & CPU_FEATURE_AFTER) !=3D 0) { > - SetCpuFeaturesBitMask (&AfterFeatureBitMask, Feature & > ~CPU_FEATURE_AFTER, BitMaskSize); > + } else if ((Feature & CPU_FEATURE_THREAD_BEFORE) !=3D 0) { > + SetCpuFeaturesBitMask (&BeforeFeatureBitMask, Feature & > ~CPU_FEATURE_THREAD_BEFORE, BitMaskSize); > + } else if ((Feature & CPU_FEATURE_THREAD_AFTER) !=3D 0) { > + SetCpuFeaturesBitMask (&AfterFeatureBitMask, Feature & > + ~CPU_FEATURE_THREAD_AFTER, BitMaskSize); > } else if ((Feature & CPU_FEATURE_CORE_BEFORE) !=3D 0) { > SetCpuFeaturesBitMask (&CoreBeforeFeatureBitMask, Feature & > ~CPU_FEATURE_CORE_BEFORE, BitMaskSize); > } else if ((Feature & CPU_FEATURE_CORE_AFTER) !=3D 0) { > -- > 2.21.0.windows.1