]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg/IoMmuDxe: propagate errors from AmdSevInstallIoMmuProtocol()
authorLaszlo Ersek <lersek@redhat.com>
Wed, 2 Aug 2017 10:20:14 +0000 (12:20 +0200)
committerLaszlo Ersek <lersek@redhat.com>
Fri, 4 Aug 2017 23:31:52 +0000 (01:31 +0200)
If we cannot install the IOMMU protocol for whatever reason, exit the
driver with an error. The same is already done for the IOMMU Absent
protocol.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Brijesh Singh <brijesh.singh@amd.com>
OvmfPkg/IoMmuDxe/AmdSevIoMmu.c
OvmfPkg/IoMmuDxe/AmdSevIoMmu.h
OvmfPkg/IoMmuDxe/IoMmuDxe.c

index 954062442782a589f38b0630e6bb56a284ea19a6..8c2c23356a4029113ab9738525ed9519aab32d99 100644 (file)
@@ -499,7 +499,7 @@ EDKII_IOMMU_PROTOCOL  mAmdSev = {
   Initialize Iommu Protocol.\r
 \r
 **/\r
-VOID\r
+EFI_STATUS\r
 EFIAPI\r
 AmdSevInstallIoMmuProtocol (\r
   VOID\r
@@ -514,5 +514,5 @@ AmdSevInstallIoMmuProtocol (
                   &gEdkiiIoMmuProtocolGuid, &mAmdSev,\r
                   NULL\r
                   );\r
-  ASSERT_EFI_ERROR (Status);\r
+  return Status;\r
 }\r
index 982e41a7b06ee4de474ed26579f3a4b2c435526d..17d3694e4a84943de7706719a9f519d0f1ce5cb5 100644 (file)
@@ -35,7 +35,7 @@
   MemEncryptSevLib.\r
 \r
 **/\r
-VOID\r
+EFI_STATUS\r
 EFIAPI\r
 AmdSevInstallIoMmuProtocol (\r
   VOID\r
index 27b1856e0a17e3a82308cb4ea8c1c13072d00031..0ea42cbc13cee853b2ad23c1b0de4ce106c287f7 100644 (file)
@@ -36,14 +36,12 @@ IoMmuDxeEntryPoint (
   EFI_STATUS    Status;\r
   EFI_HANDLE    Handle;\r
 \r
-  Status = EFI_SUCCESS;\r
-\r
   //\r
   // When SEV is enabled, install IoMmu protocol otherwise install the\r
   // placeholder protocol so that other dependent module can run.\r
   //\r
   if (MemEncryptSevIsEnabled ()) {\r
-    AmdSevInstallIoMmuProtocol ();\r
+    Status = AmdSevInstallIoMmuProtocol ();\r
   } else {\r
     Handle = NULL;\r
 \r