]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg: TdxDxe: Fix AsmRelocateApMailBoxLoop
authorIsaku Yamahata <isaku.yamahata@intel.com>
Tue, 24 May 2022 07:53:46 +0000 (15:53 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 25 May 2022 12:34:46 +0000 (12:34 +0000)
In TDX, Application Processor busy-loops on Mailbox for OS to issue
MpProtectedModeWakeupCommandWakeup command to UEFI.  As the AP acking to
it, it clears the command member according to ACPI spec 6.4, 5.2.12.19
Multiprocessor Wakeup Structure: "The application processor need clear the
command to Noop(0) as the acknowledgement that the command is received."
However, AsmRelocateApMailBoxLoop wrongly clears WakeupVector.  Correctly
clear command instead of WakeupVector.

Without this patch, TD guest kernel fails to boot APs.

Fixes: fae5c1464d ("OvmfPkg: Add TdxDxe driver")
Cc: Min Xu <min.m.xu@intel.com>
Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Min Xu <min.m.xu@intel.com>
OvmfPkg/TdxDxe/X64/ApRunLoop.nasm

index 49bd04415cfded083e7ef96dd95203398e6105c1..a859375fb81968bdf1e48b0a4af63b1bbe3c051d 100644 (file)
@@ -69,7 +69,7 @@ MailBoxWakeUp:
     mov        rax, [rbx + WakeupVectorOffset]\r
     ; OS sends a wakeup command for a given APIC ID, firmware is supposed to reset\r
     ; the command field back to zero as acknowledgement.\r
-    mov        qword [rbx + WakeupVectorOffset], 0\r
+    mov        qword [rbx + CommandOffset], 0\r
     jmp        rax\r
 MailBoxSleep:\r
     jmp       $\r