File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed
Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -200,18 +200,18 @@ void __init trap_init(void)
200200}
201201
202202#ifdef CONFIG_VMAP_STACK
203+ /*
204+ * Extra stack space that allows us to provide panic messages when the kernel
205+ * has overflowed its stack.
206+ */
203207static DEFINE_PER_CPU (unsigned long [OVERFLOW_STACK_SIZE /sizeof (long )],
204208 overflow_stack )__aligned (16 );
205209/*
206- * shadow stack, handled_ kernel_ stack_ overflow(in kernel/entry.S) is used
207- * to get per-cpu overflow stack(get_overflow_stack).
210+ * A temporary stack for use by handle_kernel_stack_overflow. This is used so
211+ * we can call into C code to get the per-hart overflow stack. Usage of this
212+ * stack must be protected by spin_shadow_stack.
208213 */
209214long shadow_stack [SHADOW_OVERFLOW_STACK_SIZE /sizeof (long )] __aligned (16 );
210- asmlinkage unsigned long get_overflow_stack (void )
211- {
212- return (unsigned long )this_cpu_ptr (overflow_stack ) +
213- OVERFLOW_STACK_SIZE ;
214- }
215215
216216/*
217217 * A pseudo spinlock to protect the shadow stack from being used by multiple
@@ -222,6 +222,12 @@ asmlinkage unsigned long get_overflow_stack(void)
222222 */
223223unsigned long spin_shadow_stack ;
224224
225+ asmlinkage unsigned long get_overflow_stack (void )
226+ {
227+ return (unsigned long )this_cpu_ptr (overflow_stack ) +
228+ OVERFLOW_STACK_SIZE ;
229+ }
230+
225231asmlinkage void handle_bad_stack (struct pt_regs * regs )
226232{
227233 unsigned long tsk_stk = (unsigned long )current -> stack ;
You can’t perform that action at this time.
0 commit comments