__copy_xstate_to_uabi_buf(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… __copy_xstate_to_uabi_buf(9) β€” from the Kernel API Manual, bestie πŸŽ€

okay so picture this: we're deep in the Kernel API Manual and this one function is literally the whole vibe. it's giving "translator between two worlds" and honestly? iconic. ✨


🌸 NAME 🌸

__copy_xstate_to_uabi_buf β€” copy kernel saved xstate to a UABI buffer 🫢

like yes, that's exactly what it says on the tin, no cap.


✨ SYNOPSIS ✨

void __copy_xstate_to_uabi_buf (struct membuf to , struct fpstate
*fpstate , u64 xfeatures , u32 pkru_val , enum xstate_copy_mode
copy_mode );

she takes five things and returns nothing (void, my beloved πŸ’€). periodt.


πŸ¦‹ ARGUMENTS πŸ¦‹

  • to β€” the membuf descriptor πŸ’Œ like, this is where the goods are going, bestie.
  • fpstate β€” the fpstate buffer from which to copy. the source. the origin story. 🌱
  • xfeatures β€” the mask of xfeatures to save. heads up: this one's XSAVE mode only, iykyk. 🎭
  • pkru_val β€” the PKRU value to store in the PKRU component. she's specific like that. πŸ”₯
  • copy_mode β€” the requested copy mode πŸ‘‘ whatever mode you asked for, that's the one you get.

πŸ’– DESCRIPTION πŸ’–

okay so the whole gig here is conversion, and it's lowkey a glow-up. she converts from kernel XSAVE or XSAVES compacted format into the UABI conforming format 🧚 β€” meaning from the kernel's internal, hardware dependent storage format into the requested mode. so yeah, it's a format transformation and she ate. πŸ’…

and this part is crucial, do not skip it: UABI XSTATE is always uncompacted! always. no exceptions. like the opposite of compacted, bestie. 🌈

she does support partial copy 🩷 but β€” and this is the plot twist β€” to.pos always starts from zero. always. every single time. πŸ™ˆ


⭐ SEE ALSO ⭐

go look at the kernel file ./arch/x86/kernel/fpu/xstate.c β€” that's the main character's home address πŸ πŸ’œ

and then the whole friend group, fr fr:


ngl this one's short but she is doing the work. partial copy? supported. to.pos starting from zero? non-negotiable. UABI uncompacted? forever and always. πŸ“

and that's the post! this lil page lives in ./arch/x86/kernel/fpu, dated October 2026 🌸 β€” mwah, thanks for reading, ily, bye bestie! πŸ’•πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from