public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] UefiPayloadPkg: Not use BaseCpuTimerLib by default.
@ 2022-01-14  6:15 Zhiguang Liu
  2022-01-14 15:53 ` Ma, Maurice
  2022-01-17 18:05 ` Guo Dong
  0 siblings, 2 replies; 3+ messages in thread
From: Zhiguang Liu @ 2022-01-14  6:15 UTC (permalink / raw)
  To: devel; +Cc: Guo Dong, Ray Ni, Maurice Ma, Benjamin You

For recent X86 CPU, 0x15 CPUID instruction will return Time Stamp
Counter. This is recommended way to get the time, and also how
BaseCpuTimerLib works However, some CPU doesn't support this feature,
so disable it by default.

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 3d08edfe31..65c1bd610e 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -111,6 +111,11 @@
   DEFINE SERIAL_DRIVER_ENABLE = TRUE
   DEFINE PERFORMANCE_MEASUREMENT_ENABLE  = FALSE
 
+  # For recent X86 CPU, 0x15 CPUID instruction will return Time Stamp Counter.
+  # This is recommended way to get the time, and also how BaseCpuTimerLib works.
+  # However, some CPU doesn't support this feature, so disable it by default.
+  DEFINE CPU_TIMER_LIB_ENABLE  = FALSE
+
 [BuildOptions]
   *_*_*_CC_FLAGS                 = -D DISABLE_NEW_DEPRECATED_INTERFACES
   GCC:*_UNIXGCC_*_CC_FLAGS       = -DMDEPKG_NDEBUG
@@ -217,7 +222,7 @@
   #
   # Platform
   #
-!if $(UNIVERSAL_PAYLOAD) == TRUE
+!if $(CPU_TIMER_LIB_ENABLE) == TRUE
   TimerLib|UefiCpuPkg/Library/CpuTimerLib/BaseCpuTimerLib.inf
 !else
   TimerLib|UefiPayloadPkg/Library/AcpiTimerLib/AcpiTimerLib.inf
-- 
2.32.0.windows.2


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

* Re: [PATCH] UefiPayloadPkg: Not use BaseCpuTimerLib by default.
  2022-01-14  6:15 [PATCH] UefiPayloadPkg: Not use BaseCpuTimerLib by default Zhiguang Liu
@ 2022-01-14 15:53 ` Ma, Maurice
  2022-01-17 18:05 ` Guo Dong
  1 sibling, 0 replies; 3+ messages in thread
From: Ma, Maurice @ 2022-01-14 15:53 UTC (permalink / raw)
  To: Liu, Zhiguang, devel@edk2.groups.io; +Cc: Dong, Guo, Ni, Ray, You, Benjamin

Reviewed-by: Maurice Ma <maurice.ma@intel.com>

> -----Original Message-----
> From: Liu, Zhiguang <zhiguang.liu@intel.com>
> Sent: Thursday, January 13, 2022 22:15
> To: devel@edk2.groups.io
> Cc: Dong, Guo <guo.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Ma,
> Maurice <maurice.ma@intel.com>; You, Benjamin
> <benjamin.you@intel.com>
> Subject: [PATCH] UefiPayloadPkg: Not use BaseCpuTimerLib by default.
> 
> For recent X86 CPU, 0x15 CPUID instruction will return Time Stamp Counter.
> This is recommended way to get the time, and also how BaseCpuTimerLib
> works However, some CPU doesn't support this feature, so disable it by
> default.
> 
> Cc: Guo Dong <guo.dong@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Maurice Ma <maurice.ma@intel.com>
> Cc: Benjamin You <benjamin.you@intel.com>
> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
> ---
>  UefiPayloadPkg/UefiPayloadPkg.dsc | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc
> b/UefiPayloadPkg/UefiPayloadPkg.dsc
> index 3d08edfe31..65c1bd610e 100644
> --- a/UefiPayloadPkg/UefiPayloadPkg.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
> @@ -111,6 +111,11 @@
>    DEFINE SERIAL_DRIVER_ENABLE = TRUE   DEFINE
> PERFORMANCE_MEASUREMENT_ENABLE  = FALSE +  # For recent X86 CPU,
> 0x15 CPUID instruction will return Time Stamp Counter.+  # This is
> recommended way to get the time, and also how BaseCpuTimerLib works.+
> # However, some CPU doesn't support this feature, so disable it by default.+
> DEFINE CPU_TIMER_LIB_ENABLE  = FALSE+ [BuildOptions]
> *_*_*_CC_FLAGS                 = -D DISABLE_NEW_DEPRECATED_INTERFACES
> GCC:*_UNIXGCC_*_CC_FLAGS       = -DMDEPKG_NDEBUG@@ -217,7 +222,7
> @@
>    #   # Platform   #-!if $(UNIVERSAL_PAYLOAD) == TRUE+!if
> $(CPU_TIMER_LIB_ENABLE) == TRUE
> TimerLib|UefiCpuPkg/Library/CpuTimerLib/BaseCpuTimerLib.inf !else
> TimerLib|UefiPayloadPkg/Library/AcpiTimerLib/AcpiTimerLib.inf--
> 2.32.0.windows.2


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

