arm64: entry: fix EL1 debug transitions
authorMark Rutland <mark.rutland@arm.com>
Mon, 30 Nov 2020 11:59:50 +0000 (11:59 +0000)
committerWill Deacon <will@kernel.org>
Mon, 30 Nov 2020 12:11:38 +0000 (12:11 +0000)
commit2a9b3e6ac69a8bf177d8496a11e749e2dc72fa22
tree1e46ddc4755df1e20d603a3c47cfba19148e9a7b
parentf0cd5ac1e4c53cb691b3ed3cda1031e1c42153e2
arm64: entry: fix EL1 debug transitions

In debug_exception_enter() and debug_exception_exit() we trace hardirqs
on/off while RCU isn't guaranteed to be watching, and we don't save and
restore the hardirq state, and so may return with this having changed.

Handle this appropriately with new entry/exit helpers which do the bare
minimum to ensure this is appropriately maintained, without marking
debug exceptions as NMIs. These are placed in entry-common.c with the
other entry/exit helpers.

In future we'll want to reconsider whether some debug exceptions should
be NMIs, but this will require a significant refactoring, and for now
this should prevent issues with lockdep and RCU.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marins <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
Cc: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20201130115950.22492-12-mark.rutland@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/kernel/entry-common.c
arch/arm64/mm/fault.c