Commit 28501aa1 authored by Kevin Brodsky's avatar Kevin Brodsky Committed by Andrew Morton
Browse files

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 6e182dc9 ("selftests/mm: Use generic pkey
register manipulation").

Link: https://lkml.kernel.org/r/20241209095019.1732120-13-kevin.brodsky@arm.com


Signed-off-by: default avatarKevin 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: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 50910acd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@
#define NR_PKEYS		8
#define NR_RESERVED_PKEYS	1 /* pkey-0 */

#define PKEY_ALLOW_ALL		0x77777777
#define PKEY_REG_ALLOW_ALL	0x77777777
#define PKEY_REG_ALLOW_NONE	0x0

#define PKEY_BITS_PER_PKEY	4
+2 −2
Original line number Diff line number Diff line
@@ -396,7 +396,7 @@ static void signal_handler(int signum, siginfo_t *si, void *vucontext)
	/* restore access and let the faulting instruction continue */
	pkey_access_allow(siginfo_pkey);
#elif defined(__aarch64__)
	aarch64_write_signal_pkey(uctxt, PKEY_ALLOW_ALL);
	aarch64_write_signal_pkey(uctxt, PKEY_REG_ALLOW_ALL);
#endif /* arch */
	pkey_faults++;
	dprintf1("<<<<==================================================\n");
@@ -842,7 +842,7 @@ void expected_pkey_fault(int pkey)
	 */
	if (__read_pkey_reg() != 0)
#elif defined(__aarch64__)
	if (__read_pkey_reg() != PKEY_ALLOW_ALL)
	if (__read_pkey_reg() != PKEY_REG_ALLOW_ALL)
#else
	if (__read_pkey_reg() != shadow_pkey_reg)
#endif /* arch */