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

selftests/mm: Define PKEY_UNRESTRICTED for pkey_sighandler_tests

Commit 6e182dc9f268 ("selftests/mm: Use generic pkey register
manipulation") makes use of PKEY_UNRESTRICTED in
pkey_sighandler_tests. The macro has been proposed for addition to
uapi headers [1], but the patch hasn't landed yet.

Define PKEY_UNRESTRICTED in pkey-helpers.h for the time being to fix
the build.

[1] https://lore.kernel.org/all/20241028090715.509527-2-yury.khrustalev@arm.com/

Fixes: 6e182dc9f268 ("selftests/mm: Use generic pkey register manipulation")
Reported-by: Aishwarya TCV <aishwarya.tcv@arm.com>
Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com>
Link: https://lore.kernel.org/r/20241107131640.650703-1-kevin.brodsky@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>

authored by

Kevin Brodsky and committed by
Catalin Marinas
db64dfff 49f59573

+7
+7
tools/testing/selftests/mm/pkey-helpers.h
··· 112 112 #define PKEY_MASK (PKEY_DISABLE_ACCESS | PKEY_DISABLE_WRITE) 113 113 #endif 114 114 115 + /* 116 + * FIXME: Remove once the generic PKEY_UNRESTRICTED definition is merged. 117 + */ 118 + #ifndef PKEY_UNRESTRICTED 119 + #define PKEY_UNRESTRICTED 0x0 120 + #endif 121 + 115 122 #ifndef set_pkey_bits 116 123 static inline u64 set_pkey_bits(u64 reg, int pkey, u64 flags) 117 124 {