]> www.infradead.org Git - users/dwmw2/linux.git/commit
KVM: arm64: coresight: Give TRBE enabled state to KVM
authorJames Clark <james.clark@linaro.org>
Mon, 6 Jan 2025 14:24:40 +0000 (14:24 +0000)
committerMarc Zyngier <maz@kernel.org>
Sun, 12 Jan 2025 12:50:11 +0000 (12:50 +0000)
commita665e3bc88081dd65642d83fc22a1abdb6a901bc
treeaf3275ecb9f2ea20b75ea809fefd2e534c4893c4
parenta2b579c41fe9c295804abd167751f9fdc73c7006
KVM: arm64: coresight: Give TRBE enabled state to KVM

Currently in nVHE, KVM has to check if TRBE is enabled on every guest
switch even if it was never used. Because it's a debug feature and is
more likely to not be used than used, give KVM the TRBE buffer status to
allow a much simpler and faster do-nothing path in the hyp.

Protected mode now disables trace regardless of TRBE (because
trfcr_while_in_guest is always 0), which was not previously done.
However, it continues to flush whenever the buffer is enabled
regardless of the filter status. This avoids the hypothetical case of a
host that had disabled the filter but not flushed which would arise if
only doing the flush when the filter was enabled.

Signed-off-by: James Clark <james.clark@linaro.org>
Link: https://lore.kernel.org/r/20250106142446.628923-6-james.clark@linaro.org
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/include/asm/kvm_host.h
arch/arm64/kvm/debug.c
arch/arm64/kvm/hyp/nvhe/debug-sr.c
drivers/hwtracing/coresight/coresight-trbe.c