public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ni, Ruiyu" <ruiyu.ni@Intel.com>
To: Eric Dong <eric.dong@intel.com>, edk2-devel@lists.01.org
Cc: Laszlo Ersek <lersek@redhat.com>
Subject: Re: [Patch v2 2/6] UefiCpuPkg/RegisterCpuFeaturesLib.h: Add new dependence types.
Date: Thu, 18 Oct 2018 11:31:06 +0800	[thread overview]
Message-ID: <222d0350-f086-fa0d-a52a-8df88e11e069@Intel.com> (raw)
In-Reply-To: <20181017021635.14972-3-eric.dong@intel.com>

On 10/17/2018 10:16 AM, Eric Dong wrote:
> Add new core/package dependence types which consumed by different MSRs.
> 
> Cc: Ruiyu Ni <ruiyu.ni@intel.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Eric Dong <eric.dong@intel.com>
> ---
>   .../Include/Library/RegisterCpuFeaturesLib.h       | 25 ++++++++++++++++++----
>   1 file changed, 21 insertions(+), 4 deletions(-)
> 
> diff --git a/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h b/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h
> index 9331e49d13..e6f0ebe4bc 100644
> --- a/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h
> +++ b/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h
> @@ -73,10 +73,17 @@
>   #define CPU_FEATURE_PPIN                            (32+11)
>   #define CPU_FEATURE_PROC_TRACE                      (32+12)
>   
> -#define CPU_FEATURE_BEFORE_ALL                      BIT27
> -#define CPU_FEATURE_AFTER_ALL                       BIT28
> -#define CPU_FEATURE_BEFORE                          BIT29
> -#define CPU_FEATURE_AFTER                           BIT30
> +#define CPU_FEATURE_BEFORE_ALL                      BIT23
> +#define CPU_FEATURE_AFTER_ALL                       BIT24


We could add comments to emphasize that CPU_FEATURE_BEFORE and 
CPU_FEATURE_AFTER only mean Thread scope before and Thread scope after.

And after the whole patch serials are checked in, I prefer to mark the 
below two macros as deprecated and avoid using them in core code any more.

> +#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_CORE_BEFORE                     BIT27
> +#define CPU_FEATURE_CORE_AFTER                      BIT28
> +#define CPU_FEATURE_PACKAGE_BEFORE                  BIT29
> +#define CPU_FEATURE_PACKAGE_AFTER                   BIT30
>   #define CPU_FEATURE_END                             MAX_UINT32
>   /// @}
>   
> @@ -116,6 +123,16 @@ typedef struct {
>     CPUID_VERSION_INFO_EDX               CpuIdVersionInfoEdx;
>   } REGISTER_CPU_FEATURE_INFORMATION;
>   
> +//
> +// Describe the dependency type for different features.

Can you add comments to say like below?
"The value set to CPU_REGISTER_TABLE_ENTRY.Value when the REGISTER_TYPE 
is Semaphore."

And maybe move the enum definition to AcpiCpuData.h because the 
definition of CPU_REGISTER_TABLE_ENTRY and REGISTER_TYPE are all defined 
there.

> +//
> +typedef enum {
> +  NoneDepType,
> +  ThreadDepType,
> +  CoreDepType,
> +  PackageDepType
> +} CPU_FEATURE_DEPENDENCE_TYPE; > +
>   /**
>     Determines if a CPU feature is enabled in PcdCpuFeaturesSupport bit mask.
>     If a CPU feature is disabled in PcdCpuFeaturesSupport then all the code/data
> 


-- 
Thanks,
Ray


  reply	other threads:[~2018-10-18  3:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-17  2:16 [Patch v2 0/6] Fix performance issue caused by Set MSR task Eric Dong
2018-10-17  2:16 ` [Patch v2 1/6] UefiCpuPkg/Include/AcpiCpuData.h: Add Semaphore related Information Eric Dong
2018-10-18  3:04   ` Ni, Ruiyu
2018-10-18  3:10   ` Ni, Ruiyu
2018-10-17  2:16 ` [Patch v2 2/6] UefiCpuPkg/RegisterCpuFeaturesLib.h: Add new dependence types Eric Dong
2018-10-18  3:31   ` Ni, Ruiyu [this message]
2018-10-17  2:16 ` [Patch v2 3/6] UefiCpuPkg/RegisterCpuFeaturesLib: Add logic to support semaphore type Eric Dong
2018-10-18  5:46   ` Ni, Ruiyu
2018-10-17  2:16 ` [Patch v2 4/6] UefiCpuPkg/PiSmmCpuDxeSmm: " Eric Dong
2018-10-18  5:54   ` Ni, Ruiyu
2018-10-17  2:16 ` [Patch v2 5/6] UefiCpuPkg/CpuS3DataDxe: Keep old data if value already existed Eric Dong
2018-10-18  5:57   ` Ni, Ruiyu
2018-10-17  2:16 ` [Patch v2 6/6] UefiCpuPkg/CpuCommonFeaturesLib: Register MSR base on scope Info Eric Dong
2018-10-18  6:01   ` Ni, Ruiyu
2018-10-17 17:33 ` [Patch v2 0/6] Fix performance issue caused by Set MSR task Laszlo Ersek
2018-10-18  7:36   ` Dong, Eric
2018-10-18  2:12 ` Ni, Ruiyu
2018-10-18  2:35   ` Dong, Eric

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=222d0350-f086-fa0d-a52a-8df88e11e069@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