From 54cd0d9b2f816fe519afffe2aa57cfbf13f56088 Mon Sep 17 00:00:00 2001 From: Min Xu Date: Tue, 31 May 2022 22:31:16 +0800 Subject: OvmfPkg: Fix TDVMCALL error in ApRunLoop.nasm According to GHCI Spec Table 2-1, in TDVMCALL R10 should be cleared to 0 in input operands, and be checked for the return result. https://cdrdv2.intel.com/v1/dl/getContent/726790 Cc: Erdem Aktas Cc: Gerd Hoffmann Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Signed-off-by: Min Xu Reviewed-by: Jiewen Yao Acked-by: Gerd Hoffmann --- OvmfPkg/TdxDxe/X64/ApRunLoop.nasm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OvmfPkg/TdxDxe/X64/ApRunLoop.nasm b/OvmfPkg/TdxDxe/X64/ApRunLoop.nasm index 52fb3b4944..0bef89c485 100644 --- a/OvmfPkg/TdxDxe/X64/ApRunLoop.nasm +++ b/OvmfPkg/TdxDxe/X64/ApRunLoop.nasm @@ -42,10 +42,11 @@ AsmRelocateApMailBoxLoopStart: mov rax, TDVMCALL mov rcx, TDVMCALL_EXPOSE_REGS_MASK + xor r10, r10 mov r11, EXIT_REASON_CPUID mov r12, 0xb tdcall - test rax, rax + test r10, r10 jnz Panic mov r8, r15 -- cgit v1.2.3