[PATCH RFC v9 08/25] arm64: Initialize POR_EL1 register on cpu_resume()
Linu Cherian
linu.cherian at arm.com
Wed Sep 2 22:56:29 PDT 2026
Kevin,
On Tue, Aug 18, 2026 at 03:08:50PM +0100, Kevin Brodsky wrote:
> From: Yeoreum Yun <yeoreum.yun at arm.com>
>
> The POR_EL1 register is reset to an unknown value after cpu_suspend().
> Since POR_EL1 always holds POR_EL1_INIT when entering cpu_suspend(),
> initialize POR_EL1 with POR_EL1_INIT before cpu_do_resume().
>
> Signed-off-by: Yeoreum Yun <yeoreum.yun at arm.com>
> Signed-off-by: Kevin Brodsky <kevin.brodsky at arm.com>
> ---
> arch/arm64/kernel/sleep.S | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/arch/arm64/kernel/sleep.S b/arch/arm64/kernel/sleep.S
> index f093cdf71be1..e0a6ad85cd24 100644
> --- a/arch/arm64/kernel/sleep.S
> +++ b/arch/arm64/kernel/sleep.S
> @@ -3,6 +3,7 @@
> #include <linux/linkage.h>
> #include <asm/asm-offsets.h>
> #include <asm/assembler.h>
> +#include <asm/kpkeys.h>
> #include <asm/smp.h>
>
> .text
> @@ -134,6 +135,17 @@ SYM_FUNC_START(_cpu_resume)
> /* load sp from context */
> ldr x2, [x0, #CPU_CTX_SP]
> mov sp, x2
> +
> +#ifdef CONFIG_ARM64_POE
> +alternative_if_not ARM64_HAS_S1POE
> + b .Lskip_por_set
> +alternative_else_nop_endif
> + mov_q x2, POR_EL1_INIT
> + msr_s SYS_POR_EL1, x2
> + /* isb can be skipped since cpu_do_resume() will do it. */
> +.Lskip_por_set:
> +#endif /* CONFIG_ARM64_POE */
Would it be better to move this under__cpu_setup ?
--
Linu Cherian
More information about the linux-arm-kernel
mailing list