diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2021-02-10 00:40:46 +0100 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2021-02-10 23:34:14 +0100 |
commit | a0cfc74d0b00c5201e1c09e28b2dc01c8088f809 (patch) | |
tree | 9ff9e88a19413f05a00593a2e8e2d3f9dd7bff8f /arch/x86/include/asm/idtentry.h | |
parent | 3c5e0267ec3e6ed7d3f1793273cbf0beb4f86a74 (diff) |
x86/irq: Provide macro for inlining irq stack switching
The effort to make the ASM entry code slim and unified moved the irq stack
switching out of the low level ASM code so that the whole return from
interrupt work and state handling can be done in C and the ASM code just
handles the low level details of entry and exit.
This ended up being a suboptimal implementation for various reasons
(including tooling). The main pain points are:
- The indirect call which is expensive thanks to retpoline
- The inability to stay on the irq stack for softirq processing on return
from interrupt
- The fact that the stack switching code ends up being an easy to target
exploit gadget.
Prepare for inlining the stack switching logic into the C entry points by
providing a ASM macro which contains the guts of the switching mechanism:
1) Store RSP at the top of the irq stack
2) Switch RSP to the irq stack
3) Invoke code
4) Pop the original RSP back
Document the unholy asm() logic while at it to reduce the amount of head
scratching required a half year from now.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20210210002512.578371068@linutronix.de
Diffstat (limited to 'arch/x86/include/asm/idtentry.h')
0 files changed, 0 insertions, 0 deletions