[edk2-devel] [PATCH 1/2] OvmfPkg: Fix TDVMCALL error in ApRunLoop.nasm

Min Xu posted 2 patches 3 years, 8 months ago
[edk2-devel] [PATCH 1/2] OvmfPkg: Fix TDVMCALL error in ApRunLoop.nasm
Posted by Min Xu 3 years, 8 months ago
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 <erdemaktas@google.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: James Bottomley <jejb@linux.ibm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Min Xu <min.m.xu@intel.com>
---
 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 52fb3b4944bf..0bef89c48552 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
 
-- 
2.29.2.windows.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#90106): https://edk2.groups.io/g/devel/message/90106
Mute This Topic: https://groups.io/mt/91452353/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 1/2] OvmfPkg: Fix TDVMCALL error in ApRunLoop.nasm
Posted by Gerd Hoffmann 3 years, 8 months ago
On Tue, May 31, 2022 at 10:31:16PM +0800, Min Xu wrote:
> 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 <erdemaktas@google.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: James Bottomley <jejb@linux.ibm.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Tom Lendacky <thomas.lendacky@amd.com>
> Signed-off-by: Min Xu <min.m.xu@intel.com>

Acked-by: Gerd Hoffmann <kraxel@redhat.com>



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#90123): https://edk2.groups.io/g/devel/message/90123
Mute This Topic: https://groups.io/mt/91452353/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-