public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Min Xu" <min.m.xu@intel.com>
To: devel@edk2.groups.io
Cc: Min Xu <min.m.xu@intel.com>, Erdem Aktas <erdemaktas@google.com>,
	Gerd Hoffmann <kraxel@redhat.com>,
	James Bottomley <jejb@linux.ibm.com>,
	Jiewen Yao <jiewen.yao@intel.com>,
	Tom Lendacky <thomas.lendacky@amd.com>
Subject: [PATCH 1/2] OvmfPkg: Fix TDVMCALL error in ApRunLoop.nasm
Date: Tue, 31 May 2022 22:31:16 +0800	[thread overview]
Message-ID: <7afc1c0752f09c2c53ff5b2c78c3e064838f3778.1654007213.git.min.m.xu@intel.com> (raw)
In-Reply-To: <cover.1654007213.git.min.m.xu@intel.com>

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


  reply	other threads:[~2022-05-31 14:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-31 14:31 [PATCH 0/2] Fix 2 issues in TDVF Min Xu
2022-05-31 14:31 ` Min Xu [this message]
2022-06-01  8:49   ` [PATCH 1/2] OvmfPkg: Fix TDVMCALL error in ApRunLoop.nasm Gerd Hoffmann
2022-05-31 14:31 ` [PATCH 2/2] OvmfPkg: Search EFI_RESOURCE_MEMORY_UNACCEPTED for Fw hoblist Min Xu
2022-06-01  8:53   ` [edk2-devel] " Gerd Hoffmann
2022-06-02  8:47 ` [PATCH 0/2] Fix 2 issues in TDVF Yao, Jiewen
     [not found] ` <16F4C173DC6EFECF.9239@groups.io>
2022-06-02  9:12   ` [edk2-devel] " Yao, Jiewen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7afc1c0752f09c2c53ff5b2c78c3e064838f3778.1654007213.git.min.m.xu@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox