Skip to content

Commit 878ed4a

Browse files
committed
arm64/sysreg: Rename POE_RXW to POE_RWX
JIRA: https://issues.redhat.com/browse/RHEL-101059 commit 83d78bb Author: Kevin Brodsky <kevin.brodsky@arm.com> Date: Wed, 19 Feb 2025 16:40:28 +0000 It is customary to list R, W, X permissions in that order. In fact this is already the case for PIE constants (PIE_RWX). Rename POE_RXW accordingly, as well as POE_XW (currently unused). While at it also swap the W/X lines in compute_s1_overlay_permissions() to follow the R, W, X order. Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com> Link: https://lore.kernel.org/r/20250219164029.2309119-3-kevin.brodsky@arm.com Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Mark Salter <msalter@redhat.com>
1 parent 2ab08f8 commit 878ed4a

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

arch/arm64/include/asm/sysreg.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,8 +1048,8 @@
10481048
#define POE_RX UL(0x3)
10491049
#define POE_W UL(0x4)
10501050
#define POE_RW UL(0x5)
1051-
#define POE_XW UL(0x6)
1052-
#define POE_RXW UL(0x7)
1051+
#define POE_WX UL(0x6)
1052+
#define POE_RWX UL(0x7)
10531053
#define POE_MASK UL(0xf)
10541054

10551055
#define POR_ELx_BITS_PER_IDX 4
@@ -1058,7 +1058,7 @@
10581058
#define POR_ELx_PERM_PREP(idx, perm) (((perm) & POE_MASK) << POR_ELx_PERM_SHIFT(idx))
10591059

10601060
/* Initial value for Permission Overlay Extension for EL0 */
1061-
#define POR_EL0_INIT POE_RXW
1061+
#define POR_EL0_INIT POE_RWX
10621062

10631063
/*
10641064
* Definitions for Guarded Control Stack

arch/arm64/kernel/signal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ static void save_reset_user_access_state(struct user_access_state *ua_state)
9191
u64 por_enable_all = 0;
9292

9393
for (int pkey = 0; pkey < arch_max_pkey(); pkey++)
94-
por_enable_all |= POR_ELx_PERM_PREP(pkey, POE_RXW);
94+
por_enable_all |= POR_ELx_PERM_PREP(pkey, POE_RWX);
9595

9696
ua_state->por_el0 = read_sysreg_s(SYS_POR_EL0);
9797
write_sysreg_s(por_enable_all, SYS_POR_EL0);

arch/arm64/kvm/at.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,22 +1090,22 @@ static void compute_s1_overlay_permissions(struct kvm_vcpu *vcpu,
10901090
break;
10911091
}
10921092

1093-
if (pov_perms & ~POE_RXW)
1093+
if (pov_perms & ~POE_RWX)
10941094
pov_perms = POE_NONE;
10951095

10961096
if (wi->poe && wr->pov) {
10971097
wr->pr &= pov_perms & POE_R;
1098-
wr->px &= pov_perms & POE_X;
10991098
wr->pw &= pov_perms & POE_W;
1099+
wr->px &= pov_perms & POE_X;
11001100
}
11011101

1102-
if (uov_perms & ~POE_RXW)
1102+
if (uov_perms & ~POE_RWX)
11031103
uov_perms = POE_NONE;
11041104

11051105
if (wi->e0poe && wr->uov) {
11061106
wr->ur &= uov_perms & POE_R;
1107-
wr->ux &= uov_perms & POE_X;
11081107
wr->uw &= uov_perms & POE_W;
1108+
wr->ux &= uov_perms & POE_X;
11091109
}
11101110
}
11111111

arch/arm64/mm/mmu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1558,7 +1558,7 @@ void __cpu_replace_ttbr1(pgd_t *pgdp, bool cnp)
15581558
#ifdef CONFIG_ARCH_HAS_PKEYS
15591559
int arch_set_user_pkey_access(struct task_struct *tsk, int pkey, unsigned long init_val)
15601560
{
1561-
u64 new_por = POE_RXW;
1561+
u64 new_por;
15621562
u64 old_por;
15631563

15641564
if (!system_supports_poe())
@@ -1573,7 +1573,7 @@ int arch_set_user_pkey_access(struct task_struct *tsk, int pkey, unsigned long i
15731573
return -EINVAL;
15741574

15751575
/* Set the bits we need in POR: */
1576-
new_por = POE_RXW;
1576+
new_por = POE_RWX;
15771577
if (init_val & PKEY_DISABLE_WRITE)
15781578
new_por &= ~POE_W;
15791579
if (init_val & PKEY_DISABLE_ACCESS)

0 commit comments

Comments
 (0)