Skip to content

Commit 68e37f4

Browse files
suncepingmergify[bot]
authored andcommitted
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>
1 parent 616f0d5 commit 68e37f4

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

MdePkg/Library/BaseLib/X64/TdVmcall.nasm

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,7 @@ ASM_PFX(TdVmCall):
133133
test r9, r9
134134
jz .no_return_data
135135

136-
; On success, propagate TDVMCALL output value to output param
137-
test rax, rax
138-
jnz .no_return_data
136+
; Propagate TDVMCALL output value to output param
139137
mov [r9], r11
140138
.no_return_data:
141139
tdcall_regs_postamble

0 commit comments

Comments
 (0)