]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
arm64: Fix cleared E0POE bit after cpu_suspend()/resume()
authorYeoreum Yun <yeoreum.yun@arm.com>
Wed, 7 Jan 2026 16:21:15 +0000 (16:21 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 17 Jan 2026 15:31:15 +0000 (16:31 +0100)
commit bdf3f4176092df5281877cacf42f843063b4784d upstream.

TCR2_ELx.E0POE is set during smp_init().
However, this bit is not reprogrammed when the CPU enters suspension and
later resumes via cpu_resume(), as __cpu_setup() does not re-enable E0POE
and there is no save/restore logic for the TCR2_ELx system register.

As a result, the E0POE feature no longer works after cpu_resume().

To address this, save and restore TCR2_EL1 in the cpu_suspend()/cpu_resume()
path, rather than adding related logic to __cpu_setup(), taking into account
possible future extensions of the TCR2_ELx feature.

Fixes: bf83dae90fbc ("arm64: enable the Permission Overlay Extension for EL0")
Cc: <stable@vger.kernel.org> # 6.12.x
Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Reviewed-by: Kevin Brodsky <kevin.brodsky@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/include/asm/suspend.h
arch/arm64/mm/proc.S

index 0cde2f473971e87cd355ce2e56451c8213fcd02a..eb60c973555305cac5720d2246ab1b787868e094 100644 (file)
@@ -2,7 +2,7 @@
 #ifndef __ASM_SUSPEND_H
 #define __ASM_SUSPEND_H
 
-#define NR_CTX_REGS 13
+#define NR_CTX_REGS 14
 #define NR_CALLEE_SAVED_REGS 12
 
 /*
index 8abdc7fed3210d03c2d7fc99b7708d627e8228be..7afbece885a30b881629a0758c282037e67d87f8 100644 (file)
@@ -100,6 +100,10 @@ SYM_FUNC_START(cpu_do_suspend)
         * call stack.
         */
        str     x18, [x0, #96]
+alternative_if ARM64_HAS_TCR2
+       mrs     x2, REG_TCR2_EL1
+       str     x2, [x0, #104]
+alternative_else_nop_endif
        ret
 SYM_FUNC_END(cpu_do_suspend)
 
@@ -134,6 +138,10 @@ SYM_FUNC_START(cpu_do_resume)
        msr     tcr_el1, x8
        msr     vbar_el1, x9
        msr     mdscr_el1, x10
+alternative_if ARM64_HAS_TCR2
+       ldr     x2, [x0, #104]
+       msr     REG_TCR2_EL1, x2
+alternative_else_nop_endif
 
        msr     sctlr_el1, x12
        set_this_cpu_offset x13