]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg/XenPlatformPei: Reinit XenHypercallLib
authorAnthony PERARD <anthony.perard@citrix.com>
Tue, 13 Aug 2019 11:31:01 +0000 (12:31 +0100)
committerLaszlo Ersek <lersek@redhat.com>
Wed, 21 Aug 2019 16:03:49 +0000 (18:03 +0200)
The XenPlatformPei needs to make hypercalls, but the XenHypercallLib was
initialised before the HyperPage was ready. Now that XenPlatformPei has
initialised the HyperPage, reinitialise the XenHypercallLib.

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1689
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20190813113119.14804-18-anthony.perard@citrix.com>

OvmfPkg/XenPlatformPei/Xen.c
OvmfPkg/XenPlatformPei/XenPlatformPei.inf

index b366139a0af08449951ef6220d5f747aa2348b6d..c67f4c96973603ee445f9f09214f8cff7d91aaad 100644 (file)
@@ -26,6 +26,7 @@
 #include <Library/ResourcePublicationLib.h>\r
 #include <Library/MtrrLib.h>\r
 #include <IndustryStandard/Xen/arch-x86/hvm/start_info.h>\r
+#include <Library/XenHypercallLib.h>\r
 \r
 #include "Platform.h"\r
 #include "Xen.h"\r
@@ -88,6 +89,7 @@ XenConnect (
   EFI_XEN_OVMF_INFO *Info;\r
   CHAR8 Sig[sizeof (Info->Signature) + 1];\r
   UINT32 *PVHResetVectorData;\r
+  RETURN_STATUS Status;\r
 \r
   AsmCpuid (XenLeaf + 2, &TransferPages, &TransferReg, NULL, NULL);\r
   mXenInfo.HyperPages = AllocatePages (TransferPages);\r
@@ -152,6 +154,13 @@ XenConnect (
     sizeof(mXenInfo)\r
     );\r
 \r
+  //\r
+  // Initialize the XenHypercall library, now that the XenInfo HOB is\r
+  // available\r
+  //\r
+  Status = XenHypercallLibInit ();\r
+  ASSERT_RETURN_ERROR (Status);\r
+\r
   return EFI_SUCCESS;\r
 }\r
 \r
index 4d00206d09d2b57717ba3a2ce86fb1e5b0c64215..0ef77db92c03027592769d1abe7a436a07057998 100644 (file)
@@ -59,6 +59,7 @@
   MtrrLib\r
   MemEncryptSevLib\r
   PcdLib\r
+  XenHypercallLib\r
 \r
 [Pcd]\r
   gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvBase\r