background image

13-8 Vol. 1

MANAGING STATE USING THE XSAVE FEATURE SET

— All bits in XCOMP_BV should be 0 if the processor does not support the compaction extensions to the XSAVE 

feature set.

Bytes 63:16 of the XSAVE header are reserved.

Section 13.7 through Section 13.9 provide details of how instructions in the XSAVE feature set use the XSAVE 
header of an XSAVE area.

13.4.3 

Extended Region of an XSAVE Area

The extended region of an XSAVE area starts at byte offset 576 from the area’s base address. The size of the 
extended region is determined by which state components the processor supports and which bits have been set in 
XCR0 | IA32_XSS (see Section 13.3).
The XSAVE feature set uses the extended area for each state component i, where ≥ 2. The following state compo-

nents are currently supported in the extended area: state component 2 contains AVX state; state components 5–7 
contain AVX-512 state; and state component 9 contains PKRU state.
The extended region of the an XSAVE area may have one of two formats. The standard format is supported by all 
processors that support the XSAVE feature set; the compacted format is supported by those processors that 
support the compaction extensions to the XSAVE feature set (see Section 13.2). Bit 63 of the XCOMP_BV field in 
the XSAVE header (see Section 13.4.2) indicates which format is used.
The following items describe the two possible formats of the extended region:

Standard format. Each state component i (≥ 2) is located at the byte offset from the base address of the 

XSAVE area enumerated in CPUID.(EAX=0DH,ECX=i):EBX. (CPUID.(EAX=0DH,ECX=i):EAX enumerates the 
number of bytes required for state component i.

Compacted format. Each state component i (≥ 2) is located at a byte offset from the base address of the 

XSAVE area based on the XCOMP_BV field in the XSAVE header:
— If  XCOMP_BV[i] = 0, state component i is not in the XSAVE area.
— If  XCOMP_BV[i] = 1, state component i is located at a byte offset location

I

 from the base address of the 

XSAVE area, where location

I

 is determined by the following items:

If XCOMP_BV[j] = 0 for every j, 2 ≤ ilocation

I

 is 576. (This item applies if i is the first bit set in 

bits 62:2 of the XCOMP_BV; it implies that state component i is located at the beginning of the 
extended region.) 

Otherwise, let j, 2 ≤ i, be the greatest value such that XCOMP_BV[j] = 1. Then location

I

 is 

determined by the following values: location

J

size

J

, as enumerated in CPUID.(EAX=0DH,ECX=j):EAX; 

and the value of align

I

, as enumerated in CPUID.(EAX=0DH,ECX=i):ECX[1]:

If align

I

= 0, location

I

location

J

 size

J

. (This item implies that state component i is located 

immediately following the preceding state component whose bit is set in XCOMP_BV.)

If align

I

= 1, location

I

= ceiling(location

J

 size

J

, 64). (This item implies that state component i is 

located on the next 64-byte boundary following the preceding state component whose bit is set in 
XCOMP_BV.)

13.5 XSAVE-MANAGED 

STATE

The section provides details regarding how the XSAVE feature set interacts with the various XSAVE-managed state 
components.
Unless otherwise state, the state pertaining to a particular state component is saved beginning at byte 0 of the 
section of the XSAVE are corresponding to that state component.