fpu_sync_gu...it_xfd_state(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… fpu_sync_guest_vmexit_xfd_state(9)

okay bestie, so this is a page out of the Kernel API Manual, and it's about one very specific little function in ./arch/x86/kernel/fpu that keeps your XFD state from lying to you. yes, XFD. we're doing this. πŸ¦‹


✨ NAME ✨

fpu_sync_guest_vmexit_xfd_state β€” bestie, it synchronizes the XFD MSR and the software state. that's the whole vibe. no cap. πŸ’«


🌸 SYNOPSIS 🌸

void fpu_sync_guest_vmexit_xfd_state (void );

πŸŽ€ ARGUMENTS πŸŽ€

  • void β€” literally no arguments. nothing. zero. she takes nothing and she gives everything. 🫢

πŸ”₯ DESCRIPTION πŸ”₯

okay so here's the situation, and you need to hear this one. πŸ’€

You must invoke this from KVM after a VMEXIT and before enabling interrupts, but only when XFD write emulation is disabled. like, that's the condition. that's the assignment. πŸ™ˆ

and why? because the guest can freely modify XFD β€” she does whatever she wants, main character energy, no permission needed β€” so the state at VMEXIT is not guaranteed to be the same as the state on VMENTER. not even close. 😭 so before you go doing anything that depends on that software state, you gotta update the software state first. order matters, bestie. it's giving prerequisites. ✨


πŸ’€ NOTE πŸ’€

it can be invoked unconditionally even when write emulation is enabled β€” the price is just a then pointless MSR read. lowkey a scam, highkey harmless. πŸ’Έ

🌈 SEE ALSO 🌈

  • Kernel file ./arch/x86/kernel/fpu/core.c β€” go read it, iykyk πŸ“–
  • fpu_enable_guest_xfd_features(9) β€” her sister function, equally iconic πŸ‘‘

that's the whole page, babe. go sync that state. slay. πŸ’…

source: ./arch/x86/kernel/fpu Β· version/stamp: Kernel API Manual, October 2026 πŸŽ€πŸ’–

πŸ“¦ where this page comes from