pub struct UserXstate { /* private fields */ }Expand description
A 64-byte-aligned memory region for the XSAVE/XRSTOR instructions, which save
and restore the full XCR0-enabled extended state (x87, SSE/XMM, and the
upper 128 bits of the AVX YMM registers that FXSAVE/FXRSTOR drop).
The first 512 bytes share the legacy FxsaveArea layout, so the FXSAVE
fallback path (CPUs/VMs without XSAVE, e.g. the default qemu64 model) reads
and writes the same region.
See https://www.felixcloutier.com/x86/xsave for more details.
Implementations§
Source§impl UserXstate
impl UserXstate
Sourcepub const fn initial() -> Self
Available on crate feature fp-simd only.
pub const fn initial() -> Self
fp-simd only.Returns the architecture’s initial user FPU state image.
Sourcepub fn user_size() -> Option<usize>
Available on crate feature fp-simd only.
pub fn user_size() -> Option<usize>
fp-simd only.Returns the standard, non-compacted x86 user xstate size enabled by XCR0.
None means this CPU uses the FXSAVE fallback and therefore does not
provide Linux’s NT_X86_XSTATE regset.
Sourcepub fn user_feature_mask() -> u64
Available on crate feature fp-simd only.
pub fn user_feature_mask() -> u64
fp-simd only.Returns the user xfeatures enabled by the boot-time XCR0 policy.
Sourcepub const fn fxsave_area(&self) -> &FxsaveArea
Available on crate feature fp-simd only.
pub const fn fxsave_area(&self) -> &FxsaveArea
fp-simd only.Returns the legacy 512-byte FXSAVE region.
Sourcepub fn fxsave_bytes(&self) -> &[u8]
Available on crate feature fp-simd only.
pub fn fxsave_bytes(&self) -> &[u8]
fp-simd only.Returns the legacy 512-byte FXSAVE region as bytes.
Sourcepub fn user_bytes(&self) -> Option<&[u8]>
Available on crate feature fp-simd only.
pub fn user_bytes(&self) -> Option<&[u8]>
fp-simd only.Returns the enabled standard-format user xstate bytes.
Sourcepub fn replace_fxsave_area(&mut self, area: FxsaveArea) -> bool
Available on crate feature fp-simd only.
pub fn replace_fxsave_area(&mut self, area: FxsaveArea) -> bool
fp-simd only.Replaces the Linux FXSAVE-compatible portion while retaining all other
xfeatures, as PTRACE_SETFPREGS/NT_PRFPREG require.
Sourcepub fn replace_fxsave_bytes(&mut self, bytes: &[u8]) -> bool
Available on crate feature fp-simd only.
pub fn replace_fxsave_bytes(&mut self, bytes: &[u8]) -> bool
fp-simd only.Replaces the Linux FXSAVE-compatible portion from its byte UABI.
Sourcepub fn replace_user_bytes(&mut self, bytes: &[u8]) -> bool
Available on crate feature fp-simd only.
pub fn replace_user_bytes(&mut self, bytes: &[u8]) -> bool
fp-simd only.Replaces the complete standard-format user xstate after validating the Linux UABI header, enabled feature mask, and MXCSR reserved bits.
Sourcepub fn replace_user_bytes_prefix(&mut self, bytes: &[u8]) -> bool
Available on crate feature fp-simd only.
pub fn replace_user_bytes_prefix(&mut self, bytes: &[u8]) -> bool
fp-simd only.Replaces a standard-format user xstate prefix from an older signal ABI.
Components absent from the supplied prefix enter their architectural
initial state. Every feature named in XSTATE_BV must fit completely in
the supplied prefix.
Trait Implementations§
Source§impl Clone for UserXstate
impl Clone for UserXstate
Source§fn clone(&self) -> UserXstate
fn clone(&self) -> UserXstate
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more