aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64/kvm/debug.c
diff options
context:
space:
mode:
authorOliver Upton <[email protected]>2024-12-19 22:41:14 +0000
committerMarc Zyngier <[email protected]>2024-12-20 09:04:14 +0000
commit8c02c2bbd64375e603df79449f0eb2c57e1a597c (patch)
tree37c3a89ba887f1ee2e740c5fd716e40ead2e7797 /arch/arm64/kvm/debug.c
parentKVM: arm64: nv: Honor MDCR_EL2.TDE routing for debug exceptions (diff)
downloadkernel-8c02c2bbd64375e603df79449f0eb2c57e1a597c.tar.gz
kernel-8c02c2bbd64375e603df79449f0eb2c57e1a597c.zip
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 <[email protected]> Signed-off-by: Oliver Upton <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Zyngier <[email protected]>
Diffstat (limited to 'arch/arm64/kvm/debug.c')
-rw-r--r--arch/arm64/kvm/debug.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/arm64/kvm/debug.c b/arch/arm64/kvm/debug.c
index 7d3c71d65518..d921e7f7bd59 100644
--- a/arch/arm64/kvm/debug.c
+++ b/arch/arm64/kvm/debug.c
@@ -71,6 +71,9 @@ void kvm_init_host_debug_data(void)
*host_data_ptr(nr_event_counters) = FIELD_GET(ARMV8_PMU_PMCR_N,
read_sysreg(pmcr_el0));
+ *host_data_ptr(debug_brps) = SYS_FIELD_GET(ID_AA64DFR0_EL1, BRPs, dfr0);
+ *host_data_ptr(debug_wrps) = SYS_FIELD_GET(ID_AA64DFR0_EL1, WRPs, dfr0);
+
if (has_vhe())
return;