Message ID | 20171002183524.ab23b255b6d03331bb36f75a@arm.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Mon, Oct 02, 2017 at 06:35:24PM -0500, Kim Phillips wrote: [trim other stuff] > Meanwhile, when I build this v5 arm_spe_pmu as a module, load it, do a > perf list, rmmod it, then re-load it, I get an Oops: > > # insmod arm_spe_pmu.ko > [ 2018.623646] arm_spe_pmu spe-pmu@0: probed for CPUs 0-3 [max_record_sz 64, align 1, features 0xf] > [ 2018.626346] arm_spe_pmu spe-pmu@1: probed for CPUs 4-7 [max_record_sz 64, align 1, features 0xf] > # ./perf list > [ 2021.649688] Unable to handle kernel NULL pointer dereference at virtual address 00000038 [...] Cheers for the report. Fix here: https://lkml.org/lkml/2017/10/3/564 Will
On Mon, 2 Oct 2017 18:35:24 -0500 Kim Phillips <kim.phillips@arm.com> wrote: > On Mon, 2 Oct 2017 13:49:30 -0300 > Arnaldo Carvalho de Melo <acme@redhat.com> wrote: > > I'm all for more informative messages, and if you guys agree on how to > > provide the info in a way that combined with logic in evsel.c, I'd say > > do what Will suggested, post a patch series and include usage examples, > > before and after. > > I'll figure out how to get the PMU in evsel.c's strerror fn, and give it > another shot. I don't think it'll be a big problem for the SPE driver > itself, it's just some of the other drivers have long lists of reasons > to return -EXXXX, and I don't think evsel.c's strerror fn should be > able to handle all that. See this example for the arm-ccn driver: http://lists.infradead.org/pipermail/linux-arm-kernel/2017-October/538924.html Please follow up on that thread. Thanks, Kim
diff --git a/kernel/events/core.c b/kernel/events/core.c index 6bc21e202ae4..9d886db68999 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -1067,14 +1067,24 @@ static int perf_mux_hrtimer_restart(struct perf_cpu_context *cpuctx) void perf_pmu_disable(struct pmu *pmu) { - int *count = this_cpu_ptr(pmu->pmu_disable_count); + int *count; + + if (!pmu) + return; + + count = this_cpu_ptr(pmu->pmu_disable_count); if (!(*count)++) pmu->pmu_disable(pmu); } void perf_pmu_enable(struct pmu *pmu) { - int *count = this_cpu_ptr(pmu->pmu_disable_count); + int *count; + + if (!pmu) + return; + + count = this_cpu_ptr(pmu->pmu_disable_count); if (!--(*count)) pmu->pmu_enable(pmu); }