* [PATCH] selftests/mm: remove the local PKEY_UNRESTRICTED fallback
@ 2026-08-18 11:49 Hemanth Selam
2026-08-18 13:11 ` David Hildenbrand (Arm)
2026-08-19 7:47 ` [PATCH v2] " Hemanth Selam
0 siblings, 2 replies; 8+ messages in thread
From: Hemanth Selam @ 2026-08-18 11:49 UTC (permalink / raw)
To: Andrew Morton, David Hildenbrand, Shuah Khan
Cc: Yury Khrustalev, Kevin Brodsky, Lorenzo Stoakes, Liam R . Howlett,
Vlastimil Babka, Mike Rapoport, Suren Baghdasaryan, Michal Hocko,
linux-mm, linux-kselftest, linux-kernel, Hemanth Selam
pkey-helpers.h defines PKEY_UNRESTRICTED itself when the macro is not
already known, a stopgap from when the generic definition was still
under review. It has been merged since, commit 6d61527d931b ("mm/pkey:
Add PKEY_UNRESTRICTED macro"), and pkey-helpers.h already includes
<linux/mman.h>, so the guard is never taken. Honour the FIXME and drop
it.
The mm selftests build against the headers of the kernel source, see
Documentation/dev-tools/kselftest.rst. Building them without "make
headers", against system headers predating the macro, now fails to
compile instead of quietly falling back.
No functional change intended.
Signed-off-by: Hemanth Selam <hemanth.selam@gmail.com>
---
tools/testing/selftests/mm/pkey-helpers.h | 7 -------
1 file changed, 7 deletions(-)
diff --git a/tools/testing/selftests/mm/pkey-helpers.h b/tools/testing/selftests/mm/pkey-helpers.h
index 2c377f4e9df1..626c2e1655dc 100644
--- a/tools/testing/selftests/mm/pkey-helpers.h
+++ b/tools/testing/selftests/mm/pkey-helpers.h
@@ -112,13 +112,6 @@ void record_pkey_malloc(void *ptr, long size, int prot);
#define PKEY_MASK (PKEY_DISABLE_ACCESS | PKEY_DISABLE_WRITE)
#endif
-/*
- * FIXME: Remove once the generic PKEY_UNRESTRICTED definition is merged.
- */
-#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.7
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] selftests/mm: remove the local PKEY_UNRESTRICTED fallback
2026-08-18 11:49 [PATCH] selftests/mm: remove the local PKEY_UNRESTRICTED fallback Hemanth Selam
@ 2026-08-18 13:11 ` David Hildenbrand (Arm)
2026-08-18 13:29 ` Lorenzo Stoakes (ARM)
2026-08-19 7:47 ` [PATCH v2] " Hemanth Selam
1 sibling, 1 reply; 8+ messages in thread
From: David Hildenbrand (Arm) @ 2026-08-18 13:11 UTC (permalink / raw)
To: Hemanth Selam, Andrew Morton, Shuah Khan
Cc: Yury Khrustalev, Kevin Brodsky, Lorenzo Stoakes, Liam R . Howlett,
Vlastimil Babka, Mike Rapoport, Suren Baghdasaryan, Michal Hocko,
linux-mm, linux-kselftest, linux-kernel
On 8/18/26 13:49, Hemanth Selam wrote:
> pkey-helpers.h defines PKEY_UNRESTRICTED itself when the macro is not
> already known, a stopgap from when the generic definition was still
> under review. It has been merged since, commit 6d61527d931b ("mm/pkey:
> Add PKEY_UNRESTRICTED macro"), and pkey-helpers.h already includes
> <linux/mman.h>, so the guard is never taken. Honour the FIXME and drop
> it.
>
> The mm selftests build against the headers of the kernel source, see
> Documentation/dev-tools/kselftest.rst. Building them without "make
> headers", against system headers predating the macro, now fails to
> compile instead of quietly falling back.
>
> No functional change intended.
>
> Signed-off-by: Hemanth Selam <hemanth.selam@gmail.com>
> ---
> tools/testing/selftests/mm/pkey-helpers.h | 7 -------
> 1 file changed, 7 deletions(-)
>
> diff --git a/tools/testing/selftests/mm/pkey-helpers.h b/tools/testing/selftests/mm/pkey-helpers.h
> index 2c377f4e9df1..626c2e1655dc 100644
> --- a/tools/testing/selftests/mm/pkey-helpers.h
> +++ b/tools/testing/selftests/mm/pkey-helpers.h
> @@ -112,13 +112,6 @@ void record_pkey_malloc(void *ptr, long size, int prot);
> #define PKEY_MASK (PKEY_DISABLE_ACCESS | PKEY_DISABLE_WRITE)
> #endif
>
> -/*
> - * FIXME: Remove once the generic PKEY_UNRESTRICTED definition is merged.
> - */
> -#ifndef PKEY_UNRESTRICTED
> -#define PKEY_UNRESTRICTED 0x0
> -#endif
> -
> #ifndef set_pkey_bits
> static inline u64 set_pkey_bits(u64 reg, int pkey, u64 flags)
> {
tools/include/uapi/asm-generic/mman-common.h:#define PKEY_UNRESTRICTED 0x0
So that looks good.
But we seem to have the same ifdef also in
tools/testing/selftests/powerpc/include/pkeys.h.
So likely that should be removed as well (after making sure that it compiles?)
--
Cheers,
David
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] selftests/mm: remove the local PKEY_UNRESTRICTED fallback
2026-08-18 13:11 ` David Hildenbrand (Arm)
@ 2026-08-18 13:29 ` Lorenzo Stoakes (ARM)
2026-08-18 14:18 ` David Hildenbrand (Arm)
0 siblings, 1 reply; 8+ messages in thread
From: Lorenzo Stoakes (ARM) @ 2026-08-18 13:29 UTC (permalink / raw)
To: David Hildenbrand (Arm)
Cc: Hemanth Selam, Andrew Morton, Shuah Khan, Yury Khrustalev,
Kevin Brodsky, Liam R . Howlett, Vlastimil Babka, Mike Rapoport,
Suren Baghdasaryan, Michal Hocko, linux-mm, linux-kselftest,
linux-kernel
On Tue, Aug 18, 2026 at 03:11:50PM +0200, David Hildenbrand (Arm) wrote:
> On 8/18/26 13:49, Hemanth Selam wrote:
> > pkey-helpers.h defines PKEY_UNRESTRICTED itself when the macro is not
> > already known, a stopgap from when the generic definition was still
> > under review. It has been merged since, commit 6d61527d931b ("mm/pkey:
> > Add PKEY_UNRESTRICTED macro"), and pkey-helpers.h already includes
> > <linux/mman.h>, so the guard is never taken. Honour the FIXME and drop
> > it.
> >
> > The mm selftests build against the headers of the kernel source, see
> > Documentation/dev-tools/kselftest.rst. Building them without "make
This is incorrect. We explicitly do not have this requirement in mm selftests,
and they're often built without having to do this step and tooling has been
provided _explicitly_ to allow for that, which is why this kind of thing exists
right now.
> > headers", against system headers predating the macro, now fails to
> > compile instead of quietly falling back.
> >
> > No functional change intended.
> >
> > Signed-off-by: Hemanth Selam <hemanth.selam@gmail.com>
> > ---
> > tools/testing/selftests/mm/pkey-helpers.h | 7 -------
> > 1 file changed, 7 deletions(-)
> >
> > diff --git a/tools/testing/selftests/mm/pkey-helpers.h b/tools/testing/selftests/mm/pkey-helpers.h
> > index 2c377f4e9df1..626c2e1655dc 100644
> > --- a/tools/testing/selftests/mm/pkey-helpers.h
> > +++ b/tools/testing/selftests/mm/pkey-helpers.h
> > @@ -112,13 +112,6 @@ void record_pkey_malloc(void *ptr, long size, int prot);
> > #define PKEY_MASK (PKEY_DISABLE_ACCESS | PKEY_DISABLE_WRITE)
> > #endif
> >
> > -/*
> > - * FIXME: Remove once the generic PKEY_UNRESTRICTED definition is merged.
> > - */
> > -#ifndef PKEY_UNRESTRICTED
> > -#define PKEY_UNRESTRICTED 0x0
> > -#endif
> > -
> > #ifndef set_pkey_bits
> > static inline u64 set_pkey_bits(u64 reg, int pkey, u64 flags)
> > {
>
> tools/include/uapi/asm-generic/mman-common.h:#define PKEY_UNRESTRICTED 0x0
>
> So that looks good.
>
> But we seem to have the same ifdef also in
> tools/testing/selftests/powerpc/include/pkeys.h.
>
> So likely that should be removed as well (after making sure that it compiles?)
It will break people right now :) it might compile on one system but not
another.
There's been a bunch of discussion on this, often quite painful. See [0] and
surrounding thread for some history on this...
IOW - this isn't really costing us much so I'd prefer we kept this kind of
thing.
>
> --
> Cheers,
>
> David
--
Cheers, Lorenzo
[0]:https://lore.kernel.org/all/5b0b8e1e-6f50-4e18-bf46-39b00376c26e@nvidia.com/
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] selftests/mm: remove the local PKEY_UNRESTRICTED fallback
2026-08-18 13:29 ` Lorenzo Stoakes (ARM)
@ 2026-08-18 14:18 ` David Hildenbrand (Arm)
2026-08-18 14:36 ` Lorenzo Stoakes (ARM)
0 siblings, 1 reply; 8+ messages in thread
From: David Hildenbrand (Arm) @ 2026-08-18 14:18 UTC (permalink / raw)
To: Lorenzo Stoakes (ARM)
Cc: Hemanth Selam, Andrew Morton, Shuah Khan, Yury Khrustalev,
Kevin Brodsky, Liam R . Howlett, Vlastimil Babka, Mike Rapoport,
Suren Baghdasaryan, Michal Hocko, linux-mm, linux-kselftest,
linux-kernel
On 8/18/26 15:29, Lorenzo Stoakes (ARM) wrote:
> On Tue, Aug 18, 2026 at 03:11:50PM +0200, David Hildenbrand (Arm) wrote:
>> On 8/18/26 13:49, Hemanth Selam wrote:
>>> pkey-helpers.h defines PKEY_UNRESTRICTED itself when the macro is not
>>> already known, a stopgap from when the generic definition was still
>>> under review. It has been merged since, commit 6d61527d931b ("mm/pkey:
>>> Add PKEY_UNRESTRICTED macro"), and pkey-helpers.h already includes
>>> <linux/mman.h>, so the guard is never taken. Honour the FIXME and drop
>>> it.
>>>
>>> The mm selftests build against the headers of the kernel source, see
>>> Documentation/dev-tools/kselftest.rst. Building them without "make
>
> This is incorrect. We explicitly do not have this requirement in mm selftests,
> and they're often built without having to do this step and tooling has been
> provided _explicitly_ to allow for that, which is why this kind of thing exists
> right now.
>
>>> headers", against system headers predating the macro, now fails to
>>> compile instead of quietly falling back.
>>>
>>> No functional change intended.
>>>
>>> Signed-off-by: Hemanth Selam <hemanth.selam@gmail.com>
>>> ---
>>> tools/testing/selftests/mm/pkey-helpers.h | 7 -------
>>> 1 file changed, 7 deletions(-)
>>>
>>> diff --git a/tools/testing/selftests/mm/pkey-helpers.h b/tools/testing/selftests/mm/pkey-helpers.h
>>> index 2c377f4e9df1..626c2e1655dc 100644
>>> --- a/tools/testing/selftests/mm/pkey-helpers.h
>>> +++ b/tools/testing/selftests/mm/pkey-helpers.h
>>> @@ -112,13 +112,6 @@ void record_pkey_malloc(void *ptr, long size, int prot);
>>> #define PKEY_MASK (PKEY_DISABLE_ACCESS | PKEY_DISABLE_WRITE)
>>> #endif
>>>
>>> -/*
>>> - * FIXME: Remove once the generic PKEY_UNRESTRICTED definition is merged.
>>> - */
>>> -#ifndef PKEY_UNRESTRICTED
>>> -#define PKEY_UNRESTRICTED 0x0
>>> -#endif
>>> -
>>> #ifndef set_pkey_bits
>>> static inline u64 set_pkey_bits(u64 reg, int pkey, u64 flags)
>>> {
>>
>> tools/include/uapi/asm-generic/mman-common.h:#define PKEY_UNRESTRICTED 0x0
>>
>> So that looks good.
>>
>> But we seem to have the same ifdef also in
>> tools/testing/selftests/powerpc/include/pkeys.h.
>>
>> So likely that should be removed as well (after making sure that it compiles?)
>
> It will break people right now :) it might compile on one system but not
> another.
I thought once we have stuff in tools/include/uapi/asm-generic/ headers that it
should work?
The dependency on "make headers" was the problematic bit IIUC.
But this stuff is always confusing me ...
--
Cheers,
David
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] selftests/mm: remove the local PKEY_UNRESTRICTED fallback
2026-08-18 14:18 ` David Hildenbrand (Arm)
@ 2026-08-18 14:36 ` Lorenzo Stoakes (ARM)
2026-08-19 7:47 ` Hemanth Selam
0 siblings, 1 reply; 8+ messages in thread
From: Lorenzo Stoakes (ARM) @ 2026-08-18 14:36 UTC (permalink / raw)
To: David Hildenbrand (Arm)
Cc: Hemanth Selam, Andrew Morton, Shuah Khan, Yury Khrustalev,
Kevin Brodsky, Liam R . Howlett, Vlastimil Babka, Mike Rapoport,
Suren Baghdasaryan, Michal Hocko, linux-mm, linux-kselftest,
linux-kernel
On Tue, Aug 18, 2026 at 04:18:47PM +0200, David Hildenbrand (Arm) wrote:
> On 8/18/26 15:29, Lorenzo Stoakes (ARM) wrote:
> > On Tue, Aug 18, 2026 at 03:11:50PM +0200, David Hildenbrand (Arm) wrote:
> >> On 8/18/26 13:49, Hemanth Selam wrote:
> >>> pkey-helpers.h defines PKEY_UNRESTRICTED itself when the macro is not
> >>> already known, a stopgap from when the generic definition was still
> >>> under review. It has been merged since, commit 6d61527d931b ("mm/pkey:
> >>> Add PKEY_UNRESTRICTED macro"), and pkey-helpers.h already includes
> >>> <linux/mman.h>, so the guard is never taken. Honour the FIXME and drop
> >>> it.
> >>>
> >>> The mm selftests build against the headers of the kernel source, see
> >>> Documentation/dev-tools/kselftest.rst. Building them without "make
> >
> > This is incorrect. We explicitly do not have this requirement in mm selftests,
> > and they're often built without having to do this step and tooling has been
> > provided _explicitly_ to allow for that, which is why this kind of thing exists
> > right now.
> >
> >>> headers", against system headers predating the macro, now fails to
> >>> compile instead of quietly falling back.
> >>>
> >>> No functional change intended.
> >>>
> >>> Signed-off-by: Hemanth Selam <hemanth.selam@gmail.com>
> >>> ---
> >>> tools/testing/selftests/mm/pkey-helpers.h | 7 -------
> >>> 1 file changed, 7 deletions(-)
> >>>
> >>> diff --git a/tools/testing/selftests/mm/pkey-helpers.h b/tools/testing/selftests/mm/pkey-helpers.h
> >>> index 2c377f4e9df1..626c2e1655dc 100644
> >>> --- a/tools/testing/selftests/mm/pkey-helpers.h
> >>> +++ b/tools/testing/selftests/mm/pkey-helpers.h
> >>> @@ -112,13 +112,6 @@ void record_pkey_malloc(void *ptr, long size, int prot);
> >>> #define PKEY_MASK (PKEY_DISABLE_ACCESS | PKEY_DISABLE_WRITE)
> >>> #endif
> >>>
> >>> -/*
> >>> - * FIXME: Remove once the generic PKEY_UNRESTRICTED definition is merged.
> >>> - */
> >>> -#ifndef PKEY_UNRESTRICTED
> >>> -#define PKEY_UNRESTRICTED 0x0
> >>> -#endif
> >>> -
> >>> #ifndef set_pkey_bits
> >>> static inline u64 set_pkey_bits(u64 reg, int pkey, u64 flags)
> >>> {
> >>
> >> tools/include/uapi/asm-generic/mman-common.h:#define PKEY_UNRESTRICTED 0x0
> >>
> >> So that looks good.
> >>
> >> But we seem to have the same ifdef also in
> >> tools/testing/selftests/powerpc/include/pkeys.h.
> >>
> >> So likely that should be removed as well (after making sure that it compiles?)
> >
> > It will break people right now :) it might compile on one system but not
> > another.
>
> I thought once we have stuff in tools/include/uapi/asm-generic/ headers that it
> should work?
>
> The dependency on "make headers" was the problematic bit IIUC.
>
> But this stuff is always confusing me ...
Yeah I did go check over there :) but for a lot of stuff we don't have that and
it's not really the right place (that's more providing userland stubs, etc.)
Yeah it's confusing and a pain and sometimes we break these things but in
general I don't think the #ifndef/#define's are too problematic to keep.
But it might be worth checking in this case to see whether the problem here
is in fact that we need PKEY_UNRESTRICTED defined over there?
Hemanth - could you check please?
>
> --
> Cheers,
>
> David
--
Cheers, Lorenzo
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] selftests/mm: remove the local PKEY_UNRESTRICTED fallback
2026-08-18 14:36 ` Lorenzo Stoakes (ARM)
@ 2026-08-19 7:47 ` Hemanth Selam
0 siblings, 0 replies; 8+ messages in thread
From: Hemanth Selam @ 2026-08-19 7:47 UTC (permalink / raw)
To: Lorenzo Stoakes
Cc: David Hildenbrand, Andrew Morton, Shuah Khan, Yury Khrustalev,
Kevin Brodsky, Liam R . Howlett, Vlastimil Babka, Mike Rapoport,
Suren Baghdasaryan, Michal Hocko, linux-mm, linux-kselftest,
linux-kernel, Hemanth Selam
On Tue, Aug 18, 2026 at 02:36:00PM +0000, Lorenzo Stoakes (ARM) wrote:
> But it might be worth checking in this case to see whether the problem here
> is in fact that we need PKEY_UNRESTRICTED defined over there?
>
> Hemanth - could you check please?
Checked. It is already defined over there:
tools/include/uapi/asm-generic/mman-common.h:88:#define PKEY_UNRESTRICTED 0x0
and it does reach the mm selftests without "make headers", through
TOOLS_INCLUDES. The path is not obvious, so for the record:
pkey-helpers.h
-> <linux/mman.h> tools/include/uapi/linux/mman.h
-> <asm/mman.h> /usr/include/asm/mman.h
(tools/include/uapi/asm/mman.h does not exist)
-> <asm-generic/mman.h> tools/include/uapi/asm-generic/mman.h
(-isystem puts it ahead of the system one)
-> <asm-generic/mman-common-tools.h>
-> <asm-generic/mman-common.h> PKEY_UNRESTRICTED
I built the pkey tests with KHDR_INCLUDES pointing at an empty directory,
that is, as if "make headers" had never run. They build, and cpp -dD
says:
defined in: tools/include/uapi/asm-generic/mman-common.h
Pointing TOOLS_INCLUDES at an empty directory as well is what breaks it:
pkey-helpers.h:188:30: error: 'PKEY_UNRESTRICTED' undeclared
So that is where the definition comes from, and dropping the local
#ifndef does not depend on "make headers" being run.
The one thing worth being aware of is that the redirection into
tools/include/uapi only happens because the system <asm/mman.h> includes
<asm-generic/mman.h>.
I had a look at the history you pointed at, thanks, that was the part I
had wrong. If I read it right this is exactly the mechanism from commit
e076eaca5906 ("selftests: break the dependency upon local header
files"), which added TOOLS_INCLUDES to the mm selftests so they build
without "make headers". So for this particular macro the value comes
from the in-tree snapshot rather than from whatever the build host has
installed, which is why it does not vary per system here.
That said, if you would still rather keep the #ifndef as a matter of
course, I have no objection to dropping the patch, the guard costs
nothing. I mainly wanted to answer the question with something
measured rather than assumed.
> This is incorrect. We explicitly do not have this requirement in mm selftests,
> and they're often built without having to do this step and tooling has been
> provided _explicitly_ to allow for that, which is why this kind of thing exists
> right now.
You are right, the commit message was wrong on that point. v2 drops
that paragraph and describes the above instead.
On the powerpc header David mentioned, I would rather leave
tools/testing/selftests/powerpc/include/pkeys.h alone. It is not the
same construct: it is an unconditional
#undef PKEY_UNRESTRICTED
#define PKEY_UNRESTRICTED 0x0
next to other powerpc specific overrides such as PKEY_DISABLE_EXECUTE
0x4, and that header only includes <sys/mman.h>, never <linux/mman.h>.
A probe including just <sys/mman.h> does not find PKEY_UNRESTRICTED,
with or without TOOLS_INCLUDES, so the definition there is load bearing
and removing it would break the build.
Thanks,
Hemanth
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2] selftests/mm: remove the local PKEY_UNRESTRICTED fallback
2026-08-18 11:49 [PATCH] selftests/mm: remove the local PKEY_UNRESTRICTED fallback Hemanth Selam
2026-08-18 13:11 ` David Hildenbrand (Arm)
@ 2026-08-19 7:47 ` Hemanth Selam
2026-08-19 14:15 ` David Hildenbrand (Arm)
1 sibling, 1 reply; 8+ messages in thread
From: Hemanth Selam @ 2026-08-19 7:47 UTC (permalink / raw)
To: Andrew Morton, David Hildenbrand, Shuah Khan
Cc: Lorenzo Stoakes, Yury Khrustalev, Kevin Brodsky, Liam R . Howlett,
Vlastimil Babka, Mike Rapoport, Suren Baghdasaryan, Michal Hocko,
linux-mm, linux-kselftest, linux-kernel, Hemanth Selam
pkey-helpers.h defines PKEY_UNRESTRICTED itself when the macro is not
already known, a stopgap from when the generic definition was still
under review. It has been merged since, commit 6d61527d931b ("mm/pkey:
Add PKEY_UNRESTRICTED macro"), so the guard is never taken and the FIXME
can be honoured.
The definition comes from tools/include/uapi/asm-generic/mman-common.h
via TOOLS_INCLUDES, which commit e076eaca5906 ("selftests: break the
dependency upon local header files") added so that the mm selftests
build without "make headers". It is reached through the
<asm-generic/mman.h> that the system <asm/mman.h> includes. Building
the pkey tests with KHDR_INCLUDES pointing at an empty directory
confirms that; emptying TOOLS_INCLUDES as well is what makes the macro
go missing.
No functional change intended.
Signed-off-by: Hemanth Selam <hemanth.selam@gmail.com>
---
Changes in v2:
- Drop the incorrect claim that the mm selftests are built against the
headers of the kernel source and would fail without "make headers".
They are not, as Lorenzo pointed out; describe where the definition
really comes from instead.
- Leave tools/testing/selftests/powerpc/include/pkeys.h alone, as
discussed with David on v1. Unlike the mm one it is an unconditional
#undef/#define next to other powerpc specific overrides, and that
header only includes <sys/mman.h>, which does not provide
PKEY_UNRESTRICTED with or without TOOLS_INCLUDES, so its definition
is load bearing.
The full include path, for reference:
pkey-helpers.h
-> <linux/mman.h> tools/include/uapi/linux/mman.h
-> <asm/mman.h> /usr/include/asm/mman.h
(tools/include/uapi/asm/mman.h does not exist)
-> <asm-generic/mman.h> tools/include/uapi/asm-generic/mman.h
-> <asm-generic/mman-common-tools.h>
-> <asm-generic/mman-common.h> PKEY_UNRESTRICTED
With KHDR_INCLUDES pointing at an empty directory the tests still build,
and cpp -dD reports the macro coming from
tools/include/uapi/asm-generic/mman-common.h. Emptying TOOLS_INCLUDES
as well gives:
pkey-helpers.h:188:30: error: 'PKEY_UNRESTRICTED' undeclared
pkey_sighandler_tests and mseal_test are byte identical before and
after; protection_keys differs only in the __LINE__ values that
pkey-helpers.h embeds into its debug output.
v1: https://lore.kernel.org/all/20260818114945.1312987-1-hemanth.selam@gmail.com/
tools/testing/selftests/mm/pkey-helpers.h | 7 -------
1 file changed, 7 deletions(-)
diff --git a/tools/testing/selftests/mm/pkey-helpers.h b/tools/testing/selftests/mm/pkey-helpers.h
index 2c377f4e9df1..626c2e1655dc 100644
--- a/tools/testing/selftests/mm/pkey-helpers.h
+++ b/tools/testing/selftests/mm/pkey-helpers.h
@@ -112,13 +112,6 @@ void record_pkey_malloc(void *ptr, long size, int prot);
#define PKEY_MASK (PKEY_DISABLE_ACCESS | PKEY_DISABLE_WRITE)
#endif
-/*
- * FIXME: Remove once the generic PKEY_UNRESTRICTED definition is merged.
- */
-#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.7
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v2] selftests/mm: remove the local PKEY_UNRESTRICTED fallback
2026-08-19 7:47 ` [PATCH v2] " Hemanth Selam
@ 2026-08-19 14:15 ` David Hildenbrand (Arm)
0 siblings, 0 replies; 8+ messages in thread
From: David Hildenbrand (Arm) @ 2026-08-19 14:15 UTC (permalink / raw)
To: Hemanth Selam, Andrew Morton, Shuah Khan
Cc: Lorenzo Stoakes, Yury Khrustalev, Kevin Brodsky, Liam R . Howlett,
Vlastimil Babka, Mike Rapoport, Suren Baghdasaryan, Michal Hocko,
linux-mm, linux-kselftest, linux-kernel
On 8/19/26 09:47, Hemanth Selam wrote:
> pkey-helpers.h defines PKEY_UNRESTRICTED itself when the macro is not
> already known, a stopgap from when the generic definition was still
> under review. It has been merged since, commit 6d61527d931b ("mm/pkey:
> Add PKEY_UNRESTRICTED macro"), so the guard is never taken and the FIXME
> can be honoured.
>
> The definition comes from tools/include/uapi/asm-generic/mman-common.h
> via TOOLS_INCLUDES, which commit e076eaca5906 ("selftests: break the
> dependency upon local header files") added so that the mm selftests
> build without "make headers". It is reached through the
> <asm-generic/mman.h> that the system <asm/mman.h> includes. Building
> the pkey tests with KHDR_INCLUDES pointing at an empty directory
> confirms that; emptying TOOLS_INCLUDES as well is what makes the macro
> go missing.
>
> No functional change intended.
>
> Signed-off-by: Hemanth Selam <hemanth.selam@gmail.com>
Hi,
please prefer not sending new revisions in reply to old revisions the next time.
[...]
> tools/testing/selftests/mm/pkey-helpers.h | 7 -------
> 1 file changed, 7 deletions(-)
>
> diff --git a/tools/testing/selftests/mm/pkey-helpers.h b/tools/testing/selftests/mm/pkey-helpers.h
> index 2c377f4e9df1..626c2e1655dc 100644
> --- a/tools/testing/selftests/mm/pkey-helpers.h
> +++ b/tools/testing/selftests/mm/pkey-helpers.h
> @@ -112,13 +112,6 @@ void record_pkey_malloc(void *ptr, long size, int prot);
> #define PKEY_MASK (PKEY_DISABLE_ACCESS | PKEY_DISABLE_WRITE)
> #endif
>
> -/*
> - * FIXME: Remove once the generic PKEY_UNRESTRICTED definition is merged.
> - */
> -#ifndef PKEY_UNRESTRICTED
> -#define PKEY_UNRESTRICTED 0x0
> -#endif
> -
> #ifndef set_pkey_bits
> static inline u64 set_pkey_bits(u64 reg, int pkey, u64 flags)
> {
Hoping this indeed compiles ;)
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
--
Cheers,
David
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-08-19 14:15 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-18 11:49 [PATCH] selftests/mm: remove the local PKEY_UNRESTRICTED fallback Hemanth Selam
2026-08-18 13:11 ` David Hildenbrand (Arm)
2026-08-18 13:29 ` Lorenzo Stoakes (ARM)
2026-08-18 14:18 ` David Hildenbrand (Arm)
2026-08-18 14:36 ` Lorenzo Stoakes (ARM)
2026-08-19 7:47 ` Hemanth Selam
2026-08-19 7:47 ` [PATCH v2] " Hemanth Selam
2026-08-19 14:15 ` David Hildenbrand (Arm)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox