KVM: arm64: Avoid reading ID_AA64DFR0_EL1 for debug save/restore
authorOliver Upton <oliver.upton@linux.dev>
Thu, 19 Dec 2024 22:41:14 +0000 (14:41 -0800)
committerMarc Zyngier <maz@kernel.org>
Fri, 20 Dec 2024 09:04:14 +0000 (09:04 +0000)
commit8c02c2bbd64375e603df79449f0eb2c57e1a597c
tree37c3a89ba887f1ee2e740c5fd716e40ead2e7797
parentb0ee51033ae35461ae98c465426f0002b8370679
KVM: arm64: Avoid reading ID_AA64DFR0_EL1 for debug save/restore

Similar to other per-CPU profiling/debug features we handle, store the
number of breakpoints/watchpoints in kvm_host_data to avoid reading the
ID register 4 times on every guest entry/exit. And if you're in the
nested virt business that's quite a few avoidable exits to the L0
hypervisor.

Tested-by: James Clark <james.clark@linaro.org>
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Link: https://lore.kernel.org/r/20241219224116.3941496-18-oliver.upton@linux.dev
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/include/asm/kvm_host.h
arch/arm64/kvm/debug.c
arch/arm64/kvm/hyp/include/hyp/debug-sr.h