kvm_pmu_set_...r_event_type(9)
π NAME π
kvm_pmu_set_counter_event_type β bestie, this is the one that sets a selected counter to monitor some event π
β¨ SYNOPSIS β¨
void kvm_pmu_set_counter_event_type (struct kvm_vcpu *vcpu , u64 data ,
u64 select_idx );
π ARGUMENTS π
vcpuβ the vcpu pointer, literally the whole main character of this function π«Άdataβ the data the guest writes toPMXEVTYPER_EL0select_idxβ the number of the selected counter (yes, which one, and yes, it matters π )
πΈ DESCRIPTION πΈ
okay so picture this: when the OS accesses PMXEVTYPER_EL0, that means it wants to set a PMC to count an event with a given hardware event number. icon behavior, honestly.
Here we call the perf_event API to emulate this action, and we create a kernel perf event for it. that's it, that's the whole vibe β¨π¦
π₯ SEE ALSO π₯
kernel file ./arch/arm64/kvm/pmu-emul.c (go read it, iykyk π§) plus the whole bestie squad:
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_sync_hwstate(9)kvm_pmu_software_increment(9)kvm_pmu_handle_pmcr(9)kvm_pmu_create_perf_event(9)kvm_arm_pmu_get_max_counters(9)kvm_arm_set_default_pmu(9)kvm_vcpu_read_pmcr(9)
ngl the page title got truncated to kvm_pmu_set_...r_event_type(9) but you and i both know the real one π the manual is the Kernel API Manual, in case you were wondering who's behind this masterclass π
that's the whole page, bestie β written from ./arch/arm64/kvm, dated October 2026, no cap πβ slay responsibly π
π¦ 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