Skip to content

Commit 14b91c8

Browse files
committed
drive-by for the guest vsm in the futrure
1 parent 6ded4e2 commit 14b91c8

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

vm/hv1/hvdef/src/lib.rs

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3139,11 +3139,37 @@ pub struct HvRegisterVsmPartitionStatus {
31393139
pub reserved: u64,
31403140
}
31413141

3142+
open_enum! {
3143+
#[derive(IntoBytes, Immutable, KnownLayout, FromBytes)]
3144+
pub enum HvSnpInterruptInjection : u8 {
3145+
#![allow(non_upper_case_globals)]
3146+
HvSnpRestricted = 0x0,
3147+
HvSnpNormal = 0x1,
3148+
HvSnpAlternate = 0x2,
3149+
HvSnpSecureAvic = 0x3,
3150+
}
3151+
}
3152+
3153+
// Support for bitfield structures.
3154+
impl HvSnpInterruptInjection {
3155+
const fn from_bits(val: u8) -> Self {
3156+
HvSnpInterruptInjection(val)
3157+
}
3158+
3159+
const fn into_bits(self) -> u8 {
3160+
self.0
3161+
}
3162+
}
3163+
31423164
#[bitfield(u64)]
31433165
pub struct HvRegisterGuestVsmPartitionConfig {
31443166
#[bits(4)]
31453167
pub maximum_vtl: u8,
3146-
#[bits(60)]
3168+
#[bits(2)]
3169+
pub vtl0_interrupt_injection: HvSnpInterruptInjection,
3170+
#[bits(2)]
3171+
pub vtl1_interrupt_injection: HvSnpInterruptInjection,
3172+
#[bits(56)]
31473173
pub reserved: u64,
31483174
}
31493175

0 commit comments

Comments
 (0)