public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] UefiPayloadPkg: Use BaseCpuTimerLib for Universal Payload by default
@ 2022-01-19  9:16 Zhiguang Liu
       [not found] ` <BYAPR11MB3622AF8788267BE2BBD269739E599@BYAPR11MB3622.namprd11.prod.outlook.com>
  2022-01-25  5:50 ` Ni, Ray
  0 siblings, 2 replies; 3+ messages in thread
From: Zhiguang Liu @ 2022-01-19  9:16 UTC (permalink / raw)
  To: devel; +Cc: Guo Dong, Ray Ni, Maurice Ma, Benjamin You

Current, a macro CPU_TIMER_LIB_ENABLE is added to determine which timerlib
is used. BaseCpuTimerLib.inf is a better way and only fit for recent CPU.
Meanwhile, Universal Payload are only aimed to work with recent CPU.
Therefore, for Universal Payload, use the BaseCpuTimerLib 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 | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 65c1bd610e..1ce96a51c1 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -111,10 +111,10 @@
   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
+  # For recent X86 CPU, 0x15 CPUID instruction will return Time Stamp Counter Frequence.
+  # This is how BaseCpuTimerLib works, and a recommended way to get Frequence, so set the default value as TRUE.
+  # Note: for emulation platform such as QEMU, this may not work and should set it as FALSE
+  DEFINE CPU_TIMER_LIB_ENABLE  = TRUE
 
 [BuildOptions]
   *_*_*_CC_FLAGS                 = -D DISABLE_NEW_DEPRECATED_INTERFACES
@@ -222,7 +222,7 @@
   #
   # Platform
   #
-!if $(CPU_TIMER_LIB_ENABLE) == TRUE
+!if $(CPU_TIMER_LIB_ENABLE) == TRUE && $(UNIVERSAL_PAYLOAD) == 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: Use BaseCpuTimerLib for Universal Payload by default
       [not found] ` <BYAPR11MB3622AF8788267BE2BBD269739E599@BYAPR11MB3622.namprd11.prod.outlook.com>
@ 2022-01-20  0:58   ` Zhiguang Liu
  0 siblings, 0 replies; 3+ messages in thread
From: Zhiguang Liu @ 2022-01-20  0:58 UTC (permalink / raw)
  To: Dong, Guo, devel@edk2.groups.io; +Cc: Ni, Ray, Ma, Maurice, You, Benjamin

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

Hi Guo ,
yes, I know it is merged, and I have some update based on that change.
I get comments from Ray, and he suggests using BaseCpuTimerLib for Universal Payload by default.
The reason is that we only want to enable UPL on latest CPUs and they should all support the BaseCpuTimerLib. (qemu is the exception, and can be special handled by change its Macro)
I was convinced by Ray, so I send patch to modify the default value.
Sorry for changing the same content so soon.

BTW, seems I missed devel@edk2.groups.io<mailto:devel@edk2.groups.io> when I sent the patch. Include it in the thread.

Thanks
Zhiguang

________________________________
发件人: Dong, Guo <guo.dong@intel.com>
发送时间: 星期三, 一月 19, 2022 11:36 下午
收件人: Liu, Zhiguang
抄送: Ni, Ray; Ma, Maurice; You, Benjamin
主题: RE: [PATCH] UefiPayloadPkg: Use BaseCpuTimerLib for Universal Payload by default

Hi Zhiguang,

This patch was merged  on Monday. Did you make any changes to get this email?

Thanks,
Guo

-----Original Message-----
From: Liu, Zhiguang <zhiguang.liu@intel.com>
Sent: Wednesday, January 19, 2022 2:17 AM
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: Use BaseCpuTimerLib for Universal Payload by default

Current, a macro CPU_TIMER_LIB_ENABLE is added to determine which timerlib is used. BaseCpuTimerLib.inf is a better way and only fit for recent CPU.
Meanwhile, Universal Payload are only aimed to work with recent CPU.
Therefore, for Universal Payload, use the BaseCpuTimerLib 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 | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 65c1bd610e..1ce96a51c1 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -111,10 +111,10 @@
   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+  # For recent X86 CPU, 0x15 CPUID instruction will return Time Stamp Counter Frequence.+  # This is how BaseCpuTimerLib works, and a recommended way to get Frequence, so set the default value as TRUE.+  # Note: for emulation platform such as QEMU, this may not work and should set it as FALSE+  DEFINE CPU_TIMER_LIB_ENABLE  = TRUE  [BuildOptions]   *_*_*_CC_FLAGS                 = -D DISABLE_NEW_DEPRECATED_INTERFACES@@ -222,7 +222,7 @@
   #   # Platform   #-!if $(CPU_TIMER_LIB_ENABLE) == TRUE+!if $(CPU_TIMER_LIB_ENABLE) == TRUE && $(UNIVERSAL_PAYLOAD) == TRUE   TimerLib|UefiCpuPkg/Library/CpuTimerLib/BaseCpuTimerLib.inf !else   TimerLib|UefiPayloadPkg/Library/AcpiTimerLib/AcpiTimerLib.inf--
2.32.0.windows.2

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

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

* Re: [PATCH] UefiPayloadPkg: Use BaseCpuTimerLib for Universal Payload by default
  2022-01-19  9:16 [PATCH] UefiPayloadPkg: Use BaseCpuTimerLib for Universal Payload by default Zhiguang Liu
       [not found] ` <BYAPR11MB3622AF8788267BE2BBD269739E599@BYAPR11MB3622.namprd11.prod.outlook.com>
@ 2022-01-25  5:50 ` Ni, Ray
  1 sibling, 0 replies; 3+ messages in thread
From: Ni, Ray @ 2022-01-25  5:50 UTC (permalink / raw)
  To: Liu, Zhiguang, devel@edk2.groups.io; +Cc: Dong, Guo, Ma, Maurice, You, Benjamin

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

-----Original Message-----
From: Liu, Zhiguang <zhiguang.liu@intel.com> 
Sent: Wednesday, January 19, 2022 5:17 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: Use BaseCpuTimerLib for Universal Payload by default

Current, a macro CPU_TIMER_LIB_ENABLE is added to determine which timerlib
is used. BaseCpuTimerLib.inf is a better way and only fit for recent CPU.
Meanwhile, Universal Payload are only aimed to work with recent CPU.
Therefore, for Universal Payload, use the BaseCpuTimerLib 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 | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 65c1bd610e..1ce96a51c1 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -111,10 +111,10 @@
   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

+  # For recent X86 CPU, 0x15 CPUID instruction will return Time Stamp Counter Frequence.

+  # This is how BaseCpuTimerLib works, and a recommended way to get Frequence, so set the default value as TRUE.

+  # Note: for emulation platform such as QEMU, this may not work and should set it as FALSE

+  DEFINE CPU_TIMER_LIB_ENABLE  = TRUE

 

 [BuildOptions]

   *_*_*_CC_FLAGS                 = -D DISABLE_NEW_DEPRECATED_INTERFACES

@@ -222,7 +222,7 @@
   #

   # Platform

   #

-!if $(CPU_TIMER_LIB_ENABLE) == TRUE

+!if $(CPU_TIMER_LIB_ENABLE) == TRUE && $(UNIVERSAL_PAYLOAD) == 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-25  5:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-19  9:16 [PATCH] UefiPayloadPkg: Use BaseCpuTimerLib for Universal Payload by default Zhiguang Liu
     [not found] ` <BYAPR11MB3622AF8788267BE2BBD269739E599@BYAPR11MB3622.namprd11.prod.outlook.com>
2022-01-20  0:58   ` Zhiguang Liu
2022-01-25  5:50 ` Ni, Ray

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