summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCeping Sun <cepingx.sun@intel.com>2023-11-08 19:38:25 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-11-09 17:15:39 +0000
commit68e37f457881d222c68834920f4ffd6f668a2b77 (patch)
treeeaba28d909122837272db7b9edef44583fd3a676
parent616f0d503707c2e3fbdbc397ccb16a822f584b03 (diff)
downloadedk2-68e37f457881d222c68834920f4ffd6f668a2b77.tar.gz
edk2-68e37f457881d222c68834920f4ffd6f668a2b77.tar.bz2
edk2-68e37f457881d222c68834920f4ffd6f668a2b77.zip
MdePkg/BaseLib: Update TdVmcall to always output the value in R11
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4572 According to section 3.2 of the [GHCI] spec, if the return status of MapGPA is "TDG.VP.VMCALL_RETRY", TD must retry this operation for the pages in the region starting at the GPA specified in R11. Currently, TDVF has not handled the retry results and always clears the R11 on unsuccessful return status. For this, the TdVmcall needs to output the value of R11 on unsuccessful return status to handle the retry results of MapGPA. Reference: [GHCI]: TDX Guest-Host-Communication Interface v1.0 https://cdrdv2.intel.com/v1/dl/getContent/726790 Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Erdem Aktas <erdemaktas@google.com> Cc: James Bottomley <jejb@linux.ibm.com> Cc: Min Xu <min.m.xu@intel.com> Cc: Tom Lendacky <thomas.lendacky@amd.com> Cc: Michael Roth <michael.roth@amd.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Ceping Sun <cepingx.sun@intel.com>
-rw-r--r--MdePkg/Library/BaseLib/X64/TdVmcall.nasm4
1 files changed, 1 insertions, 3 deletions
diff --git a/MdePkg/Library/BaseLib/X64/TdVmcall.nasm b/MdePkg/Library/BaseLib/X64/TdVmcall.nasm
index 5ecc10b171..8dd9bfcbfa 100644
--- a/MdePkg/Library/BaseLib/X64/TdVmcall.nasm
+++ b/MdePkg/Library/BaseLib/X64/TdVmcall.nasm
@@ -133,9 +133,7 @@ ASM_PFX(TdVmCall):
test r9, r9
jz .no_return_data
- ; On success, propagate TDVMCALL output value to output param
- test rax, rax
- jnz .no_return_data
+ ; Propagate TDVMCALL output value to output param
mov [r9], r11
.no_return_data:
tdcall_regs_postamble