diff options
| author | Oliver Upton <[email protected]> | 2024-12-19 22:41:14 +0000 |
|---|---|---|
| committer | Marc Zyngier <[email protected]> | 2024-12-20 09:04:14 +0000 |
| commit | 8c02c2bbd64375e603df79449f0eb2c57e1a597c (patch) | |
| tree | 37c3a89ba887f1ee2e740c5fd716e40ead2e7797 /arch/arm64/kvm/debug.c | |
| parent | KVM: arm64: nv: Honor MDCR_EL2.TDE routing for debug exceptions (diff) | |
| download | kernel-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.c | 3 |
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; |
