kvm_pmu_sync_hwstate(9)
π kvm_pmu_sync_hwstate β sync pmu state from cpu β¨
okay so bestie, this one lives in the Kernel API Manual section 9 (that's the kernel-internals girlies, iykyk), and honestly? she's short but she's important. let's get into it π
πΈ SYNOPSIS πΈ
void kvm_pmu_sync_hwstate (struct kvm_vcpu *vcpu );
like, that's the whole signature. clean. minimal. main character energy fr π
π¦ ARGUMENTS π¦
vcpuβ the vcpu pointer π«Ά that's it, that's the argument, it's literally just a pointer to the vcpu you're working with ngl
β DESCRIPTION β
okay so here's the tea π β this function checks whether the PMU has overflowed while we were running in the guest, and if that was the case, it injects an interrupt. periodt.
so like: guest was doing guest things, perf counters were counting, something hit its limit, and now we gotta tell the guest about it. that's the vibe check. the way that this one little function keeps the PMU honest... obsessed ππ
no cap, that's the entire description. short and sweet, like a text you send at 2am that somehow solves everything β¨
π₯ SEE ALSO π₯
- Kernel file:
./arch/arm64/kvm/pmu-emul.cπ (that's where she lives!!) 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_flush_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)
like, the whole PMU friend group showed up for her π«Άπ go read them too, they're all slaying in their own ways π
ngl if you're poking at the arm64 PMU emulation code, you're gonna want the whole little squad above in your tabs. it's giving study group energy πβ¨
and that's the page bestie!! π sign-off time: this gem comes courtesy of ./arch/arm64/kvm, dated October 2026 β like she's from the future, iconic behavior, no notes ππ¦πΈπ
π¦ 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