]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg/ResetSystemLib: introduce the DxeResetSystemLib instance
authorLaszlo Ersek <lersek@redhat.com>
Fri, 17 Apr 2020 15:37:51 +0000 (17:37 +0200)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 22 Apr 2020 19:42:32 +0000 (19:42 +0000)
The BaseResetSystemLib instance is not suitable for OS runtime, because
its ResetShutdown() implementation calls PciRead16 (OVMF_HOSTBRIDGE_DID).
On q35, this boils down to a memory-mapped config space access -- but we
never ask the OS to map MMCONFIG for runtime.

There are at least three alternatives to approach this:

(1) Investigate "MdePkg/Library/DxeRuntimePciExpressLib", which offers
    some kind of runtime mapping for MMCONFIG.

(2) Consume PciCf8Lib directly, rather than PciLib, in ResetSystemLib.
    Then we'll read OVMF_HOSTBRIDGE_DID from the config space with IO port
    accesses on q35 too, not just on i440fx. IO ports don't depend on page
    tables.

(3) In the lib constructor, cache "mAcpiPmBaseAddress" based on
    "PcdOvmfHostBridgePciDevId" (which is set by PlatformPei). Then the
    host bridge type will be known at runtime without PCI config space
    accesses.

This patch follows approach (3), in order to mirror AcpiTimerLib.

Notes:

* This patch is best viewed with "git show --find-copies-harder -C43".

* PCDs are not usable in the DXE_CORE, as the PCD PPI is gone, and the PCD
  protocol is not available yet. (The DXE_CORE does consume ResetSystemLib
  in practice, when OVMF is built with -D SOURCE_DEBUG_ENABLE.)

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Julien Grall <julien@xen.org>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Cc: Rebecca Cran <rebecca@bsdio.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2675
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20200417153751.7110-7-lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
Reviewed-by: Rebecca Cran <rebecca@bsdio.com>
[lersek@redhat.com: move third Note (with repro info) to BZ comment]

OvmfPkg/Library/ResetSystemLib/BaseResetSystemLib.inf
OvmfPkg/Library/ResetSystemLib/DxeResetShutdown.c [new file with mode: 0644]
OvmfPkg/Library/ResetSystemLib/DxeResetSystemLib.inf [new file with mode: 0644]
OvmfPkg/OvmfPkgIa32.dsc
OvmfPkg/OvmfPkgIa32X64.dsc
OvmfPkg/OvmfPkgX64.dsc
OvmfPkg/OvmfXen.dsc

index 0772780b2dc2d3f21cbca36afba558c6b118b679..35d317f1e0b35f402e6209239ad644e5af10e727 100644 (file)
@@ -12,7 +12,7 @@
   FILE_GUID                      = 66564872-21d4-4d2a-a68b-1e844f980820\r
   MODULE_TYPE                    = BASE\r
   VERSION_STRING                 = 1.0\r
-  LIBRARY_CLASS                  = ResetSystemLib\r
+  LIBRARY_CLASS                  = ResetSystemLib|SEC PEI_CORE PEIM DXE_CORE\r
 \r
 #\r
 # The following information is for reference only and not required by the build\r
