]> www.infradead.org Git - users/jedix/linux-maple.git/commit
KVM: arm64: Add unified helper for reprogramming counters by mask
authorOliver Upton <oliver.upton@linux.dev>
Tue, 17 Dec 2024 17:55:13 +0000 (09:55 -0800)
committerOliver Upton <oliver.upton@linux.dev>
Wed, 18 Dec 2024 21:22:25 +0000 (13:22 -0800)
commite22c369520d0a2a191820cc308f81a860b1b8d47
tree32ffceebf6cd5281219976e8364a17ec44b32e47
parent985bb51f17abbe83c697a5ac0aa40fad5f4e00f4
KVM: arm64: Add unified helper for reprogramming counters by mask

Having separate helpers for enabling/disabling counters provides the
wrong abstraction, as the state of each counter needs to be evaluated
independently and, in some cases, use a different global enable bit.

Collapse the enable/disable accessors into a single, common helper that
reconfigures every counter set in @mask, leaving the complexity of
determining if an event is actually enabled in
kvm_pmu_counter_is_enabled().

Reviewed-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20241217175513.3658056-1-oliver.upton@linux.dev
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
arch/arm64/kvm/pmu-emul.c
arch/arm64/kvm/sys_regs.c
include/kvm/arm_pmu.h