diff options
author | Sebastien Boeuf <sebastien.boeuf@intel.com> | 2021-12-10 22:41:54 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-12-11 14:26:05 +0000 |
commit | 9afcd48a94e85586bc8ea61f2fba21476e716ca1 (patch) | |
tree | 69515dad78f5ed295dd150269e941f2b91239fb0 /OvmfPkg/PlatformPei | |
parent | e81a81e5846edcc4c2e91cf3a39d0ba8c31b687a (diff) | |
download | edk2-9afcd48a94e85586bc8ea61f2fba21476e716ca1.tar.gz edk2-9afcd48a94e85586bc8ea61f2fba21476e716ca1.tar.bz2 edk2-9afcd48a94e85586bc8ea61f2fba21476e716ca1.zip |
OvmfPkg: Handle Cloud Hypervisor host bridge
Handle things differently when the detected host bridge matches the
Cloud Hypervisor PCI host bridge identifier.
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
Diffstat (limited to 'OvmfPkg/PlatformPei')
-rw-r--r-- | OvmfPkg/PlatformPei/MemDetect.c | 9 | ||||
-rw-r--r-- | OvmfPkg/PlatformPei/Platform.c | 8 |
2 files changed, 16 insertions, 1 deletions
diff --git a/OvmfPkg/PlatformPei/MemDetect.c b/OvmfPkg/PlatformPei/MemDetect.c index 738ed0c208..934d5c1965 100644 --- a/OvmfPkg/PlatformPei/MemDetect.c +++ b/OvmfPkg/PlatformPei/MemDetect.c @@ -16,6 +16,7 @@ Module Name: #include <IndustryStandard/E820.h>
#include <IndustryStandard/I440FxPiix4.h>
#include <IndustryStandard/Q35MchIch9.h>
+#include <IndustryStandard/CloudHv.h>
#include <PiPei.h>
#include <Register/Intel/SmramSaveStateMap.h>
@@ -159,6 +160,12 @@ QemuUc32BaseInitialization ( return;
}
+ if (mHostBridgeDevId == CLOUDHV_DEVICE_ID) {
+ Uc32Size = CLOUDHV_MMIO_HOLE_SIZE;
+ mQemuUc32Base = CLOUDHV_MMIO_HOLE_ADDRESS;
+ return;
+ }
+
ASSERT (mHostBridgeDevId == INTEL_82441_DEVICE_ID);
//
// On i440fx, start with the [LowerMemorySize, 4GB) range. Make sure one
@@ -819,7 +826,7 @@ QemuInitializeRam ( // practically any alignment, and we may not have enough variable MTRRs to
// cover it exactly.
//
- if (IsMtrrSupported ()) {
+ if (IsMtrrSupported () && (mHostBridgeDevId != CLOUDHV_DEVICE_ID)) {
MtrrGetAllMtrrs (&MtrrSettings);
//
diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c index 3000176efd..906f64615d 100644 --- a/OvmfPkg/PlatformPei/Platform.c +++ b/OvmfPkg/PlatformPei/Platform.c @@ -374,6 +374,14 @@ MiscInitialization ( );
ASSERT_RETURN_ERROR (PcdStatus);
return;
+ 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;
default:
DEBUG ((
DEBUG_ERROR,
|