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

selftests/mm: rename pkey register macro

PKEY_ALLOW_ALL is meant to represent the pkey register value that allows
all accesses (enables all pkeys). However its current naming suggests
that the value applies to *one* key only (like PKEY_DISABLE_ACCESS for
instance).

Rename PKEY_ALLOW_ALL to PKEY_REG_ALLOW_ALL to avoid such
misunderstanding. This is consistent with the PKEY_REG_ALLOW_NONE macro
introduced by commit 6e182dc9f268 ("selftests/mm: Use generic pkey
register manipulation").

Link: https://lkml.kernel.org/r/20241209095019.1732120-13-kevin.brodsky@arm.com
Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com>
Cc: Aruna Ramakrishna <aruna.ramakrishna@oracle.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Joey Gouly <joey.gouly@arm.com>
Cc: Keith Lucas <keith.lucas@oracle.com>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Kevin Brodsky and committed by
Andrew Morton
28501aa1 50910acd

+3 -3
+1 -1
tools/testing/selftests/mm/pkey-arm64.h
··· 30 30 #define NR_PKEYS 8 31 31 #define NR_RESERVED_PKEYS 1 /* pkey-0 */ 32 32 33 - #define PKEY_ALLOW_ALL 0x77777777 33 + #define PKEY_REG_ALLOW_ALL 0x77777777 34 34 #define PKEY_REG_ALLOW_NONE 0x0 35 35 36 36 #define PKEY_BITS_PER_PKEY 4
+2 -2
tools/testing/selftests/mm/protection_keys.c
··· 396 396 /* restore access and let the faulting instruction continue */ 397 397 pkey_access_allow(siginfo_pkey); 398 398 #elif defined(__aarch64__) 399 - aarch64_write_signal_pkey(uctxt, PKEY_ALLOW_ALL); 399 + aarch64_write_signal_pkey(uctxt, PKEY_REG_ALLOW_ALL); 400 400 #endif /* arch */ 401 401 pkey_faults++; 402 402 dprintf1("<<<<==================================================\n"); ··· 842 842 */ 843 843 if (__read_pkey_reg() != 0) 844 844 #elif defined(__aarch64__) 845 - if (__read_pkey_reg() != PKEY_ALLOW_ALL) 845 + if (__read_pkey_reg() != PKEY_REG_ALLOW_ALL) 846 846 #else 847 847 if (__read_pkey_reg() != shadow_pkey_reg) 848 848 #endif /* arch */