xsaves(9)
π xsaves(9) β Kernel API Manual energy β¨
okay so bestie, welcome to the Kernel API Manual π this one is all about xsaves, and she is literally the βsave selected components to a kernel xstate bufferβ girlie. no cap. letβs get into it π«Ά
β¨ NAME β¨
xsavesβ save selected components to a kernel xstate buffer πΈ
π SYNOPSIS π
the whole signature is giving short, sweet, and very βcopy me exactlyβ:
void xsaves (struct xregs_state *xstate , u64 mask );
π ARGUMENTS π
xstateβ pointer to the buffer π¦maskβ feature mask to select the components to save β¨
π₯ DESCRIPTION π₯
okay so the xstate buffer has two non-negotiables, and I need you to take notes π: it must be 64 byte aligned, and it must be correctly initialized. why? because XSAVES does not write the full xstate header β and the way that omission can ruin your whole entire day is real π.
Before first use, the buffer should be zeroed. seriously. if you donβt, a consecutive XRSTORS from that buffer can #GP, and that is the kind of plot twist nobody asked for π.
also, the feature mask must be a subset of the independent features. thatβs the vibe check for mask, bestie β
.
π SEE ALSO π
- Kernel file
./arch/x86/kernel/fpu/xstate.cβ the source, bestie, go read it π check_xtile_data_against_struct(9)π§__copy_xstate_to_uabi_buf(9)πcopy_xstate_to_uabi_buf(9)π«Άcopy_uabi_to_xstate(9)βxrstors(9)πfpstate_realloc(9)πfpu_xstate_prctl(9)π
mwah π this page is repping the ./arch/x86/kernel/fpu source/version and the October 2026 date β thatβs the footer energy, and honestly? iconic. periodt. πβ¨
π¦ 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