xrstors(9)
π NAME π
Okay so welcome to xrstors(9) from the Kernel API Manual, bestie β this little icon is here to restore selected components from a kernel xstate buffer. Slay.
β¨ SYNOPSIS β¨
void xrstors (struct xregs_state *xstate , u64 mask );
π ARGUMENTS π
xstateβ pointer to the buffer. It's literally the buffer, bestie.maskβ feature mask to select the components to restore. It's the "which components are we bringing back?" picker.
π§ DESCRIPTION π§
The xstate buffer must be 64 byte aligned and correctly initialized β otherwise XRSTORS from that buffer can #GP. No cap, that's the warning, and it is not a cute look.
Proper usage is to restore the state which was saved with xsaves into xstate. Like, that's the intended pairing: xsaves tucks it away, xrstors brings it back. π
The feature mask must be a subset of the independent features. Periodt β that's the rule.
β οΈ reminder: 64 byte aligned + correctly initialized, orXRSTORSfrom that buffer can#GP. Keep it correct, keep it iconic. π«Ά
π SEE ALSO π
- kernel file
./arch/x86/kernel/fpu/xstate.c check_xtile_data_against_struct(9)__copy_xstate_to_uabi_buf(9)copy_xstate_to_uabi_buf(9)copy_uabi_to_xstate(9)xsaves(9)fpstate_realloc(9)fpu_xstate_prctl(9)
π¦ cute lil sign-off: this page comes from ./arch/x86/kernel/fpu, dated October 2026, and it's the xrstors(9) page β mwah π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms