Skip to content

Commit bdf3f41

Browse files
LeviYeoReumctmarinas
authored andcommitted
arm64: Fix cleared E0POE bit after cpu_suspend()/resume()
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: bf83dae ("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>
1 parent 5fcd551 commit bdf3f41

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

arch/arm64/include/asm/suspend.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#ifndef __ASM_SUSPEND_H
33
#define __ASM_SUSPEND_H
44

5-
#define NR_CTX_REGS 13
5+
#define NR_CTX_REGS 14
66
#define NR_CALLEE_SAVED_REGS 12
77

88
/*

arch/arm64/mm/proc.S

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ SYM_FUNC_START(cpu_do_suspend)
110110
* call stack.
111111
*/
112112
str x18, [x0, #96]
113+
alternative_if ARM64_HAS_TCR2
114+
mrs x2, REG_TCR2_EL1
115+
str x2, [x0, #104]
116+
alternative_else_nop_endif
113117
ret
114118
SYM_FUNC_END(cpu_do_suspend)
115119

@@ -144,6 +148,10 @@ SYM_FUNC_START(cpu_do_resume)
144148
msr tcr_el1, x8
145149
msr vbar_el1, x9
146150
msr mdscr_el1, x10
151+
alternative_if ARM64_HAS_TCR2
152+
ldr x2, [x0, #104]
153+
msr REG_TCR2_EL1, x2
154+
alternative_else_nop_endif
147155

148156
msr sctlr_el1, x12
149157
set_this_cpu_offset x13

0 commit comments

Comments
 (0)