__vcpu_put_switch_sysregs(9)
β¨ __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
- 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