Skip to content

Commit

Permalink
mshv-bindings: implement send/sync for svm_ghcb_base
Browse files Browse the repository at this point in the history
Signed-off-by: Muminul Islam <[email protected]>
  • Loading branch information
russell-islam committed Nov 11, 2024
1 parent ee82748 commit 55f39dc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mshv-bindings/src/x86_64/snp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,12 @@ pub struct svm_ghcb_base {
pub shared: [__u64; 254usize],
}

// SAFETY: struct is based on GHCB page in the hypervisor,
// safe to send/sync across threads
unsafe impl Send for svm_ghcb_base {}
// SAFETY: see above
unsafe impl Sync for svm_ghcb_base {}

#[test]
fn bindgen_test_layout_svm_ghcb_base() {
const UNINIT: ::std::mem::MaybeUninit<svm_ghcb_base> = ::std::mem::MaybeUninit::uninit();
Expand Down

0 comments on commit 55f39dc

Please sign in to comment.