Skip to content

Commit b868390

Browse files
committed
few more defs
1 parent 14b91c8 commit b868390

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

vm/hv1/hvdef/src/lib.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3632,6 +3632,16 @@ pub struct HvX64RegisterSevControl {
36323632
pub vmsa_gpa_page_number: u64,
36333633
}
36343634

3635+
#[bitfield(u64)]
3636+
#[derive(IntoBytes, Immutable, KnownLayout, FromBytes)]
3637+
pub struct HvX64RegisterSevAvic {
3638+
pub enable_secure_apic: bool,
3639+
#[bits(11)]
3640+
_rsvd1: u64,
3641+
#[bits(52)]
3642+
pub avic_gpa_page_number: u64,
3643+
}
3644+
36353645
#[bitfield(u64)]
36363646
#[derive(IntoBytes, Immutable, KnownLayout, FromBytes)]
36373647
pub struct HvRegisterReferenceTsc {

vm/x86/x86defs/src/snp.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,20 @@ pub struct SevNpfInfo {
206206
rsvd38_63: u64,
207207
}
208208

209+
/// SEV secure AVIC control register
210+
#[bitfield(u64)]
211+
#[derive(IntoBytes, Immutable, KnownLayout, FromBytes, PartialEq, Eq)]
212+
pub struct SecureAvicControl {
213+
#[bits(1)]
214+
pub secure_avic_en: u64,
215+
#[bits(1)]
216+
pub allowed_nmi: u64,
217+
#[bits(10)]
218+
_rsvd: u64,
219+
#[bits(52)]
220+
pub guest_apic_backing_page_ptr: u64,
221+
}
222+
209223
/// SEV VMSA structure representing CPU state
210224
#[repr(C)]
211225
#[derive(Debug, Clone, IntoBytes, Immutable, KnownLayout, FromBytes, PartialEq, Eq)]
@@ -344,7 +358,7 @@ pub struct SevVmsa {
344358
pub rcx: u64,
345359
pub rdx: u64,
346360
pub rbx: u64,
347-
pub vmsa_reserved8: u64, // MBZ
361+
pub secure_avic_control: SecureAvicControl,
348362
pub rbp: u64,
349363
pub rsi: u64,
350364
pub rdi: u64,

0 commit comments

Comments
 (0)