Skip to content

Commit

Permalink
OvmfPkg/TdxDxe: Clear GPR Mask for RBX
Browse files Browse the repository at this point in the history
Refer to intel-tdx-module-api spec section 5.5.21, GPR mask
(TDVMCALL_EXPOSE_REGS_MASK) is a bitmap that controls which
part of the guest TD GPR and XMM state is passed as-is to
the VMM and back.
- A bit value of 0 indicates that the corresponding register
   is saved by the Intel TDX module and not passed as-is to
   Host VMM.
- A bit value of 1 indicates that the corresponding register
   is passed as-is to the host VMM.

Currently, RBX is used as the mailbox address in ApRunLoop.nasm,
the corresponding bit value of RBX in MASK(Bit 3) is set as 1 which
means the value is passed to Host VMM as-is and it can be changed by
Host VMM.

So the bitmask shall be set as 0 to avoid this situation.

Reference:
[TDX-API]: intel-tdx-module-abi-spec
https://cdrdv2.intel.com/v1/dl/getContent/733579

Cc: Erdem Aktas <[email protected]>
Cc: Jiewen Yao <[email protected]>
Cc: Min Xu <[email protected]>
Cc: Gerd Hoffmann <[email protected]>
Cc: Hunter Adrian <[email protected]>
Signed-off-by: Ceping Sun <[email protected]>
  • Loading branch information
sunceping authored and mergify[bot] committed Dec 13, 2024
1 parent 3022bab commit c1eb477
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion OvmfPkg/TdxDxe/X64/ApRunLoop.nasm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ SECTION .text

BITS 64

%define TDVMCALL_EXPOSE_REGS_MASK 0xffcc
%define TDVMCALL_EXPOSE_REGS_MASK 0xffc4
%define TDVMCALL 0x0
%define EXIT_REASON_CPUID 0xa

Expand Down

0 comments on commit c1eb477

Please sign in to comment.