Skip to content

Commit

Permalink
tdx-tdcall: use shared GPA for TDG.VP.VMCALL<Service>
Browse files Browse the repository at this point in the history
Address of command and response buffer should be shared GPA according to
GHCI.

Signed-off-by: Jiaqi Gao <[email protected]>
  • Loading branch information
gaojiaqi7 authored and jyao1 committed Apr 10, 2023
1 parent 93c2e83 commit 10568ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tdx-tdcall/src/tdx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,8 @@ pub fn tdvmcall_service(
interrupt: u64,
wait_time: u64,
) -> Result<(), TdVmcallError> {
let command = command.as_ptr() as u64;
let response = response.as_mut_ptr() as u64;
let command = command.as_ptr() as u64 | *SHARED_MASK;
let response = response.as_mut_ptr() as u64 | *SHARED_MASK;

// Ensure the address is aligned to 4K bytes
if (command & 0xfff) != 0 || (response & 0xfff) != 0 {
Expand Down

0 comments on commit 10568ba

Please sign in to comment.