]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmVirtPkg/ArmVirtQemu*: enable minimal Status Code Routing in DXE
authorLaszlo Ersek <lersek@redhat.com>
Wed, 20 Feb 2019 03:45:20 +0000 (04:45 +0100)
committerLaszlo Ersek <lersek@redhat.com>
Mon, 25 Feb 2019 10:51:36 +0000 (11:51 +0100)
The EFI_RETURN_STATUS_EXTENDED_DATA feature from PI-1.7
(<https://mantis.uefi.org/mantis/view.php?id=1885>) enables platform code
to learn about boot option failures (loading and launching) via status
codes reported by the UEFI Boot Manager.

In commit 59541d41633c, we removed all status code support from
ArmVirtPkg. Reenable that support now, minimally, just to the extent so we
can benefit from the PI-1.7 feature mentioned above:

(1) Include the ReportStatusCodeRouterRuntimeDxe driver.

    This driver produces two protocols, EFI_STATUS_CODE_PROTOCOL and
    EFI_RSC_HANDLER_PROTOCOL. The former allows DXE phase modules and
    runtime modules to report (produce) status codes. The latter allows
    the same types of modules to register callbacks for status code
    handling (consumption).

    (Handler registration  occurs only at boot time. Status codes are
    delivered to each handler at runtime as well, unless the handler is
    unregistered at ExitBootServices().)

(2) Resolve ReportStatusCodeLib to a non-Null instance, for DXE_DRIVER
    modules only. This way DXE_DRIVER modules that use the
    REPORT_STATUS_CODE_EX() macro and friends will reach
    EFI_STATUS_CODE_PROTOCOL from point (1).

(3) Set PcdReportStatusCodePropertyMask to 3 (the default value is 0).
    This causes the REPORT_STATUS_CODE_EX() macro and friends to let
    Progress Codes (bit#0) and Error Codes (bit#1) through to point (1).
    Debug Codes (bit#2) are filtered out.

(4) Include no driver, for now, that registers any status code handler via
    EFI_RSC_HANDLER_PROTOCOL, from point (1). Status codes that reach
    ReportStatusCodeRouterRuntimeDxe will be thrown away.

(5) Modify only the ArmVirtQemu* platforms. A status code handler will
    be added to "ArmVirtPkg/Library/PlatformBootManagerLib" in the next patch,
    and this library instance is not consumed by ArmVirtXen.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Julien Grall <julien.grall@linaro.org>
Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1515418
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
ArmVirtPkg/ArmVirtQemu.dsc
ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
ArmVirtPkg/ArmVirtQemuKernel.dsc

index 8cc31fda7a379864d168441cf8d061d690e3d4a7..ec97d5a14b3a1652f9cf9af045c50d4c2a13f882 100644 (file)
@@ -69,6 +69,9 @@
 [LibraryClasses.common.PEIM]\r
   ArmVirtMemInfoLib|ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoPeiLib.inf\r
 \r
+[LibraryClasses.common.DXE_DRIVER]\r
+  ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf\r
+\r
 [LibraryClasses.common.UEFI_DRIVER]\r
   UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf\r
 \r
   gEfiSecurityPkgTokenSpaceGuid.PcdRemovableMediaImageVerificationPolicy|0x04\r
 !endif\r
 \r
+  gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|3\r
+\r
 [PcdsFixedAtBuild.AARCH64]\r
   # Clearing BIT0 in this PCD prevents installing a 32-bit SMBIOS entry point,\r
   # if the entry point version is >= 3.0. AARCH64 OSes cannot assume the\r
   ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf\r
   MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf\r
 \r
+  #\r
+  # Status Code Routing\r
+  #\r
+  MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.inf\r
+\r
   #\r
   # Platform Driver\r
   #\r
index dc6a0a2bcdc7adc5b9be09d452e483d1688b595b..098d40b61b15111b98ead33825e0aa44e298de92 100644 (file)
@@ -91,6 +91,11 @@ READ_LOCK_STATUS   = TRUE
   INF MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf\r
   INF MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf\r
 \r
+  #\r
+  # Status Code Routing\r
+  #\r
+  INF MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.inf\r
+\r
   #\r
   # Platform Driver\r
   #\r
index c3e0c9bf25492b03c522b20ec620487a25009458..e8c065229b215ecfc367a5e302d2f12726a6ad3f 100644 (file)
@@ -66,6 +66,9 @@
   PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf\r
   PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf\r
 \r
+[LibraryClasses.common.DXE_DRIVER]\r
+  ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf\r
+\r
 [LibraryClasses.common.UEFI_DRIVER]\r
   UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf\r
 \r
   gEfiSecurityPkgTokenSpaceGuid.PcdRemovableMediaImageVerificationPolicy|0x04\r
 !endif\r
 \r
+  gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|3\r
+\r
 [PcdsPatchableInModule.common]\r
   #\r
   # This will be overridden in the code\r
   ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf\r
   MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf\r
 \r
+  #\r
+  # Status Code Routing\r
+  #\r
+  MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.inf\r
+\r
   #\r
   # Platform Driver\r
   #\r