* Re: [PATCH] UefiPayloadPkg: Not use BaseCpuTimerLib by default.
  2022-01-14  6:15 [PATCH] UefiPayloadPkg: Not use BaseCpuTimerLib by default Zhiguang Liu
  2022-01-14 15:53 ` Ma, Maurice
@ 2022-01-17 18:05 ` Guo Dong
  1 sibling, 0 replies; 3+ messages in thread
From: Guo Dong @ 2022-01-17 18:05 UTC (permalink / raw)
  To: Liu, Zhiguang, devel@edk2.groups.io; +Cc: Ni, Ray, Ma, Maurice, You, Benjamin

Reviewed-by: Guo Dong <guo.dong@intel.com>

-----Original Message-----
From: Liu, Zhiguang <zhiguang.liu@intel.com> 
Sent: Thursday, January 13, 2022 11:15 PM
To: devel@edk2.groups.io
Cc: Dong, Guo <guo.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Ma, Maurice <maurice.ma@intel.com>; You, Benjamin <benjamin.you@intel.com>
Subject: [PATCH] UefiPayloadPkg: Not use BaseCpuTimerLib by default.

For recent X86 CPU, 0x15 CPUID instruction will return Time Stamp Counter. This is recommended way to get the time, and also how BaseCpuTimerLib works However, some CPU doesn't support this feature, so disable it by default.

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 3d08edfe31..65c1bd610e 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -111,6 +111,11 @@
   DEFINE SERIAL_DRIVER_ENABLE = TRUE   DEFINE PERFORMANCE_MEASUREMENT_ENABLE  = FALSE +  # For recent X86 CPU, 0x15 CPUID instruction will return Time Stamp Counter.+  # This is recommended way to get the time, and also how BaseCpuTimerLib works.+  # However, some CPU doesn't support this feature, so disable it by default.+  DEFINE CPU_TIMER_LIB_ENABLE  = FALSE+ [BuildOptions]   *_*_*_CC_FLAGS                 = -D DISABLE_NEW_DEPRECATED_INTERFACES   GCC:*_UNIXGCC_*_CC_FLAGS       = -DMDEPKG_NDEBUG@@ -217,7 +222,7 @@
   #   # Platform   #-!if $(UNIVERSAL_PAYLOAD) == TRUE+!if $(CPU_TIMER_LIB_ENABLE) == TRUE   TimerLib|UefiCpuPkg/Library/CpuTimerLib/BaseCpuTimerLib.inf !else   TimerLib|UefiPayloadPkg/Library/AcpiTimerLib/AcpiTimerLib.inf-- 
2.32.0.windows.2


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

end of thread, other threads:[~2022-01-17 18:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-14  6:15 [PATCH] UefiPayloadPkg: Not use BaseCpuTimerLib by default Zhiguang Liu
2022-01-14 15:53 ` Ma, Maurice
2022-01-17 18:05 ` Guo Dong

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