summaryrefslogtreecommitdiffstats
path: root/arch/xtensa/kernel/perf_event.c
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2015-07-16 10:37:31 +0300
committerMax Filippov <jcmvbkbc@gmail.com>2015-08-17 07:33:39 +0300
commit38fef73c21d117cf992fb5ec6e30630e54e13f4f (patch)
treeca3aae4c2e29ee81c66dcc16eb835e0b8c4e631f /arch/xtensa/kernel/perf_event.c
parent98e298329e7b391293da5097817437292c842dc9 (diff)
downloadblackbird-op-linux-38fef73c21d117cf992fb5ec6e30630e54e13f4f.tar.gz
blackbird-op-linux-38fef73c21d117cf992fb5ec6e30630e54e13f4f.zip
xtensa: implement fake NMI
In case perf IRQ is the highest of the medium-level IRQs, and is alone on its level, it may be treated as NMI: - LOCKLEVEL is defined to be one level less than EXCM level, - IRQ masking never lowers current IRQ level, - new fake exception cause code, EXCCAUSE_MAPPED_NMI is assigned to that IRQ; new second level exception handler, do_nmi, assigned to it handles it as NMI, - atomic operations in configurations without s32c1i still need to mask all interrupts. Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'arch/xtensa/kernel/perf_event.c')
-rw-r--r--arch/xtensa/kernel/perf_event.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/xtensa/kernel/perf_event.c b/arch/xtensa/kernel/perf_event.c
index b44df3c8198f..54f01188c29c 100644
--- a/arch/xtensa/kernel/perf_event.c
+++ b/arch/xtensa/kernel/perf_event.c
@@ -359,7 +359,7 @@ void perf_event_print_debug(void)
local_irq_restore(flags);
}
-static irqreturn_t xtensa_pmu_irq_handler(int irq, void *dev_id)
+irqreturn_t xtensa_pmu_irq_handler(int irq, void *dev_id)
{
irqreturn_t rc = IRQ_NONE;
struct xtensa_pmu_events *ev = this_cpu_ptr(&xtensa_pmu_events);
@@ -436,10 +436,14 @@ static int __init xtensa_pmu_init(void)
int irq = irq_create_mapping(NULL, XCHAL_PROFILING_INTERRUPT);
perf_cpu_notifier(xtensa_pmu_notifier);
+#if XTENSA_FAKE_NMI
+ enable_irq(irq);
+#else
ret = request_irq(irq, xtensa_pmu_irq_handler, IRQF_PERCPU,
"pmu", NULL);
if (ret < 0)
return ret;
+#endif
ret = perf_pmu_register(&xtensa_pmu, "cpu", PERF_TYPE_RAW);
if (ret)
OpenPOWER on IntegriCloud