* Re: [edk2-devel] [PATCH] UefiPayloadPkg: Add macro to enable selection of timer [not found] <17A75CEA85AC7172.16812@groups.io> @ 2024-01-05 6:19 ` Ma, Hua 2024-01-05 8:20 ` Guo, Gua 0 siblings, 1 reply; 7+ messages in thread From: Ma, Hua @ 2024-01-05 6:19 UTC (permalink / raw) To: devel, Gua Guo, Guo Dong, James Lu, Sean Rhodes Add maintainers to help review the patch, thank you, Ma Hua On 1/5/2024 1:38 PM, Ma, Hua wrote: > Add macro to enable selection of timer > > - HPET: UEFI Payload will use HPET timer > - LAPIC: UEFI Payload will use local APIC timer > > Signed-off-by: Hua Ma <hua.ma@intel.com> > --- > UefiPayloadPkg/UefiPayloadPkg.dsc | 16 ++++++++++++++++ > UefiPayloadPkg/UefiPayloadPkg.fdf | 4 ++++ > 2 files changed, 20 insertions(+) > > diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayloadPkg.dsc > index b8b13ad201..4f195c1e52 100644 > --- a/UefiPayloadPkg/UefiPayloadPkg.dsc > +++ b/UefiPayloadPkg/UefiPayloadPkg.dsc > @@ -139,6 +139,12 @@ > # Note: for emulation platform such as QEMU, this may not work and should set it as FALSE > DEFINE CPU_TIMER_LIB_ENABLE = TRUE > > + # > + # HPET: UEFI Payload will use HPET timer > + # LAPIC: UEFI Payload will use local APIC timer > + # > + DEFINE TIMER_SUPPORT = HPET > + > DEFINE MULTIPLE_DEBUG_PORT_SUPPORT = FALSE > > [BuildOptions] > @@ -676,7 +682,17 @@ > MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf > > > +!if $(TIMER_SUPPORT) == "HPET" > PcAtChipsetPkg/HpetTimerDxe/HpetTimerDxe.inf > +!elseif $(TIMER_SUPPORT) == "LAPIC" > + OvmfPkg/LocalApicTimerDxe/LocalApicTimerDxe.inf { > + <LibraryClasses> > + NestedInterruptTplLib|OvmfPkg/Library/NestedInterruptTplLib/NestedInterruptTplLib.inf > + } > +!else > + !error "Invalid TIMER_SUPPORT" > +!endif > + > MdeModulePkg/Universal/Metronome/Metronome.inf > MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf > MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf > diff --git a/UefiPayloadPkg/UefiPayloadPkg.fdf b/UefiPayloadPkg/UefiPayloadPkg.fdf > index 835798be1c..7d04a8cffd 100644 > --- a/UefiPayloadPkg/UefiPayloadPkg.fdf > +++ b/UefiPayloadPkg/UefiPayloadPkg.fdf > @@ -161,7 +161,11 @@ INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf > !endif > INF UefiCpuPkg/CpuDxe/CpuDxe.inf > > +!if $(TIMER_SUPPORT) == "HPET" > INF PcAtChipsetPkg/HpetTimerDxe/HpetTimerDxe.inf > +!elseif $(TIMER_SUPPORT) == "LAPIC" > +INF OvmfPkg/LocalApicTimerDxe/LocalApicTimerDxe.inf > +!endif > INF MdeModulePkg/Universal/Metronome/Metronome.inf > INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf > INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113220): https://edk2.groups.io/g/devel/message/113220 Mute This Topic: https://groups.io/mt/103538255/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=- ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [edk2-devel] [PATCH] UefiPayloadPkg: Add macro to enable selection of timer 2024-01-05 6:19 ` [edk2-devel] [PATCH] UefiPayloadPkg: Add macro to enable selection of timer Ma, Hua @ 2024-01-05 8:20 ` Guo, Gua 0 siblings, 0 replies; 7+ messages in thread From: Guo, Gua @ 2024-01-05 8:20 UTC (permalink / raw) To: Ma, Hua, devel@edk2.groups.io, Dong, Guo, Lu, James, Rhodes, Sean Reviewed-by: Gua Guo <gua.guo@intel.com> -----Original Message----- From: Ma, Hua <hua.ma@intel.com> Sent: Friday, January 5, 2024 2:19 PM To: devel@edk2.groups.io; Guo, Gua <gua.guo@intel.com>; Dong, Guo <guo.dong@intel.com>; Lu, James <james.lu@intel.com>; Rhodes, Sean <sean@starlabs.systems> Subject: Re: [edk2-devel] [PATCH] UefiPayloadPkg: Add macro to enable selection of timer Add maintainers to help review the patch, thank you, Ma Hua On 1/5/2024 1:38 PM, Ma, Hua wrote: > Add macro to enable selection of timer > > - HPET: UEFI Payload will use HPET timer > - LAPIC: UEFI Payload will use local APIC timer > > Signed-off-by: Hua Ma <hua.ma@intel.com> > --- > UefiPayloadPkg/UefiPayloadPkg.dsc | 16 ++++++++++++++++ > UefiPayloadPkg/UefiPayloadPkg.fdf | 4 ++++ > 2 files changed, 20 insertions(+) > > diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc > b/UefiPayloadPkg/UefiPayloadPkg.dsc > index b8b13ad201..4f195c1e52 100644 > --- a/UefiPayloadPkg/UefiPayloadPkg.dsc > +++ b/UefiPayloadPkg/UefiPayloadPkg.dsc > @@ -139,6 +139,12 @@ > # Note: for emulation platform such as QEMU, this may not work and should set it as FALSE > DEFINE CPU_TIMER_LIB_ENABLE = TRUE > > + # > + # HPET: UEFI Payload will use HPET timer # LAPIC: UEFI Payload > + will use local APIC timer # > + DEFINE TIMER_SUPPORT = HPET > + > DEFINE MULTIPLE_DEBUG_PORT_SUPPORT = FALSE > > [BuildOptions] > @@ -676,7 +682,17 @@ > MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf > > > +!if $(TIMER_SUPPORT) == "HPET" > PcAtChipsetPkg/HpetTimerDxe/HpetTimerDxe.inf > +!elseif $(TIMER_SUPPORT) == "LAPIC" > + OvmfPkg/LocalApicTimerDxe/LocalApicTimerDxe.inf { > + <LibraryClasses> > + > +NestedInterruptTplLib|OvmfPkg/Library/NestedInterruptTplLib/NestedInt > +erruptTplLib.inf > + } > +!else > + !error "Invalid TIMER_SUPPORT" > +!endif > + > MdeModulePkg/Universal/Metronome/Metronome.inf > MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf > MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf > diff --git a/UefiPayloadPkg/UefiPayloadPkg.fdf > b/UefiPayloadPkg/UefiPayloadPkg.fdf > index 835798be1c..7d04a8cffd 100644 > --- a/UefiPayloadPkg/UefiPayloadPkg.fdf > +++ b/UefiPayloadPkg/UefiPayloadPkg.fdf > @@ -161,7 +161,11 @@ INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf > !endif > INF UefiCpuPkg/CpuDxe/CpuDxe.inf > > +!if $(TIMER_SUPPORT) == "HPET" > INF PcAtChipsetPkg/HpetTimerDxe/HpetTimerDxe.inf > +!elseif $(TIMER_SUPPORT) == "LAPIC" > +INF OvmfPkg/LocalApicTimerDxe/LocalApicTimerDxe.inf > +!endif > INF MdeModulePkg/Universal/Metronome/Metronome.inf > INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf > INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113223): https://edk2.groups.io/g/devel/message/113223 Mute This Topic: https://groups.io/mt/103538255/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=- ^ permalink raw reply [flat|nested] 7+ messages in thread
* [edk2-devel] [PATCH] UefiPayloadPkg: Add macro to enable selection of timer @ 2024-01-05 5:38 Ma, Hua 2024-01-09 23:48 ` Benjamin Doron 2024-01-10 1:27 ` Nate DeSimone 0 siblings, 2 replies; 7+ messages in thread From: Ma, Hua @ 2024-01-05 5:38 UTC (permalink / raw) To: devel; +Cc: Hua Ma Add macro to enable selection of timer - HPET: UEFI Payload will use HPET timer - LAPIC: UEFI Payload will use local APIC timer Signed-off-by: Hua Ma <hua.ma@intel.com> --- UefiPayloadPkg/UefiPayloadPkg.dsc | 16 ++++++++++++++++ UefiPayloadPkg/UefiPayloadPkg.fdf | 4 ++++ 2 files changed, 20 insertions(+) diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayloadPkg.dsc index b8b13ad201..4f195c1e52 100644 --- a/UefiPayloadPkg/UefiPayloadPkg.dsc +++ b/UefiPayloadPkg/UefiPayloadPkg.dsc @@ -139,6 +139,12 @@ # Note: for emulation platform such as QEMU, this may not work and should set it as FALSE DEFINE CPU_TIMER_LIB_ENABLE = TRUE + # + # HPET: UEFI Payload will use HPET timer + # LAPIC: UEFI Payload will use local APIC timer + # + DEFINE TIMER_SUPPORT = HPET + DEFINE MULTIPLE_DEBUG_PORT_SUPPORT = FALSE [BuildOptions] @@ -676,7 +682,17 @@ MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf +!if $(TIMER_SUPPORT) == "HPET" PcAtChipsetPkg/HpetTimerDxe/HpetTimerDxe.inf +!elseif $(TIMER_SUPPORT) == "LAPIC" + OvmfPkg/LocalApicTimerDxe/LocalApicTimerDxe.inf { + <LibraryClasses> + NestedInterruptTplLib|OvmfPkg/Library/NestedInterruptTplLib/NestedInterruptTplLib.inf + } +!else + !error "Invalid TIMER_SUPPORT" +!endif + MdeModulePkg/Universal/Metronome/Metronome.inf MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf diff --git a/UefiPayloadPkg/UefiPayloadPkg.fdf b/UefiPayloadPkg/UefiPayloadPkg.fdf index 835798be1c..7d04a8cffd 100644 --- a/UefiPayloadPkg/UefiPayloadPkg.fdf +++ b/UefiPayloadPkg/UefiPayloadPkg.fdf @@ -161,7 +161,11 @@ INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf !endif INF UefiCpuPkg/CpuDxe/CpuDxe.inf +!if $(TIMER_SUPPORT) == "HPET" INF PcAtChipsetPkg/HpetTimerDxe/HpetTimerDxe.inf +!elseif $(TIMER_SUPPORT) == "LAPIC" +INF OvmfPkg/LocalApicTimerDxe/LocalApicTimerDxe.inf +!endif INF MdeModulePkg/Universal/Metronome/Metronome.inf INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf -- 2.39.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113219): https://edk2.groups.io/g/devel/message/113219 Mute This Topic: https://groups.io/mt/103538255/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=- ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [edk2-devel] [PATCH] UefiPayloadPkg: Add macro to enable selection of timer 2024-01-05 5:38 Ma, Hua @ 2024-01-09 23:48 ` Benjamin Doron 2024-01-10 1:28 ` Nate DeSimone 2024-01-10 1:27 ` Nate DeSimone 1 sibling, 1 reply; 7+ messages in thread From: Benjamin Doron @ 2024-01-09 23:48 UTC (permalink / raw) To: Ma, Hua, devel [-- Attachment #1: Type: text/plain, Size: 497 bytes --] Hi, Are there platforms that will use this? What advantages does using the LAPIC as a timer offer? Thanks. Regards, Benjamin -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113496): https://edk2.groups.io/g/devel/message/113496 Mute This Topic: https://groups.io/mt/103538255/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=- [-- Attachment #2: Type: text/html, Size: 925 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [edk2-devel] [PATCH] UefiPayloadPkg: Add macro to enable selection of timer 2024-01-09 23:48 ` Benjamin Doron @ 2024-01-10 1:28 ` Nate DeSimone 2024-01-10 2:09 ` Benjamin Doron 0 siblings, 1 reply; 7+ messages in thread From: Nate DeSimone @ 2024-01-10 1:28 UTC (permalink / raw) To: devel@edk2.groups.io, benjamin.doron00@gmail.com, Ma, Hua [-- Attachment #1: Type: text/plain, Size: 1226 bytes --] Hi Benjamin, We consider using the LAPIC as a timer to be technically superior because it is closer to the CPU. The HPET is a PCH device, which means all access to the timer needs go from CPU -> Home Agent -> Fabric/IO Ring -> DMI Controller -> PCH. Using the LAPIC cuts this path to just the Home Agent. That reduces access latency, which for a timer means higher resolution. Hope that helps, Nate From: devel@edk2.groups.io <devel@edk2.groups.io> on behalf of Benjamin Doron <benjamin.doron00@gmail.com> Date: Tuesday, January 9, 2024 at 3:48 PM To: Ma <>, Ma, Hua <Hua.Ma@intel.com>, devel@edk2.groups.io <devel@edk2.groups.io> Subject: Re: [edk2-devel] [PATCH] UefiPayloadPkg: Add macro to enable selection of timer Hi, Are there platforms that will use this? What advantages does using the LAPIC as a timer offer? Thanks. Regards, Benjamin -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113504): https://edk2.groups.io/g/devel/message/113504 Mute This Topic: https://groups.io/mt/103538255/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=- [-- Attachment #2: Type: text/html, Size: 4692 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [edk2-devel] [PATCH] UefiPayloadPkg: Add macro to enable selection of timer 2024-01-10 1:28 ` Nate DeSimone @ 2024-01-10 2:09 ` Benjamin Doron 0 siblings, 0 replies; 7+ messages in thread From: Benjamin Doron @ 2024-01-10 2:09 UTC (permalink / raw) To: Desimone, Nathaniel L, devel@edk2.groups.io, Ma, Hua [-- Attachment #1: Type: text/plain, Size: 1424 bytes --] Hi Nate, Ah, that makes sense. Thanks! Best regards, Benjamin On January 9, 2024 8:28:08 p.m. EST, "Desimone, Nathaniel L" <nathaniel.l.desimone@intel.com> wrote: >Hi Benjamin, > >We consider using the LAPIC as a timer to be technically superior because it is closer to the CPU. The HPET is a PCH device, which means all access to the timer needs go from CPU -> Home Agent -> Fabric/IO Ring -> DMI Controller -> PCH. Using the LAPIC cuts this path to just the Home Agent. That reduces access latency, which for a timer means higher resolution. > >Hope that helps, >Nate > >From: devel@edk2.groups.io <devel@edk2.groups.io> on behalf of Benjamin Doron <benjamin.doron00@gmail.com> >Date: Tuesday, January 9, 2024 at 3:48 PM >To: Ma <>, Ma, Hua <Hua.Ma@intel.com>, devel@edk2.groups.io <devel@edk2.groups.io> >Subject: Re: [edk2-devel] [PATCH] UefiPayloadPkg: Add macro to enable selection of timer >Hi, >Are there platforms that will use this? What advantages does using the LAPIC as a timer offer? Thanks. > >Regards, >Benjamin > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113508): https://edk2.groups.io/g/devel/message/113508 Mute This Topic: https://groups.io/mt/103538255/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=- [-- Attachment #2: Type: text/html, Size: 5156 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [edk2-devel] [PATCH] UefiPayloadPkg: Add macro to enable selection of timer 2024-01-05 5:38 Ma, Hua 2024-01-09 23:48 ` Benjamin Doron @ 2024-01-10 1:27 ` Nate DeSimone 1 sibling, 0 replies; 7+ messages in thread From: Nate DeSimone @ 2024-01-10 1:27 UTC (permalink / raw) To: devel@edk2.groups.io, Ma, Hua Hi Hua, Please make TIMER_SUPPORT a FixedAtBuiildPcd instead of a build flag. Something like PcdDxeTimerSelection or similar. Thanks, Nate > -----Original Message----- > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Ma, Hua > Sent: Thursday, January 4, 2024 9:39 PM > To: devel@edk2.groups.io > Cc: Ma, Hua <hua.ma@intel.com> > Subject: [edk2-devel] [PATCH] UefiPayloadPkg: Add macro to enable selection > of timer > > Add macro to enable selection of timer > > - HPET: UEFI Payload will use HPET timer > - LAPIC: UEFI Payload will use local APIC timer > > Signed-off-by: Hua Ma <hua.ma@intel.com> > --- > UefiPayloadPkg/UefiPayloadPkg.dsc | 16 ++++++++++++++++ > UefiPayloadPkg/UefiPayloadPkg.fdf | 4 ++++ > 2 files changed, 20 insertions(+) > > diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc > b/UefiPayloadPkg/UefiPayloadPkg.dsc > index b8b13ad201..4f195c1e52 100644 > --- a/UefiPayloadPkg/UefiPayloadPkg.dsc > +++ b/UefiPayloadPkg/UefiPayloadPkg.dsc > @@ -139,6 +139,12 @@ > # Note: for emulation platform such as QEMU, this may not work and should > set it as FALSE > DEFINE CPU_TIMER_LIB_ENABLE = TRUE > > + # > + # HPET: UEFI Payload will use HPET timer # LAPIC: UEFI Payload will > + use local APIC timer # > + DEFINE TIMER_SUPPORT = HPET > + > DEFINE MULTIPLE_DEBUG_PORT_SUPPORT = FALSE > > [BuildOptions] > @@ -676,7 +682,17 @@ > > MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuAp > p.inf > > > +!if $(TIMER_SUPPORT) == "HPET" > PcAtChipsetPkg/HpetTimerDxe/HpetTimerDxe.inf > +!elseif $(TIMER_SUPPORT) == "LAPIC" > + OvmfPkg/LocalApicTimerDxe/LocalApicTimerDxe.inf { > + <LibraryClasses> > + > +NestedInterruptTplLib|OvmfPkg/Library/NestedInterruptTplLib/NestedInter > +ruptTplLib.inf > + } > +!else > + !error "Invalid TIMER_SUPPORT" > +!endif > + > MdeModulePkg/Universal/Metronome/Metronome.inf > MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf > MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf > diff --git a/UefiPayloadPkg/UefiPayloadPkg.fdf > b/UefiPayloadPkg/UefiPayloadPkg.fdf > index 835798be1c..7d04a8cffd 100644 > --- a/UefiPayloadPkg/UefiPayloadPkg.fdf > +++ b/UefiPayloadPkg/UefiPayloadPkg.fdf > @@ -161,7 +161,11 @@ INF > MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf > !endif > INF UefiCpuPkg/CpuDxe/CpuDxe.inf > > +!if $(TIMER_SUPPORT) == "HPET" > INF PcAtChipsetPkg/HpetTimerDxe/HpetTimerDxe.inf > +!elseif $(TIMER_SUPPORT) == "LAPIC" > +INF OvmfPkg/LocalApicTimerDxe/LocalApicTimerDxe.inf > +!endif > INF MdeModulePkg/Universal/Metronome/Metronome.inf > INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf > INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf > -- > 2.39.1.windows.1 > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113503): https://edk2.groups.io/g/devel/message/113503 Mute This Topic: https://groups.io/mt/103538255/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=- ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-01-10 2:09 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <17A75CEA85AC7172.16812@groups.io> 2024-01-05 6:19 ` [edk2-devel] [PATCH] UefiPayloadPkg: Add macro to enable selection of timer Ma, Hua 2024-01-05 8:20 ` Guo, Gua 2024-01-05 5:38 Ma, Hua 2024-01-09 23:48 ` Benjamin Doron 2024-01-10 1:28 ` Nate DeSimone 2024-01-10 2:09 ` Benjamin Doron 2024-01-10 1:27 ` Nate DeSimone
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox