kvm_pmu_flush_hwstate(9)
β¨ kvm_pmu_flush_hwstate(9) β¨
okay so bestie, welcome to the Kernel API Manual β this one's a little function from the arm64 KVM world and it's honestly kinda iconic for how much it does while looking like it does nothing π
πΈ NAME πΈ
kvm_pmu_flush_hwstate β flush pmu state to cpu π¦
like yes, that's the whole vibe: PMU state gets flushed to the cpu. simple. elegant. slay.
π SYNOPSIS π
void kvm_pmu_flush_hwstate (struct kvm_vcpu *vcpu );
that's it. that's the whole signature. no return value, she just does things and dips π
π ARGUMENTS π
vcpuβ The vcpu pointer β¨ literally just the pointer to the vcpu, that's the whole thing, don't overthink it
π₯ DESCRIPTION π₯
okay so here's the tea π΅ β this function checks whether the PMU has overflowed while we were running in the host, and if it did, it injects an interrupt. that's it. that's the job. no cap.
so like, imagine the vcpu went off to hang out in host-land for a bit π and while it was gone, the PMU counter lowkey maxed out. this function is the one that's like "bestieβ¦ you overflowed π" and then fires off an interrupt to deal with it. main character energy fr fr π
π SEE ALSO π
- Kernel file
./arch/arm64/kvm/pmu-emul.cβ the source, go read it iykyk π kvm_pmc_is_64bit(9)kvm_pmu_get_counter_value(9)kvm_pmu_set_counter_value(9)kvm_pmu_set_counter_value_user(9)kvm_pmu_release_perf_event(9)kvm_pmu_stop_counter(9)kvm_pmu_vcpu_init(9)kvm_pmu_vcpu_destroy(9)kvm_pmu_sync_hwstate(9)kvm_pmu_software_increment(9)kvm_pmu_handle_pmcr(9)kvm_pmu_create_perf_event(9)kvm_pmu_set_counter_event_type(9)kvm_arm_pmu_get_max_counters(9)kvm_arm_set_default_pmu(9)kvm_vcpu_read_pmcr(9)
that's the whole friend group right there π«Ά go say hi to all of them
and that's the page!! mwah π
this lil beauty lives in ./arch/arm64/kvm and the docs were dated October 2026 β so like, future girl summer energy β keep it bookmarked bestie, and remember: check the overflow, inject the interrupt, periodt πΈπ
π¦ 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