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>
This commit is contained in:
Anthony PERARD 2019-08-13 12:31:01 +01:00 committed by Laszlo Ersek
parent 68f4599dfc
commit 80b619d5c4
2 changed files with 10 additions and 0 deletions

View File

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

View File

@ -59,6 +59,7 @@
MtrrLib MtrrLib
MemEncryptSevLib MemEncryptSevLib
PcdLib PcdLib
XenHypercallLib
[Pcd] [Pcd]
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvBase gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvBase