summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/XenPlatformPei
diff options
context:
space:
mode:
authorAnthony PERARD <anthony.perard@citrix.com>2019-08-13 12:31:01 +0100
committerLaszlo Ersek <lersek@redhat.com>2019-08-21 18:03:49 +0200
commit80b619d5c456c286e58b122690ff254aeca7f12c (patch)
treefc2cd819fadef0886ab66e1c2d0333b199f76f15 /OvmfPkg/XenPlatformPei
parent68f4599dfc6ae841308e3fbce9121cbd311994f3 (diff)
downloadedk2-80b619d5c456c286e58b122690ff254aeca7f12c.tar.gz
edk2-80b619d5c456c286e58b122690ff254aeca7f12c.tar.bz2
edk2-80b619d5c456c286e58b122690ff254aeca7f12c.zip
OvmfPkg/XenPlatformPei: Reinit XenHypercallLib
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>
Diffstat (limited to 'OvmfPkg/XenPlatformPei')
-rw-r--r--OvmfPkg/XenPlatformPei/Xen.c9
-rw-r--r--OvmfPkg/XenPlatformPei/XenPlatformPei.inf1
2 files changed, 10 insertions, 0 deletions
diff --git a/OvmfPkg/XenPlatformPei/Xen.c b/OvmfPkg/XenPlatformPei/Xen.c
index b366139a0a..c67f4c9697 100644
--- a/OvmfPkg/XenPlatformPei/Xen.c
+++ b/OvmfPkg/XenPlatformPei/Xen.c
@@ -26,6 +26,7 @@
#include <Library/ResourcePublicationLib.h>
#include <Library/MtrrLib.h>
#include <IndustryStandard/Xen/arch-x86/hvm/start_info.h>
+#include <Library/XenHypercallLib.h>
#include "Platform.h"
#include "Xen.h"
@@ -88,6 +89,7 @@ XenConnect (
EFI_XEN_OVMF_INFO *Info;
CHAR8 Sig[sizeof (Info->Signature) + 1];
UINT32 *PVHResetVectorData;
+ RETURN_STATUS Status;
AsmCpuid (XenLeaf + 2, &TransferPages, &TransferReg, NULL, NULL);
mXenInfo.HyperPages = AllocatePages (TransferPages);
@@ -152,6 +154,13 @@ XenConnect (
sizeof(mXenInfo)
);
+ //
+ // Initialize the XenHypercall library, now that the XenInfo HOB is
+ // available
+ //
+ Status = XenHypercallLibInit ();
+ ASSERT_RETURN_ERROR (Status);
+
return EFI_SUCCESS;
}
diff --git a/OvmfPkg/XenPlatformPei/XenPlatformPei.inf b/OvmfPkg/XenPlatformPei/XenPlatformPei.inf
index 4d00206d09..0ef77db92c 100644
--- a/OvmfPkg/XenPlatformPei/XenPlatformPei.inf
+++ b/OvmfPkg/XenPlatformPei/XenPlatformPei.inf
@@ -59,6 +59,7 @@
MtrrLib
MemEncryptSevLib
PcdLib
+ XenHypercallLib
[Pcd]
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvBase