From: "Lorenzo Stoakes (ARM)" <ljs@kernel.org>
To: "David Hildenbrand (Arm)" <david@kernel.org>
Cc: Hemanth Selam <hemanth.selam@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
Shuah Khan <shuah@kernel.org>,
Yury Khrustalev <yury.khrustalev@arm.com>,
Kevin Brodsky <kevin.brodsky@arm.com>,
"Liam R . Howlett" <liam@infradead.org>,
Vlastimil Babka <vbabka@kernel.org>,
Mike Rapoport <rppt@kernel.org>,
Suren Baghdasaryan <surenb@google.com>,
Michal Hocko <mhocko@suse.com>,
linux-mm@kvack.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] selftests/mm: remove the local PKEY_UNRESTRICTED fallback
Date: Tue, 18 Aug 2026 14:29:35 +0100 [thread overview]
Message-ID: <aoRcdLGWaNhUFIPU@lucifer> (raw)
In-Reply-To: <9e533fcd-c80f-42df-847c-c15c4e3a1a70@kernel.org>
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/
next prev parent reply other threads:[~2026-08-18 13:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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) [this message]
2026-08-18 14:18 ` David Hildenbrand (Arm)
2026-08-18 14:36 ` Lorenzo Stoakes (ARM)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aoRcdLGWaNhUFIPU@lucifer \
--to=ljs@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=david@kernel.org \
--cc=hemanth.selam@gmail.com \
--cc=kevin.brodsky@arm.com \
--cc=liam@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=rppt@kernel.org \
--cc=shuah@kernel.org \
--cc=surenb@google.com \
--cc=vbabka@kernel.org \
--cc=yury.khrustalev@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox