aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv/include/asm
diff options
context:
space:
mode:
authorSami Tolvanen <[email protected]>2023-09-27 22:48:03 +0000
committerPalmer Dabbelt <[email protected]>2023-10-27 14:43:09 -0700
commitc40fef858d002fb027033c572ac8bdf8756a2c6b (patch)
tree86f759f14b79e2ee70406408bfa50ebafd9a8a92 /arch/riscv/include/asm
parentd1584d791a297aa8ed93503382a682a6ecfc4218 (diff)
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 <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
Diffstat (limited to 'arch/riscv/include/asm')
-rw-r--r--arch/riscv/include/asm/scs.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/riscv/include/asm/scs.h b/arch/riscv/include/asm/scs.h
index 94726ea773e3..0e45db78b24b 100644
--- a/arch/riscv/include/asm/scs.h
+++ b/arch/riscv/include/asm/scs.h
@@ -13,6 +13,11 @@
XIP_FIXUP_OFFSET gp
.endm
+/* Load the per-CPU IRQ shadow call stack to gp. */
+.macro scs_load_irq_stack tmp
+ load_per_cpu gp, irq_shadow_call_stack_ptr, \tmp
+.endm
+
/* Load task_scs_sp(current) to gp. */
.macro scs_load_current
REG_L gp, TASK_TI_SCS_SP(tp)
@@ -34,6 +39,8 @@ _skip_scs:
.macro scs_load_init_stack
.endm
+.macro scs_load_irq_stack tmp
+.endm
.macro scs_load_current
.endm
.macro scs_load_current_if_task_changed prev