__vcpu_load_switch_sysregs(9)
β¨ __vcpu_load_switch_sysregs(9) β¨
okay so bestie, welcome to the Kernel API Manual, section 9 β this one is a little KVM sysreg moment and it's honestly iconic π
πΈ NAME πΈ
__vcpu_load_switch_sysregs β load guest system registers to the physical CPU π
β¨ SYNOPSIS β¨
void __vcpu_load_switch_sysregs (struct kvm_vcpu *vcpu );
π«Ά ARGUMENTS π«Ά
vcpuβ the VCPU pointer. that's the whole vibe π¦
π DESCRIPTION π
Okay so picture this: this function loads the system registers that do not affect the host's execution. no cap, that's the boundary. For example? EL1 system registers on a VHE system where the host kernel runs at EL2. slay β¨
It gets called from KVM's vcpu_load function, and the whole point of loading system register state early is that you avoid having to load them on every entry to the VM. like, why do extra work every single time when you can just handle it early? main character energy fr fr π
lowkey important: the βdo not affect the host's executionβ part is doing a lot of work here β this is specifically about those registers π
π SEE ALSO π
- Kernel file
./arch/arm64/kvm/hyp/vhe/sysreg-sr.c __vcpu_put_switch_sysregs(9)β the other half of the sysreg switch-up, bestie π§
and that's the page!! source/version vibes: ./arch/arm64/kvm/hyp/vhe, October 2026, __vcpu_load_switch_sysregs(9). mwah πβ¨
π¦ 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