]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg: use relaxed AP SMM synchronization mode
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 30 Nov 2015 18:46:46 +0000 (18:46 +0000)
committerlersek <lersek@Edk2>
Mon, 30 Nov 2015 18:46:46 +0000 (18:46 +0000)
Port 0xb2 on QEMU only sends an SMI to the currently executing processor.
The SMI handler, however, and in particular SmmWaitForApArrival, currently
expects that SmmControl2DxeTrigger triggers an SMI IPI on all processors
rather than just the BSP.  Thus all SMM invocations loop for a second (the
default value of PcdCpuSmmApSyncTimeout) before SmmWaitForApArrival sends
another SMI IPI to the APs.

With the default SmmCpuFeaturesLib, 32-bit machines must broadcast SMIs
because 32-bit machines must reset the MTRRs on each entry to system
management modes (they have no SMRRs).  However, our virtual platform
does not have problems with cacheability of SMRAM, so we can use "directed"
SMIs instead.  To do this, just set gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmSyncMode
to 1 (aka SmmCpuSyncModeRelaxedAp).  This fixes SMM on multiprocessor virtual
machines.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19058 6f19259b-4bc3-4df7-8a09-765794883524

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

index 20f6afa257a727599ef16c5d720d93319efe056c..30ffa9caffc82fee04b87de5b98197b9a770e2f6 100644 (file)
   gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile|{ 0x83, 0xA5, 0x04, 0x7C, 0x3E, 0x9E, 0x1C, 0x4F, 0xAD, 0x65, 0xE0, 0x52, 0x68, 0xD0, 0xB4, 0xD1 }\r
 !endif\r
 \r
+!if $(SMM_REQUIRE) == TRUE\r
+  gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmSyncMode|0x01\r
+!endif\r
+\r
 !if $(SECURE_BOOT_ENABLE) == TRUE\r
   # override the default values from SecurityPkg to ensure images from all sources are verified in secure boot\r
   gEfiSecurityPkgTokenSpaceGuid.PcdOptionRomImageVerificationPolicy|0x04\r
index b8f6c11e9641a34e25e04c041b82a14ec607b495..6eb264a540a4b8b74c000503d2f48ff82c1e1411 100644 (file)
 !endif\r
 \r
 [PcdsFixedAtBuild.X64]\r
+!if $(SMM_REQUIRE) == TRUE\r
+  gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmSyncMode|0x01\r
+!endif\r
+\r
 !if $(SECURE_BOOT_ENABLE) == TRUE\r
   # override the default values from SecurityPkg to ensure images from all sources are verified in secure boot\r
   gEfiSecurityPkgTokenSpaceGuid.PcdOptionRomImageVerificationPolicy|0x04\r
index 2f09661fe917fe6b28f85c9a8703a3db40158c79..48604686445a532150f192baafe3635a1bc084c2 100644 (file)
   gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile|{ 0x83, 0xA5, 0x04, 0x7C, 0x3E, 0x9E, 0x1C, 0x4F, 0xAD, 0x65, 0xE0, 0x52, 0x68, 0xD0, 0xB4, 0xD1 }\r
 !endif\r
 \r
+!if $(SMM_REQUIRE) == TRUE\r
+  gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmSyncMode|0x01\r
+!endif\r
+\r
 !if $(SECURE_BOOT_ENABLE) == TRUE\r
   # override the default values from SecurityPkg to ensure images from all sources are verified in secure boot\r
   gEfiSecurityPkgTokenSpaceGuid.PcdOptionRomImageVerificationPolicy|0x04\r