Struct KvmNestedStateBuffer
#[non_exhaustive]#[repr(C)]pub struct KvmNestedStateBuffer {
pub flags: u16,
pub format: u16,
pub size: u32,
pub hdr: kvm_nested_state__bindgen_ty_1,
pub data: kvm_nested_state__data,
}Expand description
A stack-allocated buffer for nested KVM state including the mandatory header with meta-information.
KVM uses a dynamically sized buffer structure (with a header reporting the
size of the buffer/state). This helper type makes working with
get_nested_state() and set_nested_state() significantly more convenient
at the cost of a slightly higher memory footprint in some cases.
§Type Size
On Intel VMX, the actual state requires 128 + 8192 == 8320 bytes, on
AMD SVM, the actual state requires 128 + 4096 == 4224 bytes. This type
doesn’t make a differentiation and unifies the required memory. By
sacrificing a few more bytes on VMX, this type is generally convenient to
use.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.flags: u16§format: u16§size: u32§hdr: kvm_nested_state__bindgen_ty_1§data: kvm_nested_state__dataImplementations§
§impl KvmNestedStateBuffer
impl KvmNestedStateBuffer
pub fn empty() -> KvmNestedStateBuffer
pub fn empty() -> KvmNestedStateBuffer
Creates a new empty buffer, ready for nested state to be stored in by KVM.
The size property will report the size of the buffer to KVM.
Trait Implementations§
§impl Clone for KvmNestedStateBuffer
impl Clone for KvmNestedStateBuffer
§fn clone(&self) -> KvmNestedStateBuffer
fn clone(&self) -> KvmNestedStateBuffer
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more