]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - arch/arm64/kernel/entry.S
arm64: entry: refine comment of stack overflow check
[linux.git] / arch / arm64 / kernel / entry.S
index d440a2a517291a737c00b9c7d2c60d7f92250947..7c6a0a41676f83ce0f40cfc1e3197a03e6ca3570 100644 (file)
@@ -76,7 +76,8 @@ alternative_else_nop_endif
 #ifdef CONFIG_VMAP_STACK
        /*
         * Test whether the SP has overflowed, without corrupting a GPR.
-        * Task and IRQ stacks are aligned to (1 << THREAD_SHIFT).
+        * Task and IRQ stacks are aligned so that SP & (1 << THREAD_SHIFT)
+        * should always be zero.
         */
        add     sp, sp, x0                      // sp' = sp + x0
        sub     x0, sp, x0                      // x0' = sp' - x0 = (sp + x0) - x0 = sp
@@ -269,8 +270,10 @@ alternative_else_nop_endif
 alternative_if ARM64_HAS_IRQ_PRIO_MASKING
        ldr     x20, [sp, #S_PMR_SAVE]
        msr_s   SYS_ICC_PMR_EL1, x20
-       /* Ensure priority change is seen by redistributor */
-       dsb     sy
+       mrs_s   x21, SYS_ICC_CTLR_EL1
+       tbz     x21, #6, .L__skip_pmr_sync\@    // Check for ICC_CTLR_EL1.PMHE
+       dsb     sy                              // Ensure priority change is seen by redistributor
+.L__skip_pmr_sync\@:
 alternative_else_nop_endif
 
        ldp     x21, x22, [sp, #S_PC]           // load ELR, SPSR