[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250219164029.2309119-4-kevin.brodsky@arm.com>
Date: Wed, 19 Feb 2025 16:40:29 +0000
From: Kevin Brodsky <kevin.brodsky@....com>
To: linux-arm-kernel@...ts.infradead.org
Cc: linux-kernel@...r.kernel.org,
Kevin Brodsky <kevin.brodsky@....com>,
Catalin Marinas <catalin.marinas@....com>,
Joey Gouly <joey.gouly@....com>,
Will Deacon <will@...nel.org>
Subject: [PATCH 3/3] 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@....com>
---
arch/arm64/include/asm/por.h | 2 ++
arch/arm64/include/asm/sysreg.h | 3 ---
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/include/asm/por.h b/arch/arm64/include/asm/por.h
index e6bf00bd0500..d913d5b529e4 100644
--- a/arch/arm64/include/asm/por.h
+++ b/arch/arm64/include/asm/por.h
@@ -8,6 +8,8 @@
#include <asm/sysreg.h>
+#define POR_EL0_INIT POR_ELx_PERM_PREP(0, POE_RWX)
+
static inline bool por_elx_allows_read(u64 por, u8 pkey)
{
u8 perm = POR_ELx_PERM_GET(pkey, por);
diff --git a/arch/arm64/include/asm/sysreg.h b/arch/arm64/include/asm/sysreg.h
index 034e0576de5a..e3252f8bb465 100644
--- a/arch/arm64/include/asm/sysreg.h
+++ b/arch/arm64/include/asm/sysreg.h
@@ -1086,9 +1086,6 @@
#define POR_ELx_PERM_GET(idx, reg) (((reg) >> POR_ELx_PERM_SHIFT(idx)) & POE_MASK)
#define POR_ELx_PERM_PREP(idx, perm) (((perm) & POE_MASK) << POR_ELx_PERM_SHIFT(idx))
-/* Initial value for Permission Overlay Extension for EL0 */
-#define POR_EL0_INIT POE_RWX
-
/*
* Definitions for Guarded Control Stack
*/
--
2.47.0
Powered by blists - more mailing lists