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)
200
200
}
201
201
202
202
#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
+ */
203
207
static DEFINE_PER_CPU (unsigned long [OVERFLOW_STACK_SIZE /sizeof (long )],
204
208
overflow_stack )__aligned (16 );
205
209
/*
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.
208
213
*/
209
214
long 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
- }
215
215
216
216
/*
217
217
* A pseudo spinlock to protect the shadow stack from being used by multiple
@@ -222,6 +222,12 @@ asmlinkage unsigned long get_overflow_stack(void)
222
222
*/
223
223
unsigned long spin_shadow_stack ;
224
224
225
+ asmlinkage unsigned long get_overflow_stack (void )
226
+ {
227
+ return (unsigned long )this_cpu_ptr (overflow_stack ) +
228
+ OVERFLOW_STACK_SIZE ;
229
+ }
230
+
225
231
asmlinkage void handle_bad_stack (struct pt_regs * regs )
226
232
{
227
233
unsigned long tsk_stk = (unsigned long )current -> stack ;
You can’t perform that action at this time.
0 commit comments