]> git.proxmox.com Git - mirror_edk2.git/commit - OvmfPkg/OvmfPkgIa32.dsc
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)
commitdecb365b0016bee2597250903366e02c0e47cc02
tree4fd0d61a293b74263f92b55e6fae8b51d430d343
parentcbd5d723d5249de91c560db517a88ec841de6dc4
OvmfPkg: select LocalApicLib instance with x2apic support

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