From bf25f27e0021ae1f37184fa8fc76382599e23012 Mon Sep 17 00:00:00 2001 From: Sebastien Boeuf Date: Tue, 10 May 2022 20:50:46 +0800 Subject: [PATCH] OvmfPkg: Don't access A20 gate register on Cloud Hypervisor Since Cloud Hypervisor doesn't emulate an A20 gate register on I/O port 0x92, it's better to avoid accessing it when the platform is identified as Cloud Hypervisor. Signed-off-by: Sebastien Boeuf Acked-by: Jiewen Yao --- OvmfPkg/Library/PlatformInitLib/Platform.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OvmfPkg/Library/PlatformInitLib/Platform.c b/OvmfPkg/Library/PlatformInitLib/Platform.c index ee802fd684..c3d34e43af 100644 --- a/OvmfPkg/Library/PlatformInitLib/Platform.c +++ b/OvmfPkg/Library/PlatformInitLib/Platform.c @@ -314,7 +314,9 @@ PlatformMiscInitialization ( // // Disable A20 Mask // - IoOr8 (0x92, BIT1); + if (PlatformInfoHob->HostBridgeDevId != CLOUDHV_DEVICE_ID) { + IoOr8 (0x92, BIT1); + } // // Build the CPU HOB with guest RAM size dependent address width and 16-bits -- 2.39.2