mirror of
				https://gitlab.com/qemu-project/edk2.git
				synced 2025-10-30 07:56:39 +08:00 
			
		
		
		
	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
					Jason Andryuk
				
			
				
					committed by
					
						![mergify[bot]](/assets/img/avatar_default.png) mergify[bot]
						mergify[bot]
					
				
			
			
				
	
			
			
			![mergify[bot]](/assets/img/avatar_default.png) mergify[bot]
						mergify[bot]
					
				
			
						parent
						
							0e6f6c715c
						
					
				
				
					commit
					043eab84e5
				
			| @ -13,10 +13,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent | ||||
|     { 0xd3b46f3b, 0xd441, 0x1244, {0x9a, 0x12, 0x0, 0x12, 0x27, 0x3f, 0xc1, 0x4d } } | ||||
|  | ||||
| typedef struct { | ||||
|   /// | ||||
|   /// Beginning of the hypercall page. | ||||
|   /// | ||||
|   VOID      *HyperPages; | ||||
|   /// | ||||
|   /// Hypervisor major version. | ||||
|   /// | ||||
|  | ||||
| @ -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; | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user