linux/kernel/irq
Julien Thierry 17ce302f31 arm64: Fix interrupt tracing in the presence of NMIs
In the presence of any form of instrumentation, nmi_enter() should be
done before calling any traceable code and any instrumentation code.

Currently, nmi_enter() is done in handle_domain_nmi(), which is much
too late as instrumentation code might get called before. Move the
nmi_enter/exit() calls to the arch IRQ vector handler.

On arm64, it is not possible to know if the IRQ vector handler was
called because of an NMI before acknowledging the interrupt. However, It
is possible to know whether normal interrupts could be taken in the
interrupted context (i.e. if taking an NMI in that context could
introduce a potential race condition).

When interrupting a context with IRQs disabled, call nmi_enter() as soon
as possible. In contexts with IRQs enabled, defer this to the interrupt
controller, which is in a better position to know if an interrupt taken
is an NMI.

Fixes: bc3c03ccb4 ("arm64: Enable the support of pseudo-NMIs")
Cc: <stable@vger.kernel.org> # 5.1.x-
Cc: Will Deacon <will.deacon@arm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Julien Thierry <julien.thierry@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2019-06-21 15:49:58 +01:00
..
affinity.c genirq/affinity: Remove the leftovers of the original set support 2019-02-18 11:21:29 +01:00
autoprobe.c
chip.c genirq: Introduce irq_chip_{request,release}_resource_parent() apis 2019-05-01 10:41:38 +01:00
cpuhotplug.c
debug.h
debugfs.c treewide: Switch printk users from %pf and %pF to %ps and %pS, respectively 2019-04-09 14:19:06 +02:00
devres.c genirq/devres: Use struct_size() in devm_kzalloc() 2019-04-16 21:54:03 +02:00
dummychip.c
generic-chip.c
handle.c treewide: Switch printk users from %pf and %pF to %ps and %pS, respectively 2019-04-09 14:19:06 +02:00
internals.h irqchip updates for Linux 5.1 2019-02-23 10:53:31 +01:00
ipi.c genirq: Fix various typos in comments 2018-12-18 14:22:28 +01:00
irq_sim.c irq/irq_sim: add irq_set_type() callback 2019-02-19 17:42:28 +01:00
irqdesc.c arm64: Fix interrupt tracing in the presence of NMIs 2019-06-21 15:49:58 +01:00
irqdomain.c irq/irqdomain: Fix typo in the comment on top of __irq_domain_alloc_irqs() 2019-04-29 15:45:00 +01:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile
manage.c Printk changes for 5.2 2019-05-07 09:18:12 -07:00
matrix.c genirq/matrix: Improve target CPU selection for managed interrupts. 2018-11-06 23:20:13 +01:00
migration.c
msi.c genirq/core: Introduce struct irq_affinity_desc 2018-12-19 11:32:08 +01:00
pm.c
proc.c
resend.c
settings.h
spurious.c treewide: Switch printk users from %pf and %pF to %ps and %pS, respectively 2019-04-09 14:19:06 +02:00
timings.c genirq/timings: Add array suffix computation code 2019-04-05 22:51:29 +02:00