From 6d2ce5fd5ccdee1de7d28439a348692869011a2d Mon Sep 17 00:00:00 2001 From: Min Xu Date: Sun, 6 Mar 2022 20:09:00 +0800 Subject: [PATCH] OvmfPkg/PlatformPei: Refactor MiscInitialization for CloudHV BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3863 Refactor MiscInitialization for CloudHV to set PCD as other platforms do. Because in the following patch we will split the functions which set PCDs into two, one for PlatformInitLib, one for PlatformPei. Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Brijesh Singh Cc: Erdem Aktas Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Cc: Gerd Hoffmann Cc: Sebastien Boeuf Acked-by: Gerd Hoffmann Reviewed-by: Jiewen Yao Signed-off-by: Min Xu --- OvmfPkg/PlatformPei/Platform.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c index af9e72cd7a..3e0c56db57 100644 --- a/OvmfPkg/PlatformPei/Platform.c +++ b/OvmfPkg/PlatformPei/Platform.c @@ -380,13 +380,7 @@ MiscInitialization ( AcpiEnBit = ICH9_ACPI_CNTL_ACPI_EN; break; case CLOUDHV_DEVICE_ID: - DEBUG ((DEBUG_INFO, "%a: Cloud Hypervisor host bridge\n", __FUNCTION__)); - PcdStatus = PcdSet16S ( - PcdOvmfHostBridgePciDevId, - CLOUDHV_DEVICE_ID - ); - ASSERT_RETURN_ERROR (PcdStatus); - return; + break; default: DEBUG (( DEBUG_ERROR, @@ -401,6 +395,11 @@ MiscInitialization ( PcdStatus = PcdSet16S (PcdOvmfHostBridgePciDevId, PlatformInfoHob->HostBridgeDevId); ASSERT_RETURN_ERROR (PcdStatus); + if (PlatformInfoHob->HostBridgeDevId == CLOUDHV_DEVICE_ID) { + DEBUG ((DEBUG_INFO, "%a: Cloud Hypervisor is done.\n", __FUNCTION__)); + return; + } + // // If the appropriate IOspace enable bit is set, assume the ACPI PMBA has // been configured and skip the setup here. This matches the logic in