public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v2 1/1] MdePkg/Cpuid.h: Change and add some macro definitions.
@ 2021-01-21  7:28 Jason Lou
  2021-01-22  4:21 ` Ni, Ray
  2021-01-22  4:57 ` 回复: [edk2-devel] " gaoliming
  0 siblings, 2 replies; 6+ messages in thread
From: Jason Lou @ 2021-01-21  7:28 UTC (permalink / raw)
  To: devel
  Cc: Jason, Michael D Kinney, Liming Gao, Zhiguang Liu, Ray Ni,
	Eric Dong, Laszlo Ersek, Rahul Kumar

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3105

Change and add some macro definitions about
CPUID_HYBRID_INFORMATION Leaf(1Ah).

Signed-off-by: Jason Lou <yun.lou@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
---
 UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c |  2 +-
 MdePkg/Include/Register/Intel/Cpuid.h                | 17 +++++++++++++----
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c b/UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c
index 6b87be261acf..d1f9830c91e7 100644
--- a/UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c
+++ b/UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c
@@ -175,7 +175,7 @@ CpuCacheInfoCollectCoreAndCacheData (
   //
   Context->ProcessorInfo[ProcessorIndex].CoreType = 0;
   if (CpuidMaxInput >= CPUID_HYBRID_INFORMATION) {
-    AsmCpuidEx (CPUID_HYBRID_INFORMATION, CPUID_HYBRID_INFORMATION_SUB_LEAF, &NativeModelIdAndCoreTypeEax.Uint32, NULL, NULL, NULL);
+    AsmCpuidEx (CPUID_HYBRID_INFORMATION, CPUID_HYBRID_INFORMATION_MAIN_LEAF, &NativeModelIdAndCoreTypeEax.Uint32, NULL, NULL, NULL);
     Context->ProcessorInfo[ProcessorIndex].CoreType = (UINT8) NativeModelIdAndCoreTypeEax.Bits.CoreType;
   }
 
diff --git a/MdePkg/Include/Register/Intel/Cpuid.h b/MdePkg/Include/Register/Intel/Cpuid.h
index dd1b64a1e50b..a670ab436c37 100644
--- a/MdePkg/Include/Register/Intel/Cpuid.h
+++ b/MdePkg/Include/Register/Intel/Cpuid.h
@@ -3601,7 +3601,7 @@ typedef union {
   CPUID Hybrid Information Enumeration Leaf
 
   @param   EAX  CPUID_HYBRID_INFORMATION (0x1A)
-  @param   ECX  CPUID_HYBRID_INFORMATION_SUB_LEAF (0x00).
+  @param   ECX  CPUID_HYBRID_INFORMATION_MAIN_LEAF (0x00).
 
   @retval  EAX  Enumerates the native model ID and core type described
                 by the type CPUID_NATIVE_MODEL_ID_AND_CORE_TYPE_EAX
@@ -3615,7 +3615,7 @@ typedef union {
 
   AsmCpuidEx (
     CPUID_HYBRID_INFORMATION,
-    CPUID_HYBRID_INFORMATION_SUB_LEAF,
+    CPUID_HYBRID_INFORMATION_MAIN_LEAF,
     &Eax, NULL, NULL, NULL
     );
   @endcode
@@ -3626,11 +3626,11 @@ typedef union {
 ///
 /// CPUID Hybrid Information Enumeration sub-leaf
 ///
-#define CPUID_HYBRID_INFORMATION_SUB_LEAF                               0x00
+#define CPUID_HYBRID_INFORMATION_MAIN_LEAF                              0x00
 
 /**
   CPUID Hybrid Information EAX for CPUID leaf #CPUID_HYBRID_INFORMATION,
-  sub-leaf #CPUID_HYBRID_INFORMATION_SUB_LEAF.
+  sub-leaf #CPUID_HYBRID_INFORMATION_MAIN_LEAF.
 **/
 typedef union {
   ///
@@ -3657,6 +3657,15 @@ typedef union {
   UINT32  Uint32;
 } CPUID_NATIVE_MODEL_ID_AND_CORE_TYPE_EAX;
 
+///
+/// @{ Define value for CPUID_NATIVE_MODEL_ID_AND_CORE_TYPE_EAX.CoreType
+///
+#define   CPUID_CORE_TYPE_INTEL_ATOM                                    0x20
+#define   CPUID_CORE_TYPE_INTEL_CORE                                    0x40
+///
+/// @}
+///
+
 
 /**
   CPUID V2 Extended Topology Enumeration Leaf
-- 
2.28.0.windows.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 1/1] MdePkg/Cpuid.h: Change and add some macro definitions.
  2021-01-21  7:28 [PATCH v2 1/1] MdePkg/Cpuid.h: Change and add some macro definitions Jason Lou
@ 2021-01-22  4:21 ` Ni, Ray
  2021-01-22  4:57 ` 回复: [edk2-devel] " gaoliming
  1 sibling, 0 replies; 6+ messages in thread
From: Ni, Ray @ 2021-01-22  4:21 UTC (permalink / raw)
  To: Lou, Yun, devel@edk2.groups.io
  Cc: Kinney, Michael D, Liming Gao, Liu, Zhiguang, Dong, Eric,
	Laszlo Ersek, Kumar, Rahul1

Reviewed-by: Ray Ni <ray.ni@intel.com>

> -----Original Message-----
> From: Lou, Yun <yun.lou@intel.com>
> Sent: Thursday, January 21, 2021 3:29 PM
> To: devel@edk2.groups.io
> Cc: Lou, Yun <yun.lou@intel.com>; Kinney, Michael D
> <michael.d.kinney@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>; Liu,
> Zhiguang <zhiguang.liu@intel.com>; Ni, Ray <ray.ni@intel.com>; Dong, Eric
> <eric.dong@intel.com>; Laszlo Ersek <lersek@redhat.com>; Kumar, Rahul1
> <rahul1.kumar@intel.com>
> Subject: [PATCH v2 1/1] MdePkg/Cpuid.h: Change and add some macro
> definitions.
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3105
> 
> Change and add some macro definitions about
> CPUID_HYBRID_INFORMATION Leaf(1Ah).
> 
> Signed-off-by: Jason Lou <yun.lou@intel.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Cc: Rahul Kumar <rahul1.kumar@intel.com>
> ---
>  UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c |  2 +-
>  MdePkg/Include/Register/Intel/Cpuid.h                | 17 +++++++++++++----
>  2 files changed, 14 insertions(+), 5 deletions(-)
> 
> diff --git a/UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c
> b/UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c
> index 6b87be261acf..d1f9830c91e7 100644
> --- a/UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c
> +++ b/UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c
> @@ -175,7 +175,7 @@ CpuCacheInfoCollectCoreAndCacheData (
>    //
> 
>    Context->ProcessorInfo[ProcessorIndex].CoreType = 0;
> 
>    if (CpuidMaxInput >= CPUID_HYBRID_INFORMATION) {
> 
> -    AsmCpuidEx (CPUID_HYBRID_INFORMATION,
> CPUID_HYBRID_INFORMATION_SUB_LEAF,
> &NativeModelIdAndCoreTypeEax.Uint32, NULL, NULL, NULL);
> 
> +    AsmCpuidEx (CPUID_HYBRID_INFORMATION,
> CPUID_HYBRID_INFORMATION_MAIN_LEAF,
> &NativeModelIdAndCoreTypeEax.Uint32, NULL, NULL, NULL);
> 
>      Context->ProcessorInfo[ProcessorIndex].CoreType = (UINT8)
> NativeModelIdAndCoreTypeEax.Bits.CoreType;
> 
>    }
> 
> 
> 
> diff --git a/MdePkg/Include/Register/Intel/Cpuid.h
> b/MdePkg/Include/Register/Intel/Cpuid.h
> index dd1b64a1e50b..a670ab436c37 100644
> --- a/MdePkg/Include/Register/Intel/Cpuid.h
> +++ b/MdePkg/Include/Register/Intel/Cpuid.h
> @@ -3601,7 +3601,7 @@ typedef union {
>    CPUID Hybrid Information Enumeration Leaf
> 
> 
> 
>    @param   EAX  CPUID_HYBRID_INFORMATION (0x1A)
> 
> -  @param   ECX  CPUID_HYBRID_INFORMATION_SUB_LEAF (0x00).
> 
> +  @param   ECX  CPUID_HYBRID_INFORMATION_MAIN_LEAF (0x00).
> 
> 
> 
>    @retval  EAX  Enumerates the native model ID and core type described
> 
>                  by the type CPUID_NATIVE_MODEL_ID_AND_CORE_TYPE_EAX
> 
> @@ -3615,7 +3615,7 @@ typedef union {
> 
> 
>    AsmCpuidEx (
> 
>      CPUID_HYBRID_INFORMATION,
> 
> -    CPUID_HYBRID_INFORMATION_SUB_LEAF,
> 
> +    CPUID_HYBRID_INFORMATION_MAIN_LEAF,
> 
>      &Eax, NULL, NULL, NULL
> 
>      );
> 
>    @endcode
> 
> @@ -3626,11 +3626,11 @@ typedef union {
>  ///
> 
>  /// CPUID Hybrid Information Enumeration sub-leaf
> 
>  ///
> 
> -#define CPUID_HYBRID_INFORMATION_SUB_LEAF                               0x00
> 
> +#define CPUID_HYBRID_INFORMATION_MAIN_LEAF                              0x00
> 
> 
> 
>  /**
> 
>    CPUID Hybrid Information EAX for CPUID leaf
> #CPUID_HYBRID_INFORMATION,
> 
> -  sub-leaf #CPUID_HYBRID_INFORMATION_SUB_LEAF.
> 
> +  sub-leaf #CPUID_HYBRID_INFORMATION_MAIN_LEAF.
> 
>  **/
> 
>  typedef union {
> 
>    ///
> 
> @@ -3657,6 +3657,15 @@ typedef union {
>    UINT32  Uint32;
> 
>  } CPUID_NATIVE_MODEL_ID_AND_CORE_TYPE_EAX;
> 
> 
> 
> +///
> 
> +/// @{ Define value for
> CPUID_NATIVE_MODEL_ID_AND_CORE_TYPE_EAX.CoreType
> 
> +///
> 
> +#define   CPUID_CORE_TYPE_INTEL_ATOM                                    0x20
> 
> +#define   CPUID_CORE_TYPE_INTEL_CORE                                    0x40
> 
> +///
> 
> +/// @}
> 
> +///
> 
> +
> 
> 
> 
>  /**
> 
>    CPUID V2 Extended Topology Enumeration Leaf
> 
> --
> 2.28.0.windows.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* 回复: [edk2-devel] [PATCH v2 1/1] MdePkg/Cpuid.h: Change and add some macro definitions.
  2021-01-21  7:28 [PATCH v2 1/1] MdePkg/Cpuid.h: Change and add some macro definitions Jason Lou
  2021-01-22  4:21 ` Ni, Ray
@ 2021-01-22  4:57 ` gaoliming
  2021-01-22  5:46   ` [edk2-devel] " Jason Lou
  1 sibling, 1 reply; 6+ messages in thread
From: gaoliming @ 2021-01-22  4:57 UTC (permalink / raw)
  To: devel, yun.lou
  Cc: 'Michael D Kinney', 'Zhiguang Liu',
	'Ray Ni', 'Eric Dong', 'Laszlo Ersek',
	'Rahul Kumar'

Yun:

> -----邮件原件-----
> 发件人: bounce+27952+70610+4905953+8761045@groups.io
> <bounce+27952+70610+4905953+8761045@groups.io> 代表 Jason Lou
> 发送时间: 2021年1月21日 15:29
> 收件人: devel@edk2.groups.io
> 抄送: Jason <yun.lou@intel.com>; Michael D Kinney
> <michael.d.kinney@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>;
> Zhiguang Liu <zhiguang.liu@intel.com>; Ray Ni <ray.ni@intel.com>; Eric
Dong
> <eric.dong@intel.com>; Laszlo Ersek <lersek@redhat.com>; Rahul Kumar
> <rahul1.kumar@intel.com>
> 主题: [edk2-devel] [PATCH v2 1/1] MdePkg/Cpuid.h: Change and add some
> macro definitions.
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3105
> 
> Change and add some macro definitions about
> CPUID_HYBRID_INFORMATION Leaf(1Ah).
> 
> Signed-off-by: Jason Lou <yun.lou@intel.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Cc: Rahul Kumar <rahul1.kumar@intel.com>
> ---
>  UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c |  2 +-
>  MdePkg/Include/Register/Intel/Cpuid.h                | 17
> +++++++++++++----
>  2 files changed, 14 insertions(+), 5 deletions(-)
> 
> diff --git a/UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c
> b/UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c
> index 6b87be261acf..d1f9830c91e7 100644
> --- a/UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c
> +++ b/UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c
> @@ -175,7 +175,7 @@ CpuCacheInfoCollectCoreAndCacheData (
>    //
> 
>    Context->ProcessorInfo[ProcessorIndex].CoreType = 0;
> 
>    if (CpuidMaxInput >= CPUID_HYBRID_INFORMATION) {
> 
> -    AsmCpuidEx (CPUID_HYBRID_INFORMATION,
> CPUID_HYBRID_INFORMATION_SUB_LEAF,
> &NativeModelIdAndCoreTypeEax.Uint32, NULL, NULL, NULL);
> 
> +    AsmCpuidEx (CPUID_HYBRID_INFORMATION,
> CPUID_HYBRID_INFORMATION_MAIN_LEAF,
> &NativeModelIdAndCoreTypeEax.Uint32, NULL, NULL, NULL);
> 
>      Context->ProcessorInfo[ProcessorIndex].CoreType = (UINT8)
> NativeModelIdAndCoreTypeEax.Bits.CoreType;
> 
>    }
> 
> 
> 
> diff --git a/MdePkg/Include/Register/Intel/Cpuid.h
> b/MdePkg/Include/Register/Intel/Cpuid.h
> index dd1b64a1e50b..a670ab436c37 100644
> --- a/MdePkg/Include/Register/Intel/Cpuid.h
> +++ b/MdePkg/Include/Register/Intel/Cpuid.h
> @@ -3601,7 +3601,7 @@ typedef union {
>    CPUID Hybrid Information Enumeration Leaf
> 
> 
> 
>    @param   EAX  CPUID_HYBRID_INFORMATION (0x1A)
> 
> -  @param   ECX  CPUID_HYBRID_INFORMATION_SUB_LEAF (0x00).
> 
> +  @param   ECX  CPUID_HYBRID_INFORMATION_MAIN_LEAF (0x00).
> 
> 
> 
>    @retval  EAX  Enumerates the native model ID and core type described
> 
>                  by the type
> CPUID_NATIVE_MODEL_ID_AND_CORE_TYPE_EAX
> 
> @@ -3615,7 +3615,7 @@ typedef union {
> 
> 
>    AsmCpuidEx (
> 
>      CPUID_HYBRID_INFORMATION,
> 
> -    CPUID_HYBRID_INFORMATION_SUB_LEAF,
> 
> +    CPUID_HYBRID_INFORMATION_MAIN_LEAF,
> 
>      &Eax, NULL, NULL, NULL
> 
>      );
> 
>    @endcode
> 
> @@ -3626,11 +3626,11 @@ typedef union {
>  ///
> 
>  /// CPUID Hybrid Information Enumeration sub-leaf
> 
[Liming] here sub-leaf ==> main-leaf?

>  ///
> 
> -#define CPUID_HYBRID_INFORMATION_SUB_LEAF
> 0x00
> 
> +#define CPUID_HYBRID_INFORMATION_MAIN_LEAF
> 0x00
> 
> 
> 
>  /**
> 
>    CPUID Hybrid Information EAX for CPUID leaf
> #CPUID_HYBRID_INFORMATION,
> 
> -  sub-leaf #CPUID_HYBRID_INFORMATION_SUB_LEAF.
> 
> +  sub-leaf #CPUID_HYBRID_INFORMATION_MAIN_LEAF.
> 
[Liming] Here, sub-leaf ==> main-leaf?

Thanks
Liming
>  **/
> 
>  typedef union {
> 
>    ///
> 
> @@ -3657,6 +3657,15 @@ typedef union {
>    UINT32  Uint32;
> 
>  } CPUID_NATIVE_MODEL_ID_AND_CORE_TYPE_EAX;
> 
> 
> 
> +///
> 
> +/// @{ Define value for
> CPUID_NATIVE_MODEL_ID_AND_CORE_TYPE_EAX.CoreType
> 
> +///
> 
> +#define   CPUID_CORE_TYPE_INTEL_ATOM
> 0x20
> 
> +#define   CPUID_CORE_TYPE_INTEL_CORE
> 0x40
> 
> +///
> 
> +/// @}
> 
> +///
> 
> +
> 
> 
> 
>  /**
> 
>    CPUID V2 Extended Topology Enumeration Leaf
> 
> --
> 2.28.0.windows.1
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#70610): https://edk2.groups.io/g/devel/message/70610
> Mute This Topic: https://groups.io/mt/79998848/4905953
> Group Owner: devel+owner@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub
> [gaoliming@byosoft.com.cn]
> -=-=-=-=-=-=
> 




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [edk2-devel] 回复: [edk2-devel] [PATCH v2 1/1] MdePkg/Cpuid.h: Change and add some macro definitions.
  2021-01-22  4:57 ` 回复: [edk2-devel] " gaoliming
@ 2021-01-22  5:46   ` Jason Lou
  2021-01-22  8:07     ` 回复: " gaoliming
  0 siblings, 1 reply; 6+ messages in thread
From: Jason Lou @ 2021-01-22  5:46 UTC (permalink / raw)
  To: gaoliming, devel

[-- Attachment #1: Type: text/plain, Size: 120 bytes --]

Hi Liming,
Yes, I replaced all the CPUID_HYBRID_INFORMATION_ *SUB* _LEAF with CPUID_HYBRID_INFORMATION_ *MAIN* _LEAF.

[-- Attachment #2: Type: text/html, Size: 250 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* 回复: [edk2-devel] 回复: [edk2-devel] [PATCH v2 1/1] MdePkg/Cpuid.h: Change and add some macro definitions.
  2021-01-22  5:46   ` [edk2-devel] " Jason Lou
@ 2021-01-22  8:07     ` gaoliming
  2021-01-25  1:30       ` [edk2-devel] " Jason Lou
  0 siblings, 1 reply; 6+ messages in thread
From: gaoliming @ 2021-01-22  8:07 UTC (permalink / raw)
  To: 'Jason Lou', devel

[-- Attachment #1: Type: text/plain, Size: 616 bytes --]

I mean the comments sub-leaf should be replaced by main-leaf. But, current patch still uses sub-leaf for CPUID_HYBRID_INFORMATION_MAIN_LEAF. 

 

Thanks

Liming

发件人: tosubbounce+27952+0+0+0@groups.io <tosubbounce+27952+0+0+0@groups.io> 代表 Jason Lou
发送时间: 2021年1月22日 13:47
收件人: gaoliming <gaoliming@byosoft.com.cn>; devel@edk2.groups.io
主题: Re: [edk2-devel] 回复: [edk2-devel] [PATCH v2 1/1] MdePkg/Cpuid.h: Change and add some macro definitions.

 

Hi Liming,
Yes, I replaced all the CPUID_HYBRID_INFORMATION_SUB_LEAF with CPUID_HYBRID_INFORMATION_MAIN_LEAF.


[-- Attachment #2: Type: text/html, Size: 3869 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [edk2-devel] 回复: [edk2-devel] 回复: [edk2-devel] [PATCH v2 1/1] MdePkg/Cpuid.h: Change and add some macro definitions.
  2021-01-22  8:07     ` 回复: " gaoliming
@ 2021-01-25  1:30       ` Jason Lou
  0 siblings, 0 replies; 6+ messages in thread
From: Jason Lou @ 2021-01-25  1:30 UTC (permalink / raw)
  To: gaoliming, devel

[-- Attachment #1: Type: text/plain, Size: 110 bytes --]

Got it. I have sent out v3 code patch, please help to review it when you are available, thanks.

Jason Lou

[-- Attachment #2: Type: text/html, Size: 118 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-01-25  1:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-21  7:28 [PATCH v2 1/1] MdePkg/Cpuid.h: Change and add some macro definitions Jason Lou
2021-01-22  4:21 ` Ni, Ray
2021-01-22  4:57 ` 回复: [edk2-devel] " gaoliming
2021-01-22  5:46   ` [edk2-devel] " Jason Lou
2021-01-22  8:07     ` 回复: " gaoliming
2021-01-25  1:30       ` [edk2-devel] " Jason Lou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox