kvm_mips_freeze_hrtimer(9)
π NAME π
kvm_mips_freeze_hrtimer β bestie, this is the one that safely stops the hrtimer β¨ (yes, safely, we do not just yank the plug, okay?)
This page comes straight out of the Kernel API Manual, and it's giving very specific MIPS KVM energy π§
π SYNOPSIS π
ktime_t kvm_mips_freeze_hrtimer (struct kvm_vcpu *vcpu , u32 *count );
No cap, that's the whole signature. Keep the spacing, she's iconic like that π
πΈ ARGUMENTS πΈ
vcpuβ the virtual CPU. Your main character struct, basically. πcountβ an output pointer for theCP0_Countvalue at the point of freeze. So yeah, it writes the count back out through this pointer, that's its whole job π«Ά
π¦ DESCRIPTION π¦
Okay so the whole vibe here: you freeze the hrtimer safely, and then it returns both the ktime and the CP0_Count value at the exact point it was frozen. Both. Not one, not the other. Both. π
And the guarantee is lowkey the important part: any pending interrupts at the point it was frozen are handled β and none after that point. Like a clean cut βοΈβ¨
This is useful where the time/CP0_Count is needed in the calculation of the new parameters. So if you're doing math that depends on those values, this is the moment you freeze first. Periodt.
β οΈ Heads up, bestie: this assumes!kvm_mips_count_disabled(vcpu)β meaning the guestCP0_Counttimer is running. Do not come in here with a disabled timer and expect a good time π
β RETURN β
It returns the ktime at the point of freeze. That's the return value, no extra lore, fr fr.
π SEE ALSO π
Kernel file ./arch/mips/kvm/emulate.c has the friends and neighbors, and here's the whole group chat:
kvm_get_badinstr(9)kvm_get_badinstrp(9)kvm_mips_count_disabled(9)kvm_mips_ktime_to_count(9)kvm_mips_count_time(9)kvm_mips_read_count_running(9)kvm_mips_read_count(9)kvm_mips_resume_hrtimer(9)kvm_mips_restore_hrtimer(9)kvm_mips_write_count(9)kvm_mips_init_count(9)kvm_mips_set_count_hz(9)kvm_mips_write_compare(9)kvm_mips_count_disable(9)kvm_mips_count_disable_cause(9)kvm_mips_count_enable_cause(9)kvm_mips_set_count_ctl(9)kvm_mips_set_count_resume(9)kvm_mips_count_timeout(9)
mwah π this page lives in ./arch/mips/kvm and is dated October 2026 β iconic, timeless, signed off with love πβ¨
π¦ 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