kvm_mips_freeze_hrtimer(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 the CP0_Count value 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 guest CP0_Count timer 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:


mwah πŸ’‹ this page lives in ./arch/mips/kvm and is dated October 2026 β€” iconic, timeless, signed off with love πŸŽ€βœ¨

πŸ“¦ where this page comes from