diff options
| author | ryo <ryo@NetBSD.org> | 2022-12-22 06:59:32 +0000 |
|---|---|---|
| committer | ryo <ryo@NetBSD.org> | 2022-12-22 06:59:32 +0000 |
| commit | f69a237e84e929a23509cf7b6ed2fe4803c6ff9e (patch) | |
| tree | 1132ac9c74942159a92164a72f2ed000d851c83a /sys/dev | |
| parent | 9fb3a6d446c44901408d9c978068baca2444c4ba (diff) | |
Even if an overflow interrupt is occured for a counter outside tprof management,
the bit of onverflow status register must be cleared to prevent an interrupt storm.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/tprof/tprof_armv7.c | 8 | ||||
| -rw-r--r-- | sys/dev/tprof/tprof_armv8.c | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/sys/dev/tprof/tprof_armv7.c b/sys/dev/tprof/tprof_armv7.c index 008b803c934..2ebb9ae8c3e 100644 --- a/sys/dev/tprof/tprof_armv7.c +++ b/sys/dev/tprof/tprof_armv7.c @@ -1,4 +1,4 @@ -/* $NetBSD: tprof_armv7.c,v 1.11 2022/12/03 20:24:21 ryo Exp $ */ +/* $NetBSD: tprof_armv7.c,v 1.12 2022/12/22 06:59:32 ryo Exp $ */ /*- * Copyright (c) 2018 Jared McNeill <jmcneill@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: tprof_armv7.c,v 1.11 2022/12/03 20:24:21 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tprof_armv7.c,v 1.12 2022/12/22 06:59:32 ryo Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -225,7 +225,7 @@ armv7_pmu_intr(void *priv) tprof_backend_softc_t *sc = pmu_intr_arg; tprof_frame_info_t tfi; int bit; - const uint32_t pmovs = armreg_pmovsr_read() & PMOVS_P; + const uint32_t pmovs = armreg_pmovsr_read(); uint64_t *counters_offset = percpu_getptr_remote(sc->sc_ctr_offset_percpu, curcpu()); @@ -248,7 +248,7 @@ armv7_pmu_intr(void *priv) tfi.tfi_pc >= VM_MIN_KERNEL_ADDRESS && tfi.tfi_pc < VM_MAX_KERNEL_ADDRESS; tprof_sample(NULL, &tfi); - } else { + } else if (ISSET(sc->sc_ctr_ovf_mask, __BIT(bit))) { /* counter has overflowed */ counters_offset[bit] += __BIT(32); } diff --git a/sys/dev/tprof/tprof_armv8.c b/sys/dev/tprof/tprof_armv8.c index baca94cccbc..04b2a57cfcc 100644 --- a/sys/dev/tprof/tprof_armv8.c +++ b/sys/dev/tprof/tprof_armv8.c @@ -1,4 +1,4 @@ -/* $NetBSD: tprof_armv8.c,v 1.18 2022/12/01 00:32:52 ryo Exp $ */ +/* $NetBSD: tprof_armv8.c,v 1.19 2022/12/22 06:59:32 ryo Exp $ */ /*- * Copyright (c) 2018 Jared McNeill <jmcneill@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: tprof_armv8.c,v 1.18 2022/12/01 00:32:52 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tprof_armv8.c,v 1.19 2022/12/22 06:59:32 ryo Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -197,7 +197,7 @@ armv8_pmu_intr(void *priv) tprof_backend_softc_t *sc = pmu_intr_arg; tprof_frame_info_t tfi; int bit; - const uint32_t pmovs = reg_pmovsset_el0_read() & PMOVS_P; + const uint32_t pmovs = reg_pmovsset_el0_read(); uint64_t *counters_offset = percpu_getptr_remote(sc->sc_ctr_offset_percpu, curcpu()); @@ -220,7 +220,7 @@ armv8_pmu_intr(void *priv) tfi.tfi_pc >= VM_MIN_KERNEL_ADDRESS && tfi.tfi_pc < VM_MAX_KERNEL_ADDRESS; tprof_sample(NULL, &tfi); - } else { + } else if (ISSET(sc->sc_ctr_ovf_mask, __BIT(bit))) { /* counter has overflowed */ counters_offset[bit] += __BIT(32); } |
