Linux Kernel Selftest development
 help / color / mirror / Atom feed
* [PATCH] selftests/mm: Define PKEY_UNRESTRICTED for pkey_sighandler_tests
@ 2024-11-07 13:16 Kevin Brodsky
  2024-11-07 16:50 ` Shuah Khan
  2024-11-08 11:07 ` Catalin Marinas
  0 siblings, 2 replies; 6+ messages in thread
From: Kevin Brodsky @ 2024-11-07 13:16 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: catalin.marinas, dave.hansen, yury.khrustalev, will,
	linux-kselftest, Kevin Brodsky, Aishwarya TCV

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>
---

Based on arm64 for-next/pkey-signal (49f59573e9e0).

---
 tools/testing/selftests/mm/pkey-helpers.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/testing/selftests/mm/pkey-helpers.h b/tools/testing/selftests/mm/pkey-helpers.h
index 9ab6a3ee153b..319f5b6b7132 100644
--- a/tools/testing/selftests/mm/pkey-helpers.h
+++ b/tools/testing/selftests/mm/pkey-helpers.h
@@ -112,6 +112,10 @@ void record_pkey_malloc(void *ptr, long size, int prot);
 #define PKEY_MASK	(PKEY_DISABLE_ACCESS | PKEY_DISABLE_WRITE)
 #endif
 
+#ifndef PKEY_UNRESTRICTED
+#define PKEY_UNRESTRICTED 0x0
+#endif
+
 #ifndef set_pkey_bits
 static inline u64 set_pkey_bits(u64 reg, int pkey, u64 flags)
 {
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-11-08 11:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-07 13:16 [PATCH] selftests/mm: Define PKEY_UNRESTRICTED for pkey_sighandler_tests Kevin Brodsky
2024-11-07 16:50 ` Shuah Khan
2024-11-07 18:00   ` Catalin Marinas
2024-11-07 21:26     ` Shuah Khan
2024-11-07 21:34       ` Catalin Marinas
2024-11-08 11:07 ` Catalin Marinas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox