Skip to content

Commit de85804

Browse files
Heyi Guoctmarinas
authored andcommitted
arm64: entry: refine comment of stack overflow check
Stack overflow checking can be done by testing sp & (1 << THREAD_SHIFT) only for the stacks are aligned to (2 << THREAD_SHIFT) with size of (1 << THREAD_SIZE), and this is the case when CONFIG_VMAP_STACK is set. Fix the code comment to avoid confusion. Cc: Will Deacon <[email protected]> Acked-by: Mark Rutland <[email protected]> Signed-off-by: Heyi Guo <[email protected]> [[email protected]: Updated comment following Mark's suggestion] Signed-off-by: Catalin Marinas <[email protected]>
1 parent 70927d0 commit de85804

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/arm64/kernel/entry.S

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ alternative_else_nop_endif
7676
#ifdef CONFIG_VMAP_STACK
7777
/*
7878
* Test whether the SP has overflowed, without corrupting a GPR.
79-
* Task and IRQ stacks are aligned to (1 << THREAD_SHIFT).
79+
* Task and IRQ stacks are aligned so that SP & (1 << THREAD_SHIFT)
80+
* should always be zero.
8081
*/
8182
add sp, sp, x0 // sp' = sp + x0
8283
sub x0, sp, x0 // x0' = sp' - x0 = (sp + x0) - x0 = sp

0 commit comments

Comments
 (0)