From a41ba5ebe11172f5012433d6cc1c06ff641e60f8 Mon Sep 17 00:00:00 2001 From: Julian Vetter Date: Mon, 23 Mar 2026 10:53:13 +0100 Subject: [PATCH] OvmfPkg/OvmfXen: Switch timer library to support x2APIC mode The SecPeiDxeTimerLibCpu library from the MdePkg accesses the Local APIC timer exclusively via MMIO and explicitly asserts that x2APIC mode is not enabled. This causes failures when vCPUs are pre-enabled in x2APIC mode, which might be necessary for domains with more than 128 vCPUs. So, this commit switches the TimerLib to SecPeiDxeTimerLibUefiCpu from the UefiCpuPkg, which delegates APIC mode handling to the LocalApicLib. OvmfXen already uses BaseXApicX2ApicLib as its LocalApicLib, which transparently supports both xAPIC (MMIO) and x2APIC (MSR) modes. Signed-off-by: Julian Vetter --- OvmfPkg/OvmfXen.dsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc index 70d9bf0b6d..db153b3e90 100644 --- a/OvmfPkg/OvmfXen.dsc +++ b/OvmfPkg/OvmfXen.dsc @@ -124,7 +124,7 @@ [LibraryClasses] PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf - TimerLib|MdePkg/Library/SecPeiDxeTimerLibCpu/SecPeiDxeTimerLibCpu.inf + TimerLib|UefiCpuPkg/Library/SecPeiDxeTimerLibUefiCpu/SecPeiDxeTimerLibUefiCpu.inf ResetSystemLib|OvmfPkg/Library/ResetSystemLib/BaseResetSystemLibXen.inf PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf