From 80c26e9880235cb5fe0a4c2ec8f5d68eb7334d12 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 d313925a226c1..2da4907af341d 100644 --- a/OvmfPkg/Library/PlatformInitLib/MemDetect.c +++ b/OvmfPkg/Library/PlatformInitLib/MemDetect.c @@ -801,7 +801,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__)); }