KVM: arm64: PMU: Add counter_index_to_*reg() helpers
authorMarc Zyngier <maz@kernel.org>
Sun, 13 Nov 2022 16:38:23 +0000 (16:38 +0000)
committerMarc Zyngier <maz@kernel.org>
Thu, 17 Nov 2022 15:39:51 +0000 (15:39 +0000)
commit0cb9c3c87a9d3287eaf353936e6846d885102439
tree99707a27078cf635685bafad3b11d746beb21d15
parent0f1e172b54f7574ca6aa46b851b332896add955f
KVM: arm64: PMU: Add counter_index_to_*reg() helpers

In order to reduce the boilerplate code, add two helpers returning
the counter register index (resp. the event register) in the vcpu
register file from the counter index.

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