diff --git a/Documentation/Patches/OVMF/0001-OvmfPkg-Jump-to-BIOS2-if-TDX-guest-is-detected.patch b/Documentation/Patches/OVMF/0001-OvmfPkg-Jump-to-BIOS2-if-TDX-guest-is-detected.patch deleted file mode 100644 index 8bdec9cb..00000000 --- a/Documentation/Patches/OVMF/0001-OvmfPkg-Jump-to-BIOS2-if-TDX-guest-is-detected.patch +++ /dev/null @@ -1,32 +0,0 @@ -From a653537c608ea3293a9d87736a6bed287b1d6039 Mon Sep 17 00:00:00 2001 -From: Peter Fang -Date: Tue, 24 Jan 2023 04:32:32 -0800 -Subject: [PATCH 1/8] OvmfPkg: Jump to BIOS2 if TDX guest is detected - -If vCPU indicates this is a TDX guest (CR0.PE is set), jump to a fixed -address (4GB - 2MB - 16), where BIOS2's entry point is expected, right -after GDT is initialized. - -TD BSP and TD APs share the same entry point, so this works for SMP boot -as well. - -Signed-off-by: Peter Fang ---- - OvmfPkg/ResetVector/Ia32/IntelTdx.asm | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/OvmfPkg/ResetVector/Ia32/IntelTdx.asm b/OvmfPkg/ResetVector/Ia32/IntelTdx.asm -index 06794baef8..fd6699d797 100644 ---- a/OvmfPkg/ResetVector/Ia32/IntelTdx.asm -+++ b/OvmfPkg/ResetVector/Ia32/IntelTdx.asm -@@ -133,6 +133,7 @@ ReloadFlat32: - mov eax, ADDR_OF(gdtr) - lgdt [eax] - -+ jmp LINEAR_CODE_SEL:dword (0x100000000 - 0x200000 - 16) - jmp LINEAR_CODE_SEL:dword ADDR_OF(jumpToFlat32BitAndLandHere) - - jumpToFlat32BitAndLandHere: --- -2.43.0 - diff --git a/Documentation/Patches/OVMF/0002-OvmfPkg-IncompatiblePciDeviceSupportDxe-Ignore-Optio.patch b/Documentation/Patches/OVMF/0002-OvmfPkg-IncompatiblePciDeviceSupportDxe-Ignore-Optio.patch deleted file mode 100644 index 1b520bca..00000000 --- a/Documentation/Patches/OVMF/0002-OvmfPkg-IncompatiblePciDeviceSupportDxe-Ignore-Optio.patch +++ /dev/null @@ -1,42 +0,0 @@ -From f8ac59b95a21f642d9c51b261b38d28f2498d65a Mon Sep 17 00:00:00 2001 -From: Peter Fang -Date: Fri, 17 Feb 2023 16:00:01 -0800 -Subject: [PATCH 2/8] OvmfPkg/IncompatiblePciDeviceSupportDxe: Ignore OptionRom - -TD-partitioned guests are unable to create page aliases in the PCI MMIO -space, rendering OptionRom to be inaccessible to the guest. Skip -OptionRom processing by applying the logic in -c477b2783f6d95b62266f4fff9b0c286ac1d7bb8 to all guest types. - -This needs to be reworked later. - -Signed-off-by: Peter Fang ---- - .../IncompatiblePciDeviceSupport.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c b/OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c -index 3a6f759882..042c347383 100644 ---- a/OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c -+++ b/OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c -@@ -205,7 +205,7 @@ CheckDevice ( - // - // In Td guest OptionRom is not allowed. - // -- if (CcProbe ()) { -+ if (CcProbe () || TRUE) { - Length += sizeof mOptionRomConfiguration; - } - -@@ -227,7 +227,7 @@ CheckDevice ( - CopyMem (Ptr, &mMmio64Configuration, sizeof mMmio64Configuration); - Length = sizeof mMmio64Configuration; - -- if (CcProbe ()) { -+ if (CcProbe () || TRUE) { - CopyMem (Ptr + Length, &mOptionRomConfiguration, sizeof mOptionRomConfiguration); - Length += sizeof mOptionRomConfiguration; - } --- -2.43.0 - diff --git a/Documentation/Patches/OVMF/0005-OvmfPkg-Workarounds-for-TDP.patch b/Documentation/Patches/OVMF/0005-OvmfPkg-Workarounds-for-TDP.patch deleted file mode 100644 index 7739de3d..00000000 --- a/Documentation/Patches/OVMF/0005-OvmfPkg-Workarounds-for-TDP.patch +++ /dev/null @@ -1,78 +0,0 @@ -From 3d2c6d683e51a913db7f4c1e964dd0bc3fd4eab9 Mon Sep 17 00:00:00 2001 -From: Peter Fang -Date: Thu, 2 Mar 2023 02:11:59 -0800 -Subject: [PATCH 5/8] OvmfPkg: Workarounds for TDP - -Due to the lack of support for TD HOB and TdxDxe in TDP, work around -them for now and fix them later. - -Signed-off-by: Peter Fang ---- - .../BaseMemEncryptTdxLib/MemoryEncryption.c | 20 ++++++++----------- - OvmfPkg/PlatformPei/MemDetect.c | 2 +- - OvmfPkg/TdxDxe/TdxDxe.c | 2 +- - 3 files changed, 10 insertions(+), 14 deletions(-) - -diff --git a/OvmfPkg/Library/BaseMemEncryptTdxLib/MemoryEncryption.c b/OvmfPkg/Library/BaseMemEncryptTdxLib/MemoryEncryption.c -index a71b1efbca..620a679e05 100644 ---- a/OvmfPkg/Library/BaseMemEncryptTdxLib/MemoryEncryption.c -+++ b/OvmfPkg/Library/BaseMemEncryptTdxLib/MemoryEncryption.c -@@ -587,21 +587,17 @@ SetOrClearSharedBit ( - } - - // -- // If changing shared to private, must accept-page again -+ // If changing shared to private, must accept-page again if needed - // - if (Mode == ClearSharedBit) { - Status = gBS->LocateProtocol (&gEdkiiMemoryAcceptProtocolGuid, NULL, (VOID **)&MemoryAcceptProtocol); -- if (EFI_ERROR (Status)) { -- DEBUG ((DEBUG_ERROR, "%a: Failed to locate MemoryAcceptProtocol with %r\n", __func__, Status)); -- ASSERT (FALSE); -- return Status; -- } -- -- Status = MemoryAcceptProtocol->AcceptMemory (MemoryAcceptProtocol, PhysicalAddress, Length); -- if (EFI_ERROR (Status)) { -- DEBUG ((DEBUG_ERROR, "%a: Failed to AcceptMemory with %r\n", __func__, Status)); -- ASSERT (FALSE); -- return Status; -+ if (!EFI_ERROR (Status)) { -+ Status = MemoryAcceptProtocol->AcceptMemory (MemoryAcceptProtocol, PhysicalAddress, Length); -+ if (EFI_ERROR (Status)) { -+ DEBUG ((DEBUG_ERROR, "%a: Failed to AcceptMemory with %r\n", __func__, Status)); -+ ASSERT (FALSE); -+ return Status; -+ } - } - } - -diff --git a/OvmfPkg/PlatformPei/MemDetect.c b/OvmfPkg/PlatformPei/MemDetect.c -index 493cb1fbeb..518a2693f9 100644 ---- a/OvmfPkg/PlatformPei/MemDetect.c -+++ b/OvmfPkg/PlatformPei/MemDetect.c -@@ -349,7 +349,7 @@ InitializeRamRegions ( - IN EFI_HOB_PLATFORM_INFO *PlatformInfoHob - ) - { -- if (TdIsEnabled ()) { -+ if (TdIsEnabled () && !TdpIsEnabled ()) { - PlatformTdxPublishRamRegions (); - return; - } -diff --git a/OvmfPkg/TdxDxe/TdxDxe.c b/OvmfPkg/TdxDxe/TdxDxe.c -index 30732f421b..f150d08cd6 100644 ---- a/OvmfPkg/TdxDxe/TdxDxe.c -+++ b/OvmfPkg/TdxDxe/TdxDxe.c -@@ -341,7 +341,7 @@ TdxDxeEntryPoint ( - SetPcdSettings (PlatformInfo); - #endif - -- if (!TdIsEnabled ()) { -+ if (!TdIsEnabled () || TdpIsEnabled ()) { - // - // If it is Non-Td guest, we install gEfiMpInitLibMpDepProtocolGuid so that - // MpInitLib will be used in CpuDxe driver. --- -2.43.0 -