public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Dong, Eric" <eric.dong@intel.com>
To: "Ni, Ray" <ray.ni@intel.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Zeng, Star" <star.zeng@intel.com>
Subject: Re: [PATCH] UefiCpuPkg/RegisterCpuFeaturesLib: Delete CPU_FEATURE_[BEFORE|AFTER]
Date: Tue, 9 Jul 2019 01:10:30 +0000	[thread overview]
Message-ID: <ED077930C258884BBCB450DB737E662259E9298D@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <20190702071625.51680-1-ray.ni@intel.com>

Reviewed-by: Eric Dong <eric.dong@intel.com>

> -----Original Message-----
> From: Ni, Ray
> Sent: Tuesday, July 2, 2019 3:16 PM
> To: devel@edk2.groups.io
> Cc: Dong, Eric <eric.dong@intel.com>; Zeng, Star <star.zeng@intel.com>
> Subject: [PATCH] UefiCpuPkg/RegisterCpuFeaturesLib: Delete
> CPU_FEATURE_[BEFORE|AFTER]
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1366
> 
> 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
> 
> And it re-interpreted CPU_FEATURE_BEFORE as
> CPU_FEATURE_THREAD_BEFORE and CPU_FEATURE_AFTER as
> CPU_FEATURE_THREAD_AFTER.
> 
> This patch retires CPU_FEATURE_BEFORE and CPU_FEATURE_AFTER
> completely.
> 
> Signed-off-by: Ray Ni <ray.ni@intel.com>
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Star Zeng <star.zeng@intel.com>
> ---
>  .../Include/Library/RegisterCpuFeaturesLib.h       | 13 ++-----------
>  .../CpuCommonFeaturesLib/CpuCommonFeaturesLib.c    |  8 ++++----
>  .../RegisterCpuFeaturesLib.c                       | 14 +++++++-------
>  3 files changed, 13 insertions(+), 22 deletions(-)
> 
> 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 @@
> 
>  #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.
> 
> -  Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
> +  Copyright (c) 2017 - 2019, Intel Corporation. All rights
> + reserved.<BR>
>    SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  **/
> @@ -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 = VA_ARG (Marker, UINT32);
>    while (Feature != CPU_FEATURE_END) {
> -    ASSERT ((Feature & (CPU_FEATURE_BEFORE | CPU_FEATURE_AFTER))
> -                    != (CPU_FEATURE_BEFORE | CPU_FEATURE_AFTER));
> +    ASSERT ((Feature & (CPU_FEATURE_THREAD_BEFORE |
> CPU_FEATURE_THREAD_AFTER))
> +                    != (CPU_FEATURE_THREAD_BEFORE |
> + CPU_FEATURE_THREAD_AFTER));
>      ASSERT ((Feature & (CPU_FEATURE_BEFORE_ALL |
> CPU_FEATURE_AFTER_ALL))
>                      != (CPU_FEATURE_BEFORE_ALL | CPU_FEATURE_AFTER_ALL));
>      ASSERT ((Feature & (CPU_FEATURE_CORE_BEFORE |
> CPU_FEATURE_CORE_AFTER))
>                      != (CPU_FEATURE_CORE_BEFORE | CPU_FEATURE_CORE_AFTER));
>      ASSERT ((Feature & (CPU_FEATURE_PACKAGE_BEFORE |
> CPU_FEATURE_PACKAGE_AFTER))
>                      != (CPU_FEATURE_PACKAGE_BEFORE |
> CPU_FEATURE_PACKAGE_AFTER));
> -    if (Feature < CPU_FEATURE_BEFORE) {
> +    if (Feature < CPU_FEATURE_THREAD_BEFORE) {
>        BeforeAll = ((Feature & CPU_FEATURE_BEFORE_ALL) != 0) ? TRUE : FALSE;
>        AfterAll  = ((Feature & CPU_FEATURE_AFTER_ALL) != 0) ? TRUE : FALSE;
>        Feature  &= ~(CPU_FEATURE_BEFORE_ALL | CPU_FEATURE_AFTER_ALL);
>        ASSERT (FeatureMask == NULL);
>        SetCpuFeaturesBitMask (&FeatureMask, Feature, BitMaskSize);
> -    } else if ((Feature & CPU_FEATURE_BEFORE) != 0) {
> -      SetCpuFeaturesBitMask (&BeforeFeatureBitMask, Feature &
> ~CPU_FEATURE_BEFORE, BitMaskSize);
> -    } else if ((Feature & CPU_FEATURE_AFTER) != 0) {
> -      SetCpuFeaturesBitMask (&AfterFeatureBitMask, Feature &
> ~CPU_FEATURE_AFTER, BitMaskSize);
> +    } else if ((Feature & CPU_FEATURE_THREAD_BEFORE) != 0) {
> +      SetCpuFeaturesBitMask (&BeforeFeatureBitMask, Feature &
> ~CPU_FEATURE_THREAD_BEFORE, BitMaskSize);
> +    } else if ((Feature & CPU_FEATURE_THREAD_AFTER) != 0) {
> +      SetCpuFeaturesBitMask (&AfterFeatureBitMask, Feature &
> + ~CPU_FEATURE_THREAD_AFTER, BitMaskSize);
>      } else if ((Feature & CPU_FEATURE_CORE_BEFORE) != 0) {
>        SetCpuFeaturesBitMask (&CoreBeforeFeatureBitMask, Feature &
> ~CPU_FEATURE_CORE_BEFORE, BitMaskSize);
>      } else if ((Feature & CPU_FEATURE_CORE_AFTER) != 0) {
> --
> 2.21.0.windows.1


      reply	other threads:[~2019-07-09  1:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-02  7:16 [PATCH] UefiCpuPkg/RegisterCpuFeaturesLib: Delete CPU_FEATURE_[BEFORE|AFTER] Ni, Ray
2019-07-09  1:10 ` Dong, Eric [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ED077930C258884BBCB450DB737E662259E9298D@shsmsx102.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox