1
0
Fork 0
freescale-linux-fslc/arch
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
..
alpha treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
arc treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
arm SPDX fixes for 5.2-rc3, round 2 2019-06-02 10:22:38 -07:00
arm64 arm64: Fix interrupt tracing in the presence of NMIs 2019-06-21 15:49:58 +01:00
c6x treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
csky treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
h8300 treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
hexagon treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
ia64 SPDX update for 5.2-rc3, round 1 2019-05-31 08:34:32 -07:00
m68k treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
microblaze treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
mips Fixes for PPC and s390. 2019-06-02 10:19:39 -07:00
nds32 treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
nios2 treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
openrisc treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
parisc arch/parisc/configs/c8000_defconfig: remove obsoleted CONFIG_DEBUG_SLAB_LEAK 2019-06-01 15:51:31 -07:00
powerpc ptrace: move clearing of TIF_SYSCALL_EMU flag to core 2019-06-05 17:51:17 +01:00
riscv treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
s390 Fixes for PPC and s390. 2019-06-02 10:19:39 -07:00
sh treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 211 2019-05-30 11:29:53 -07:00
sparc treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
um treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
unicore32 treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
x86 ptrace: move clearing of TIF_SYSCALL_EMU flag to core 2019-06-05 17:51:17 +01:00
xtensa treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
.gitignore
Kconfig Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2019-05-16 11:00:20 -07:00