Home

CPUIDOSXSAVE

CPUIDOSXSAVE, or the OSXSAVE feature, is a processor capability flag exposed by the CPUID instruction. It indicates that the operating system supports saving and restoring the processor’s extended state using the XSAVE family of instructions, and that the system can safely preserve advanced registers such as AVX and AVX-512 across context switches. The flag is reported by CPUID in the standard feature information leaf (EAX=1), specifically in the ECX register; when the bit is set, the processor supports the XSAVE mechanism and the operating system is expected to use it for context switching.

Mechanism and scope. When OSXSAVE is available, the operating system can use the XSAVE and related instructions

Relation to CPUID leaf 0xD. A separate CPUID leaf (0xD) provides details about the size of the

Significance. For software and system software, CPUID OSXSAVE signals compatibility with modern saving/restoring mechanisms for processor

to
save
and
restore
not
only
x87
and
MMX/SSE
state
but
also
newer
state
components
such
as
AVX,
AVX-512,
and
other
extended
states.
The
OS
determines
which
components
to
save
by
querying
the
processor’s
extended
state
information
and
configuring
the
control
register
XCR0
accordingly.
The
XSTATE
mechanism
requires
cooperation
between
the
CPU
and
the
OS:
the
processor
must
be
able
to
save
the
enabled
state
components,
and
the
OS
must
ensure
those
components
are
preserved
during
thread
or
process
switches.
save
area
and
which
specific
state
components
are
supported.
This
information,
together
with
XCR0,
lets
the
OS
decide
which
states
to
enable
and
save.
If
OSXSAVE
is
present
but
the
OS
does
not
enable
or
preserve
extended
states,
performance
and
correctness
penalties
can
arise
when
using
advanced
instruction
sets.
states.
It
reflects
a
CPU
capability
that,
when
paired
with
operating
system
support,
enables
efficient
use
of
advanced
vector
instructions
during
multitasking.