From 043eab84e5adb2013c9623ce44f44f6a7ef8e037 Mon Sep 17 00:00:00 2001 From: Jason Andryuk Date: Thu, 11 Apr 2024 16:25:30 -0400 Subject: 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 --- OvmfPkg/XenPlatformPei/Xen.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'OvmfPkg/XenPlatformPei') diff --git a/OvmfPkg/XenPlatformPei/Xen.c b/OvmfPkg/XenPlatformPei/Xen.c index 7f00eef11e..a54fd55c70 100644 --- a/OvmfPkg/XenPlatformPei/Xen.c +++ b/OvmfPkg/XenPlatformPei/Xen.c @@ -128,9 +128,6 @@ EFI_STATUS XenConnect ( ) { - UINT32 Index; - UINT32 TransferReg; - UINT32 TransferPages; UINT32 XenVersion; EFI_XEN_OVMF_INFO *Info; CHAR8 Sig[sizeof (Info->Signature) + 1]; @@ -139,24 +136,6 @@ XenConnect ( 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 // @@ -283,7 +262,7 @@ XenPvhDetected ( // // This function should only be used after XenConnect // - ASSERT (mXenInfo.HyperPages != NULL); + ASSERT (mXenInfo.VersionMajor); return mXenHvmloaderInfo == NULL; } -- cgit v1.2.3