kvm_pmu_set_...r_event_type(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 to PMXEVTYPER_EL0
  • select_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:


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