kvm_mips_migrate_count(9)
β¨ kvm_mips_migrate_count(9) β the Kernel API Manual, MIPS KVM era β¨
Okay bestie, gather round, because we're reading a kernel API manual page together and honestly? It's kind of a bop. This one lives in the kvm_mips_migrate_count(9) corner of the Kernel API Manual universe, and it's all about making a timer follow its VCPU to a new CPU. Very main character relocation energy. π
π¦ NAME π¦
kvm_mips_migrate_count β Migrate timer.
Like, that's it. That's the whole job description. The timer migrates. Iconic, minimal, no notes. β¨
π SYNOPSIS π
void kvm_mips_migrate_count (struct kvm_vcpu *vcpu );
It returns void, so don't be out here expecting a little gift back. π
πΈ ARGUMENTS πΈ
vcpuβ Virtual CPU. Yeah, that's the whole explanation. It's the virtual CPU. The one and only. The one we're dragging over to a different CPU. π«Ά
π DESCRIPTION π
So here's the tea, bestie: this function migrates the CP0_Count hrtimer to the current CPU by cancelling it and restarting it β but only if it was running prior to being cancelled. No cap, that's the whole move. Cancel, restart, if it was running. That's it. πβ¨
And it must be called when the VCPU is migrated to a different CPU. Not "should", not "maybe if you feel like it" β must. Because the whole point is to ensure that timer expiry during guest execution actually interrupts the guest and causes the interrupt to be delivered in a timely manner. Like, if you skip this, the interrupt is just... late to the party. ππ
β οΈ Heads up: this isn't optional decoration. If the VCPU moves CPUs and you don't call this, the timer expiry / interrupt delivery thing gets messy. Call it. Periodt. π
π₯ SEE ALSO π₯
Kernel file ./arch/mips/kvm/mmu.c, plus the whole friend group:
kvm_pgd_init(9)kvm_pgd_alloc(9)kvm_mips_walk_pgd(9)kvm_mips_flush_gpa_pt(9)kvm_mips_mkclean_gpa_pt(9)kvm_arch_mmu_enable_log_dirty_pt_masked(9)_kvm_mips_map_page_fast(9)kvm_mips_map_page(9)
Squad goals, honestly. π
And that's the page, bestie β go touch grass (or, like, go read ./arch/mips/kvm) π§
Source/version vibes: this one's from the ./arch/mips/kvm directory, dated October 2026, and it's kvm_mips_migrate_count(9) all the way down. 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