]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg: select LocalApicLib instance with x2apic support
authorLaszlo Ersek <lersek@redhat.com>
Mon, 30 Nov 2015 18:42:31 +0000 (18:42 +0000)
committerlersek <lersek@Edk2>
Mon, 30 Nov 2015 18:42:31 +0000 (18:42 +0000)
Although neither LocalApicLib instance is suitable for runtime DXE drivers
(because they access the APIC at the physical address retrieved from
either MSR_IA32_APIC_BASE_ADDRESS or PcdCpuLocalApicBaseAddress), they are
suitable for SMM drivers -- SMM drivers are not influenced by the runtime
OS's virtual address map.

PiSmmCpuDxeSmm links against LocalApicLib. 64-bit Linux guests tend to
enable x2apic mode even in simple VCPU configurations (e.g., 4 sockets, 1
core/socket, 1 thread/core):

  [    0.028173] x2apic enabled

If PiSmmCpuDxeSmm was linked with the BaseXApicLib instance (i.e., with no
x2apic support), then the next runtime service call that is backed by an
SMM driver triggers the following ASSERT in BaseXApicLib (because the
latter notices that x2apic has been enabled, which it doesn't support):

  ASSERT .../UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.c(263):
  ApicBaseMsr.Bits.Extd == 0

It is reasonable to give all LocalApicLib client modules in OVMF the same
level of x2apic support, hence resolve LocalApicLib globally to
BaseXApicX2ApicLib. This will not be conditional on -D SMM_REQUIRE,
because BaseXApicX2ApicLib is compatible with BaseXApicLib in any
environment where the latter can be used.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19052 6f19259b-4bc3-4df7-8a09-765794883524

OvmfPkg/OvmfPkgIa32.dsc
OvmfPkg/OvmfPkgIa32X64.dsc
OvmfPkg/OvmfPkgX64.dsc

index 2c4cf581ea3f44eaa6112647ed2ec384cc595620..e2274eeb5879a1d792fa75c618585293017d1764 100644 (file)
 !endif\r
 \r
   ResetSystemLib|OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf\r
-  LocalApicLib|UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.inf\r
+  LocalApicLib|UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf\r
   DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf\r
 \r
 !if $(SECURE_BOOT_ENABLE) == TRUE\r
index e62f104ecb00f0222de12247d8d4b21af5da16af..d1188ff56a5fbd19fdf22a7df0aed7565c02201b 100644 (file)
 !endif\r
 \r
   ResetSystemLib|OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf\r
-  LocalApicLib|UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.inf\r
+  LocalApicLib|UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf\r
   DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf\r
 \r
 !if $(SECURE_BOOT_ENABLE) == TRUE\r
index 328bf863b80640867d33d8eccf96f6d890c49f81..2162497cc998d5bc5b9214e6dcc3c319ec0854db 100644 (file)
 !endif\r
 \r
   ResetSystemLib|OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf\r
-  LocalApicLib|UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.inf\r
+  LocalApicLib|UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf\r
   DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf\r
 \r
 !if $(SECURE_BOOT_ENABLE) == TRUE\r