__vcpu_put_switch_sysregs(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ __vcpu_put_switch_sysregs(9) ✨

okay bestie, this is the Kernel API Manual page for __vcpu_put_switch_sysregs(9), and it's highkey a sysregs slay. πŸ’…

πŸ¦‹ NAME πŸ¦‹

__vcpu_put_switch_sysregs β€” restore host system registers to the physical CPU. no cap, that's the name line. 🫢

🌸 SYNOPSIS 🌸

the signature is giving "short and powerful":

void __vcpu_put_switch_sysregs (struct kvm_vcpu *vcpu );

πŸŽ€ ARGUMENTS πŸŽ€

  • vcpu β€” The VCPU pointer. that's the whole list, bestie. 🫢

πŸ”₯ DESCRIPTION πŸ”₯

okay so what does it actually do? It saves guest system registers that do not affect the host's execution. example: EL1 system registers on a VHE system where the host kernel runs at EL2. literally that exact case. πŸ’–

and here's the tea: this function is called from KVM's vcpu_put function. deferring saving system register state until we're no longer running the VCPU avoids having to save them on every exit from the VM. the way that saves work >>>> 😭πŸ”₯

🌈 SEE ALSO 🌈

  • Kernel file ./arch/arm64/kvm/hyp/vhe/sysreg-sr.c β€” go read the source, it's right there. πŸ‘€
  • __vcpu_load_switch_sysregs(9) β€” the linked page, iconic behavior. ✨

mwah πŸ’‹ β€” cute sign-off time: source/version ./arch/arm64/kvm/hyp/vhe, date October 2026, page __vcpu_put_switch_sysregs(9). periodt. πŸŽ€

πŸ“¦ where this page comes from