]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmVirtPkg/PlatformHasAcpiDtDxe: allow guest level ACPI disable override
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Wed, 29 Mar 2017 17:50:39 +0000 (18:50 +0100)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 31 Mar 2017 10:44:36 +0000 (11:44 +0100)
In general, we should not present two separate (and inevitably different)
hardware descriptions to the OS, in the form of ACPI tables and a device
tree blob. For this reason, we recently added the logic to ArmVirtQemu to
only expose the ACPI 2.0 entry point if no DT binary is being passed, and
vice versa.

However, this is arguably a regression for those who relied on DT
descriptions being available, even if the former behavior can be
restored by passing the -no-acpi switch to QEMU.

So allow a secret handshake with the UEFI Shell, to set a variable that
will result in ACPI to be disabled on subsequent boots even if -no-acpi
was not passed on the QEMU command line.

  setvar -nv -bs -guid 50bea1e5-a2c5-46e9-9b3a-59596516b00a ForceNoAcpi =01

To delete the variable and revert to the old situation, simply omit the
value after the =

  setvar -nv -bs -guid 50bea1e5-a2c5-46e9-9b3a-59596516b00a ForceNoAcpi =

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
ArmVirtPkg/ArmVirtPkg.dec
ArmVirtPkg/ArmVirtQemu.dsc
ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.c
ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.inf

index efe83a383d552e7d3752e615c494723c6a0f8867..a8603e1b80e5d85b8d07f192bb31fcca65f45995 100644 (file)
@@ -34,6 +34,8 @@
   gArmVirtTokenSpaceGuid = { 0x0B6F5CA7, 0x4F53, 0x445A, { 0xB7, 0x6E, 0x2E, 0x36, 0x5B, 0x80, 0x63, 0x66 } }\r
   gEarlyPL011BaseAddressGuid       = { 0xB199DEA9, 0xFD5C, 0x4A84, { 0x80, 0x82, 0x2F, 0x41, 0x70, 0x78, 0x03, 0x05 } }\r
 \r
+  gArmVirtVariableGuid   = { 0x50bea1e5, 0xa2c5, 0x46e9, { 0x9b, 0x3a, 0x59, 0x59, 0x65, 0x16, 0xb0, 0x0a } }\r
+\r
 [Protocols]\r
   gFdtClientProtocolGuid = { 0xE11FACA0, 0x4710, 0x4C8E, { 0xA7, 0xA2, 0x01, 0xBA, 0xA2, 0x59, 0x1B, 0x4C } }\r
 \r
   # EFI_VT_100_GUID.\r
   #\r
   gArmVirtTokenSpaceGuid.PcdTerminalTypeGuidBuffer|{0x65, 0x60, 0xA6, 0xDF, 0x19, 0xB4, 0xD3, 0x11, 0x9A, 0x2D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D}|VOID*|0x00000007\r
+\r
+[PcdsDynamic]\r
+  #\r
+  # Whether to force disable ACPI, regardless of the fw_cfg settings\r
+  # exposed by QEMU\r
+  #\r
+  gArmVirtTokenSpaceGuid.PcdForceNoAcpi|0x0|BOOLEAN|0x00000003\r
index e00007eb03f14ac4fe25b396f80edbf6e3ecc296..ae96606cdd0da753c4de58d2ff8cb3bd734604f5 100644 (file)
   gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosDocRev|0x0\r
   gUefiOvmfPkgTokenSpaceGuid.PcdQemuSmbiosValidated|FALSE\r
 \r
+[PcdsDynamicHii]\r
+  gArmVirtTokenSpaceGuid.PcdForceNoAcpi|L"ForceNoAcpi"|gArmVirtVariableGuid|0x0|FALSE|NV,BS\r
+\r
 ################################################################################\r
 #\r
 # Components Section - list of all EDK II Modules needed by this Platform\r
index 8932dacabec5e72a82db7b10af87daae502941b3..da3cee645cfbe8597aa543067f998e621b8d95ad 100644 (file)
@@ -17,6 +17,7 @@
 #include <Guid/PlatformHasDeviceTree.h>\r
 #include <Library/BaseLib.h>\r
 #include <Library/DebugLib.h>\r
+#include <Library/PcdLib.h>\r
 #include <Library/QemuFwCfgLib.h>\r
 #include <Library/UefiBootServicesTableLib.h>\r
 \r
@@ -37,6 +38,7 @@ PlatformHasAcpiDt (
   // errors here.\r
   //\r
   if (MAX_UINTN == MAX_UINT64 &&\r
+      !PcdGetBool (PcdForceNoAcpi) &&\r
       !EFI_ERROR (\r
          QemuFwCfgFindFile (\r
            "etc/table-loader",\r
index 4466bead57c27866663543a5f33334655a519692..08025f0c3722d0dc3e8610002720f54f7e5317e6 100644 (file)
@@ -25,6 +25,7 @@
   PlatformHasAcpiDtDxe.c\r
 \r
 [Packages]\r
+  ArmVirtPkg/ArmVirtPkg.dec\r
   EmbeddedPkg/EmbeddedPkg.dec\r
   MdePkg/MdePkg.dec\r
   OvmfPkg/OvmfPkg.dec\r
@@ -32,6 +33,7 @@
 [LibraryClasses]\r
   BaseLib\r
   DebugLib\r
+  PcdLib\r
   QemuFwCfgLib\r
   UefiBootServicesTableLib\r
   UefiDriverEntryPoint\r
@@ -40,5 +42,8 @@
   gEdkiiPlatformHasAcpiGuid       ## SOMETIMES_PRODUCES ## PROTOCOL\r
   gEdkiiPlatformHasDeviceTreeGuid ## SOMETIMES_PRODUCES ## PROTOCOL\r
 \r
+[Pcd]\r
+  gArmVirtTokenSpaceGuid.PcdForceNoAcpi\r
+\r
 [Depex]\r
   TRUE\r