OvmfPkg/XenPlatformPei: Remove Hypercall Page

XenHypercallLib now makes direct hypercalls, so HyperPages is
unnecessary and can be removed.

Change the XenPvhDetected() ASSERT to use the Xen version.  That has
never been 0, AFAIK.

Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
This commit is contained in:
Jason Andryuk 2024-04-11 16:25:30 -04:00 committed by mergify[bot]
parent 0e6f6c715c
commit 043eab84e5
2 changed files with 1 additions and 26 deletions

View File

@ -13,10 +13,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
{ 0xd3b46f3b, 0xd441, 0x1244, {0x9a, 0x12, 0x0, 0x12, 0x27, 0x3f, 0xc1, 0x4d } } { 0xd3b46f3b, 0xd441, 0x1244, {0x9a, 0x12, 0x0, 0x12, 0x27, 0x3f, 0xc1, 0x4d } }
typedef struct { typedef struct {
///
/// Beginning of the hypercall page.
///
VOID *HyperPages;
/// ///
/// Hypervisor major version. /// Hypervisor major version.
/// ///

View File

@ -128,9 +128,6 @@ EFI_STATUS
XenConnect ( XenConnect (
) )
{ {
UINT32 Index;
UINT32 TransferReg;
UINT32 TransferPages;
UINT32 XenVersion; UINT32 XenVersion;
EFI_XEN_OVMF_INFO *Info; EFI_XEN_OVMF_INFO *Info;
CHAR8 Sig[sizeof (Info->Signature) + 1]; CHAR8 Sig[sizeof (Info->Signature) + 1];
@ -139,24 +136,6 @@ XenConnect (
ASSERT (mXenLeaf != 0); ASSERT (mXenLeaf != 0);
//
// Prepare HyperPages to be able to make hypercalls
//
AsmCpuid (mXenLeaf + 2, &TransferPages, &TransferReg, NULL, NULL);
mXenInfo.HyperPages = AllocatePages (TransferPages);
if (!mXenInfo.HyperPages) {
return EFI_OUT_OF_RESOURCES;
}
for (Index = 0; Index < TransferPages; Index++) {
AsmWriteMsr64 (
TransferReg,
(UINTN)mXenInfo.HyperPages +
(Index << EFI_PAGE_SHIFT) + Index
);
}
// //
// Find out the Xen version // Find out the Xen version
// //
@ -283,7 +262,7 @@ XenPvhDetected (
// //
// This function should only be used after XenConnect // This function should only be used after XenConnect
// //
ASSERT (mXenInfo.HyperPages != NULL); ASSERT (mXenInfo.VersionMajor);
return mXenHvmloaderInfo == NULL; return mXenHvmloaderInfo == NULL;
} }