Skip to content

Commit

Permalink
arm64/sysreg: Move POR_EL0_INIT to asm/por.h
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kevin Brodsky authored and Catalin Marinas committed Mar 10, 2025
1 parent 83d78bb commit 650701e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 2 additions & 0 deletions arch/arm64/include/asm/por.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 0 additions & 3 deletions arch/arm64/include/asm/sysreg.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down

0 comments on commit 650701e

Please sign in to comment.