pub struct XSTATE_CONFIG_FEATURE_MSC_INFO {
pub size_of_info: u32,
pub context_size: u32,
pub enabled_features: u64,
pub features: [XSTATE_FEATURE; 64],
}
Expand description
A descriptor of the XSAVE context, which extends a normal x86/x64 context.
The sections of this context are dumps of some of the CPUs registers (e.g. one section might contain the contents of the SSE registers).
Intel documents its XSAVE entries in Volume 1, Chapter 13 of the “Intel 64 and IA-32 Architectures Software Developer’s Manual”.
The XSTATE Format in Minidumps
This format is slightly messed up in the context of minidumps because it’s grafted onto Microsoft’s own formats. Here’s what’s important to know:
-
The “Cpu Context” and the “XSAVE context” are in fact the same regions of memory.
-
Whether XSTATE is present or not, the classic layouts of CONTEXT_X86 and
CONTEXT_AMD64
both apply – xstate will only add stuff after or refine your understanding of memory in the existing layout. So you can safely ignore the existence of XSTATE, but you might be missing new info. -
AMD64 doesn’t have a standard way to save general purpose registers, so the first 256 bytes of
CONTEXT_AMD64
are just however microsoft decided to save the registers, and will not be referred to by the XSTATE.
!!! THIS PART IS IMPORTANT !!!
-
As a consequence, all
XSTATE_FEATURE::offset
values must have 256 added to them to get the correct offset for that feature! For example, the LEGACY_FLOATING_POINT feature should always have an offset of 0, but it is actually at offset 256 inCONTEXT_AMD64
(it corresponds toCONTEXT_AMD64::float_save
). -
The following features are already contained inside of
CONTEXT_AMD64
:- LEGACY_FLOATING_POINT
- LEGACY_SSE
- GSSE_AND_AVX
-
If there are XSTATE entries that actually map outside of the context’s normal memory range, then the context’s
context_flags
will have bit 0x40 set (CONTEXT_HAS_XSTATE
). -
ContextFlagsCpu::from_flags
will mask out theCONTEXT_HAS_XSTATE
bit. If you want to check for that bit, check the raw value ofcontext_flags
.
Fields
size_of_info: u32
The size of this struct.
context_size: u32
The size of the XSAVE context.
enabled_features: u64
The bit enabled_features[i]
indicates that features[i]
contains valid data.
features: [XSTATE_FEATURE; 64]
The offset and size of each XSAVE entry inside the XSAVE context.
Implementations
sourceimpl XSTATE_CONFIG_FEATURE_MSC_INFO
impl XSTATE_CONFIG_FEATURE_MSC_INFO
sourcepub fn iter(&self) -> XstateFeatureIter<'_>ⓘNotable traits for XstateFeatureIter<'a>impl<'a> Iterator for XstateFeatureIter<'a> type Item = (usize, XSTATE_FEATURE);
pub fn iter(&self) -> XstateFeatureIter<'_>ⓘNotable traits for XstateFeatureIter<'a>impl<'a> Iterator for XstateFeatureIter<'a> type Item = (usize, XSTATE_FEATURE);
Gets an iterator of all the enabled features.
Trait Implementations
sourceimpl Clone for XSTATE_CONFIG_FEATURE_MSC_INFO
impl Clone for XSTATE_CONFIG_FEATURE_MSC_INFO
sourcefn clone(&self) -> XSTATE_CONFIG_FEATURE_MSC_INFO
fn clone(&self) -> XSTATE_CONFIG_FEATURE_MSC_INFO
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Default for XSTATE_CONFIG_FEATURE_MSC_INFO
impl Default for XSTATE_CONFIG_FEATURE_MSC_INFO
sourcefn default() -> XSTATE_CONFIG_FEATURE_MSC_INFO
fn default() -> XSTATE_CONFIG_FEATURE_MSC_INFO
Returns the “default value” for a type. Read more
sourceimpl<'a> TryFromCtx<'a, Endian, [u8]> for XSTATE_CONFIG_FEATURE_MSC_INFO where
XSTATE_CONFIG_FEATURE_MSC_INFO: 'a,
impl<'a> TryFromCtx<'a, Endian, [u8]> for XSTATE_CONFIG_FEATURE_MSC_INFO where
XSTATE_CONFIG_FEATURE_MSC_INFO: 'a,
type Error = Error
fn try_from_ctx(
src: &'a [u8],
ctx: Endian
) -> Result<(XSTATE_CONFIG_FEATURE_MSC_INFO, usize), <XSTATE_CONFIG_FEATURE_MSC_INFO as TryFromCtx<'a, Endian, [u8]>>::Error>
sourceimpl<'a> TryIntoCtx<Endian, [u8]> for &'a XSTATE_CONFIG_FEATURE_MSC_INFO
impl<'a> TryIntoCtx<Endian, [u8]> for &'a XSTATE_CONFIG_FEATURE_MSC_INFO
type Error = Error
fn try_into_ctx(
self,
dst: &mut [u8],
ctx: Endian
) -> Result<usize, <&'a XSTATE_CONFIG_FEATURE_MSC_INFO as TryIntoCtx<Endian, [u8]>>::Error>
sourceimpl TryIntoCtx<Endian, [u8]> for XSTATE_CONFIG_FEATURE_MSC_INFO
impl TryIntoCtx<Endian, [u8]> for XSTATE_CONFIG_FEATURE_MSC_INFO
type Error = Error
fn try_into_ctx(
self,
dst: &mut [u8],
ctx: Endian
) -> Result<usize, <XSTATE_CONFIG_FEATURE_MSC_INFO as TryIntoCtx<Endian, [u8]>>::Error>
Auto Trait Implementations
impl RefUnwindSafe for XSTATE_CONFIG_FEATURE_MSC_INFO
impl Send for XSTATE_CONFIG_FEATURE_MSC_INFO
impl Sync for XSTATE_CONFIG_FEATURE_MSC_INFO
impl Unpin for XSTATE_CONFIG_FEATURE_MSC_INFO
impl UnwindSafe for XSTATE_CONFIG_FEATURE_MSC_INFO
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more