Skip to main content

VmmCpuidPolicy

Struct VmmCpuidPolicy 

Source
#[repr(C)]
pub struct VmmCpuidPolicy {
Show 14 fields pub abi_version: u32, pub flags: u32, pub max_basic_leaf: u32, pub max_extended_leaf: u32, pub family: u32, pub model: u32, pub stepping: u32, pub cores: u32, pub threads: u32, pub leaf1_ecx: u32, pub leaf1_edx: u32, pub extended1_ecx: u32, pub extended1_edx: u32, pub reserved: u32,
}
Expand description

Guest CPU description installed by SYS_VMM_SET_CPUID_POLICY (573).

Size: 56 bytes, alignment 4. This is a compact, mask-based form: the vendor string and the brand string are fixed by the engine (they identify s9vm and never a real vendor), so a policy only carries the parts a caller may tune : leaf ranges, version signature, topology counts and feature masks.

The caller must set abi_version to VMM_ABI_VERSION; flags and reserved are reserved and must be zero (the kernel rejects any other value). A zero numeric field or feature mask keeps the engine default, so a caller may tune only what it cares about. A leaf range must fall inside the leaves the engine implements (an out-of-range value is rejected rather than silently clamped), and a feature bit the engine refuses : nested virtualization, for instance : is silently cleared.

The structure is per world: every vCPU of a world observes the same CPU. Replacing a policy applies to the next guest entry.

Fields§

§abi_version: u32

ABI version of the structure (VMM_ABI_VERSION).

§flags: u32

Reserved, must be zero.

§max_basic_leaf: u32

Highest basic leaf, CPUID.0:EAX (0 = engine default).

§max_extended_leaf: u32

Highest extended leaf, CPUID.0x8000_0000:EAX (0 = engine default).

§family: u32

Guest family (0 = engine default).

§model: u32

Guest model (0 = engine default).

§stepping: u32

Guest stepping (0 = engine default).

§cores: u32

Physical cores per package (0 = engine default).

§threads: u32

Threads per core (0 = engine default).

§leaf1_ecx: u32

CPUID.1:ECX mask.

§leaf1_edx: u32

CPUID.1:EDX mask.

§extended1_ecx: u32

CPUID.0x8000_0001:ECX mask.

§extended1_edx: u32

CPUID.0x8000_0001:EDX mask.

§reserved: u32

Reserved, must be zero.

Trait Implementations§

Source§

impl Clone for VmmCpuidPolicy

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for VmmCpuidPolicy

Source§

impl Debug for VmmCpuidPolicy

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for VmmCpuidPolicy

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for VmmCpuidPolicy

Source§

impl PartialEq for VmmCpuidPolicy

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for VmmCpuidPolicy

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.