diff --git a/OvmfPkg/Library/ResetSystemLib/DxeResetShutdown.c b/OvmfPkg/Library/ResetSystemLib/DxeResetShutdown.c
new file mode 100644 (file)
index 0000000..5a75c32
--- /dev/null
@@ -0,0 +1,62 @@
+/** @file\r
+  DXE Reset System Library Shutdown API implementation for OVMF.\r
+\r
+  Copyright (C) 2020, Red Hat, Inc.\r
+  Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
+**/\r
+\r
+#include <Base.h>                   // BIT13\r
+\r
+#include <Library/BaseLib.h>        // CpuDeadLoop()\r
+#include <Library/DebugLib.h>       // ASSERT()\r
+#include <Library/IoLib.h>          // IoOr16()\r
+#include <Library/PcdLib.h>         // PcdGet16()\r
+#include <Library/ResetSystemLib.h> // ResetShutdown()\r
+#include <OvmfPlatforms.h>          // PIIX4_PMBA_VALUE\r
+\r
+STATIC UINT16 mAcpiPmBaseAddress;\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+DxeResetInit (\r
+  IN EFI_HANDLE       ImageHandle,\r
+  IN EFI_SYSTEM_TABLE *SystemTable\r
+  )\r
+{\r
+  UINT16 HostBridgeDevId;\r
+\r
+  HostBridgeDevId = PcdGet16 (PcdOvmfHostBridgePciDevId);\r
+  switch (HostBridgeDevId) {\r
+  case INTEL_82441_DEVICE_ID:\r
+    mAcpiPmBaseAddress = PIIX4_PMBA_VALUE;\r
+    break;\r
+  case INTEL_Q35_MCH_DEVICE_ID:\r
+    mAcpiPmBaseAddress = ICH9_PMBASE_VALUE;\r
+    break;\r
+  default:\r
+    ASSERT (FALSE);\r
+    CpuDeadLoop ();\r
+    return EFI_UNSUPPORTED;\r
+  }\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+/**\r
+  Calling this function causes the system to enter a power state equivalent\r
+  to the ACPI G2/S5 or G3 states.\r
+\r
+  System shutdown should not return, if it returns, it means the system does\r
+  not support shut down reset.\r
+**/\r
+VOID\r
+EFIAPI\r
+ResetShutdown (\r
+  VOID\r
+  )\r
+{\r
+  IoBitFieldWrite16 (mAcpiPmBaseAddress + 4, 10, 13, 0);\r
+  IoOr16 (mAcpiPmBaseAddress + 4, BIT13);\r
+  CpuDeadLoop ();\r
+}\r
diff --git a/OvmfPkg/Library/ResetSystemLib/DxeResetSystemLib.inf b/OvmfPkg/Library/ResetSystemLib/DxeResetSystemLib.inf
new file mode 100644 (file)
index 0000000..a9b4ce9
--- /dev/null
@@ -0,0 +1,43 @@
+## @file\r
+#  DXE library instance for ResetSystem library class for OVMF\r
+#\r
+#  Copyright (C) 2020, Red Hat, Inc.\r
+#  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
+#  SPDX-License-Identifier: BSD-2-Clause-Patent\r
+#\r
+##\r
+\r
+[Defines]\r
+  INF_VERSION                    = 1.29\r
+  BASE_NAME                      = DxeResetSystemLib\r
+  FILE_GUID                      = bc7835ea-4094-41fe-b770-bad9e6c479b2\r
+  MODULE_TYPE                    = DXE_DRIVER\r
+  VERSION_STRING                 = 1.0\r
+  LIBRARY_CLASS                  = ResetSystemLib|DXE_DRIVER DXE_RUNTIME_DRIVER SMM_CORE DXE_SMM_DRIVER UEFI_DRIVER UEFI_APPLICATION\r
+  CONSTRUCTOR                    = DxeResetInit\r
+\r
+#\r
+# The following information is for reference only and not required by the build\r
+# tools.\r
+#\r
+#  VALID_ARCHITECTURES           = IA32 X64\r
+#\r
+\r
+[Sources]\r
+  DxeResetShutdown.c\r
+  ResetSystemLib.c\r
+\r
+[Packages]\r
+  MdeModulePkg/MdeModulePkg.dec\r
+  MdePkg/MdePkg.dec\r
+  OvmfPkg/OvmfPkg.dec\r
+\r
+[LibraryClasses]\r
+  BaseLib\r
+  DebugLib\r
+  IoLib\r
+  PcdLib\r
+  TimerLib\r
+\r
+[Pcd]\r
+  gUefiOvmfPkgTokenSpaceGuid.PcdOvmfHostBridgePciDevId ## CONSUMES\r
index cd0ed34e0e5a194eeca85e9b1595c97bae37bee8..d5e90c0013708bcd06568872c16ca607288f684a 100644 (file)
 [LibraryClasses.common.DXE_RUNTIME_DRIVER]\r
   PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
   TimerLib|OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf\r
+  ResetSystemLib|OvmfPkg/Library/ResetSystemLib/DxeResetSystemLib.inf\r
   HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
   DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf\r
   MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf\r
 [LibraryClasses.common.UEFI_DRIVER]\r
   PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
   TimerLib|OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf\r
+  ResetSystemLib|OvmfPkg/Library/ResetSystemLib/DxeResetSystemLib.inf\r
   HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
   DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf\r
   MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf\r
 [LibraryClasses.common.DXE_DRIVER]\r
   PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
   TimerLib|OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf\r
+  ResetSystemLib|OvmfPkg/Library/ResetSystemLib/DxeResetSystemLib.inf\r
   HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
   MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf\r
   ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf\r
 [LibraryClasses.common.UEFI_APPLICATION]\r
   PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
   TimerLib|OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf\r
+  ResetSystemLib|OvmfPkg/Library/ResetSystemLib/DxeResetSystemLib.inf\r
   HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
   MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf\r
   ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf\r
 [LibraryClasses.common.DXE_SMM_DRIVER]\r
   PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
   TimerLib|OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf\r
+  ResetSystemLib|OvmfPkg/Library/ResetSystemLib/DxeResetSystemLib.inf\r
   MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf\r
   ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf\r
   HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
 [LibraryClasses.common.SMM_CORE]\r
   PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
   TimerLib|OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf\r
+  ResetSystemLib|OvmfPkg/Library/ResetSystemLib/DxeResetSystemLib.inf\r
   SmmCorePlatformHookLib|MdeModulePkg/Library/SmmCorePlatformHookLibNull/SmmCorePlatformHookLibNull.inf\r
   MemoryAllocationLib|MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/PiSmmCoreMemoryAllocationLib.inf\r
   ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf\r
index 3c377c6e858e43b4e3ed75dbd20f631d80019986..066f49aeaee0f1af7bf676598b586a328d03dc32 100644 (file)
 [LibraryClasses.common.DXE_RUNTIME_DRIVER]\r
   PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
   TimerLib|OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf\r
+  ResetSystemLib|OvmfPkg/Library/ResetSystemLib/DxeResetSystemLib.inf\r
   HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
   DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf\r
   MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf\r
 [LibraryClasses.common.UEFI_DRIVER]\r
   PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
   TimerLib|OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf\r
+  ResetSystemLib|OvmfPkg/Library/ResetSystemLib/DxeResetSystemLib.inf\r
   HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
   DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf\r
   MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf\r
 [LibraryClasses.common.DXE_DRIVER]\r
   PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
   TimerLib|OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf\r
+  ResetSystemLib|OvmfPkg/Library/ResetSystemLib/DxeResetSystemLib.inf\r
   HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
   MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf\r
   ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf\r
 [LibraryClasses.common.UEFI_APPLICATION]\r
   PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
   TimerLib|OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf\r
+  ResetSystemLib|OvmfPkg/Library/ResetSystemLib/DxeResetSystemLib.inf\r
   HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
   MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf\r
   ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf\r
 [LibraryClasses.common.DXE_SMM_DRIVER]\r
   PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
   TimerLib|OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf\r
+  ResetSystemLib|OvmfPkg/Library/ResetSystemLib/DxeResetSystemLib.inf\r
   MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf\r
   ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf\r
   HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
 [LibraryClasses.common.SMM_CORE]\r
   PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
   TimerLib|OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf\r
+  ResetSystemLib|OvmfPkg/Library/ResetSystemLib/DxeResetSystemLib.inf\r
   SmmCorePlatformHookLib|MdeModulePkg/Library/SmmCorePlatformHookLibNull/SmmCorePlatformHookLibNull.inf\r
   MemoryAllocationLib|MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/PiSmmCoreMemoryAllocationLib.inf\r
   ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf\r
index 701a7ccea9870c6dc7db466bc143c7a22f48c0fe..ac510522a9ff6858a008cb7d486bdb2e00e4829b 100644 (file)
 [LibraryClasses.common.DXE_RUNTIME_DRIVER]\r
   PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
   TimerLib|OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf\r
+  ResetSystemLib|OvmfPkg/Library/ResetSystemLib/DxeResetSystemLib.inf\r
   HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
   DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf\r
   MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf\r
 [LibraryClasses.common.UEFI_DRIVER]\r
   PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
   TimerLib|OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf\r
+  ResetSystemLib|OvmfPkg/Library/ResetSystemLib/DxeResetSystemLib.inf\r
   HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
   DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf\r
   MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf\r
 [LibraryClasses.common.DXE_DRIVER]\r
   PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
   TimerLib|OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf\r
+  ResetSystemLib|OvmfPkg/Library/ResetSystemLib/DxeResetSystemLib.inf\r
   HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
   MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf\r
   ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf\r
 [LibraryClasses.common.UEFI_APPLICATION]\r
   PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
   TimerLib|OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf\r
+  ResetSystemLib|OvmfPkg/Library/ResetSystemLib/DxeResetSystemLib.inf\r
   HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
   MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf\r
   ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf\r
 [LibraryClasses.common.DXE_SMM_DRIVER]\r
   PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
   TimerLib|OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf\r
+  ResetSystemLib|OvmfPkg/Library/ResetSystemLib/DxeResetSystemLib.inf\r
   MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf\r
   ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf\r
   HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
 [LibraryClasses.common.SMM_CORE]\r
   PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
   TimerLib|OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf\r
+  ResetSystemLib|OvmfPkg/Library/ResetSystemLib/DxeResetSystemLib.inf\r
   SmmCorePlatformHookLib|MdeModulePkg/Library/SmmCorePlatformHookLibNull/SmmCorePlatformHookLibNull.inf\r
   MemoryAllocationLib|MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/PiSmmCoreMemoryAllocationLib.inf\r
   ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf\r
index 86b24d1716b9b6800d4189bdc4cb3f94d2dd9e0f..f6214bd3465aad876c7370163578642d275ce27c 100644 (file)
 \r
 [LibraryClasses.common.DXE_RUNTIME_DRIVER]\r
   PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
+  ResetSystemLib|OvmfPkg/Library/ResetSystemLib/DxeResetSystemLib.inf\r
   HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
   DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf\r
   MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf\r
 \r
 [LibraryClasses.common.UEFI_DRIVER]\r
   PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
+  ResetSystemLib|OvmfPkg/Library/ResetSystemLib/DxeResetSystemLib.inf\r
   HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
   DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf\r
   MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf\r
 \r
 [LibraryClasses.common.DXE_DRIVER]\r
   PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
+  ResetSystemLib|OvmfPkg/Library/ResetSystemLib/DxeResetSystemLib.inf\r
   HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
   MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf\r
   ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf\r
 \r
 [LibraryClasses.common.UEFI_APPLICATION]\r
   PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
+  ResetSystemLib|OvmfPkg/Library/ResetSystemLib/DxeResetSystemLib.inf\r
   HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
   MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf\r
   ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf\r