From 1a1f653c965ddd2aeb788b99b5fbf1689c148560 Mon Sep 17 00:00:00 2001 From: Ceping Sun Date: Thu, 9 May 2024 05:40:35 +0800 Subject: [PATCH] OvmfPkg/PlatformInitLib: Disable PlatformReservationConflictCB in TDVF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently, PlatformReservationConflictCB have comments “This happens on (virtual) AMD machines with 1TB address space, because the AMD IOMMU uses an address window just below 1TB.” Based on the comments, it should not be invoked in TDVF. Cc: Erdem Aktas Cc: Jiewen Yao Cc: Min Xu Cc: Gerd Hoffmann Cc: Elena Reshetova Signed-off-by: Ceping Sun --- OvmfPkg/Library/PlatformInitLib/MemDetect.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/OvmfPkg/Library/PlatformInitLib/MemDetect.c b/OvmfPkg/Library/PlatformInitLib/MemDetect.c index ad9d097b3f6f..664c0053551a 100644 --- a/OvmfPkg/Library/PlatformInitLib/MemDetect.c +++ b/OvmfPkg/Library/PlatformInitLib/MemDetect.c @@ -790,7 +790,10 @@ PlatformDynamicMmioWindow ( DEBUG ((DEBUG_INFO, "%a: MMIO Space 0x%Lx (%Ld GB)\n", __func__, MmioSpace, RShiftU64 (MmioSpace, 30))); PlatformInfoHob->PcdPciMmio64Size = MmioSpace; PlatformInfoHob->PcdPciMmio64Base = AddrSpace - MmioSpace; - PlatformScanE820 (PlatformReservationConflictCB, PlatformInfoHob); + + if (!TdIsEnabled ()) { + PlatformScanE820 (PlatformReservationConflictCB, PlatformInfoHob); + } } else { DEBUG ((DEBUG_INFO, "%a: using classic mmio window\n", __func__)); }