mirror of
https://github.com/torvalds/linux.git
synced 2026-04-27 11:02:31 -04:00
riscv: Use separate IRQ shadow call stacks
When both CONFIG_IRQ_STACKS and SCS are enabled, also use a separate per-CPU shadow call stack. Signed-off-by: Sami Tolvanen <samitolvanen@google.com> Tested-by: Nathan Chancellor <nathan@kernel.org> Link: https://lore.kernel.org/r/20230927224757.1154247-13-samitolvanen@google.com Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
This commit is contained in:
committed by
Palmer Dabbelt
parent
d1584d791a
commit
c40fef858d
@@ -237,12 +237,19 @@ SYM_FUNC_START(call_on_irq_stack)
|
||||
REG_S s0, STACKFRAME_FP(sp)
|
||||
addi s0, sp, STACKFRAME_SIZE_ON_STACK
|
||||
|
||||
/* Switch to the per-CPU shadow call stack */
|
||||
scs_save_current
|
||||
scs_load_irq_stack t0
|
||||
|
||||
/* Switch to the per-CPU IRQ stack and call the handler */
|
||||
load_per_cpu t0, irq_stack_ptr, t1
|
||||
li t1, IRQ_STACK_SIZE
|
||||
add sp, t0, t1
|
||||
jalr a1
|
||||
|
||||
/* Switch back to the thread shadow call stack */
|
||||
scs_load_current
|
||||
|
||||
/* Switch back to the thread stack and restore ra and s0 */
|
||||
addi sp, s0, -STACKFRAME_SIZE_ON_STACK
|
||||
REG_L ra, STACKFRAME_RA(sp)
|
||||
|
||||
Reference in New Issue
Block a user