Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arm64/sysreg: Move POR_EL0_INIT to asm/por.h

The value of POR_EL0_INIT is not architectural, it is a software
decision. Since we have a dedicated header for POR_ELx, we might as
well define POR_EL0_INIT there.

While at it also define POR_EL0_INIT using POR_ELx_PERM_PREP(),
making it clearer that we are setting permissions for POIndex/pkey
0.

Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com>
Link: https://lore.kernel.org/r/20250219164029.2309119-4-kevin.brodsky@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>

authored by

Kevin Brodsky and committed by
Catalin Marinas
650701e4 83d78bbf

+2 -3
+2
arch/arm64/include/asm/por.h
··· 8 8 9 9 #include <asm/sysreg.h> 10 10 11 + #define POR_EL0_INIT POR_ELx_PERM_PREP(0, POE_RWX) 12 + 11 13 static inline bool por_elx_allows_read(u64 por, u8 pkey) 12 14 { 13 15 u8 perm = POR_ELx_PERM_GET(pkey, por);
-3
arch/arm64/include/asm/sysreg.h
··· 1086 1086 #define POR_ELx_PERM_GET(idx, reg) (((reg) >> POR_ELx_PERM_SHIFT(idx)) & POE_MASK) 1087 1087 #define POR_ELx_PERM_PREP(idx, perm) (((perm) & POE_MASK) << POR_ELx_PERM_SHIFT(idx)) 1088 1088 1089 - /* Initial value for Permission Overlay Extension for EL0 */ 1090 - #define POR_EL0_INIT POE_RWX 1091 - 1092 1089 /* 1093 1090 * Definitions for Guarded Control Stack 1094 1091 */