kvm_reset_vcpu(9)
Hey bestie! Welcome to the kvm_reset_vcpu(9) manual page from the Kernel API Manual. We're about to get into the reset vibes, and ngl, it's iconic. π
β¨
πΈ NAME πΈ
kvm_reset_vcpu β sets core registers and sys_regs to reset value. Ate. π
π SYNOPSIS π
void kvm_reset_vcpu (struct kvm_vcpu *vcpu );
π ARGUMENTS π
vcpuβ the VCPU pointer, bestie. That's the whole argument list, fr fr. π«Ά
π¦ DESCRIPTION π¦
Okay so this function literally sets the registers on the virtual CPU struct to their architecturally defined reset values β slay. But there's an exception, bestie: registers whose reset is deferred until kvm_arm_vcpu_finalize don't get touched here. That's the whole vibe. Highkey obsessed. β¨
π NOTE π
Bestie, this function can be called from two paths β don't forget! π
Okay so this function can get called from two paths, bestie: the KVM_ARM_VCPU_INIT ioctl, or as part of handling a request issued by another VCPU in the PSCI handling code. In the first case, the VCPU will not be loaded. In the second case, the VCPU will be loaded. Because this function operates purely on the memory-backed values of system registers, we want to do a full put if we were loaded (handling a request) and load the values back at the end of the function. Otherwise we leave the state alone. And in both cases, we disable preemption around the vcpu reset, because otherwise we'd race with preempt notifiers which also call put/load. Vibe check: passed. No cap, it's giving race condition prevention. π periodt.
π SEE ALSO π
- Kernel file
./arch/arm64/kvm/reset.cβ that's where you'll find the source, bestie. Iykyk. Lowkey obsessed with this file. π
Alright bestie, that's the whole kvm_reset_vcpu(9) page for you! This is from the ./arch/arm64/kvm source, version October 2026. Stay iconic, and remember: reset those registers, but don't forget the preemption disable. Fr fr. π
β¨π«Ά
π¦ 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