]> www.infradead.org Git - users/jedix/linux-maple.git/commit
KVM: arm64: nv: Apply EL2 event filtering when in hyp context
authorOliver Upton <oliver.upton@linux.dev>
Fri, 25 Oct 2024 18:23:52 +0000 (18:23 +0000)
committerOliver Upton <oliver.upton@linux.dev>
Thu, 31 Oct 2024 19:00:41 +0000 (19:00 +0000)
commit8a34979030f6bcb713476ae485a58f5d8e96ebea
treebe187bd933e65eeaebeacb592680203379d4445b
parent16535d55e91f4d55134370e78e2b7f217e2ebc19
KVM: arm64: nv: Apply EL2 event filtering when in hyp context

It hopefully comes as no surprise when I say that vEL2 actually runs at
EL1. So, the guest hypervisor's EL2 event filter (NSH) needs to actually
be applied to EL1 in the perf event. In addition to this, the disable
bit for the guest counter range (HPMD) needs to have the effect of
stopping the affected counters.

Do exactly that by stuffing ::exclude_kernel with the combined effect of
these controls. This isn't quite enough yet, as the backing perf events
need to be reprogrammed upon nested ERET/exception entry to remap the
effective filter onto ::exclude_kernel.

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