entry: Provide generic interrupt entry/exit code
authorThomas Gleixner <tglx@linutronix.de>
Wed, 22 Jul 2020 21:59:58 +0000 (23:59 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 24 Jul 2020 12:59:04 +0000 (14:59 +0200)
commita5497bab5f72dce38a259a53fd3ac1239a7ecf40
tree8447dfe5dae8cbbf7df6de8ccc1bdf65cf2fa840
parenta9f3a74a29af095f3e1b89e9176f8127912ae0f0
entry: Provide generic interrupt entry/exit code

Like the syscall entry/exit code interrupt/exception entry after the real
low level ASM bits should not be different accross architectures.

Provide a generic version based on the x86 code.

irqentry_enter() is called after the low level entry code and
irqentry_exit() must be invoked right before returning to the low level
code which just contains the actual return logic. The code before
irqentry_enter() and irqentry_exit() must not be instrumented. Code after
irqentry_enter() and before irqentry_exit() can be instrumented.

irqentry_enter() invokes irqentry_enter_from_user_mode() if the
interrupt/exception came from user mode. If if entered from kernel mode it
handles the kernel mode variant of establishing state for lockdep, RCU and
tracing depending on the kernel context it interrupted (idle, non-idle).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20200722220519.723703209@linutronix.de
include/linux/entry-common.h
kernel/entry/common.c