Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: Shuah Khan <skhan@linuxfoundation.org>
To: Kevin Brodsky <kevin.brodsky@arm.com>,
	linux-arm-kernel@lists.infradead.org
Cc: catalin.marinas@arm.com, dave.hansen@linux.intel.com,
	yury.khrustalev@arm.com, will@kernel.org,
	linux-kselftest@vger.kernel.org,
	Aishwarya TCV <aishwarya.tcv@arm.com>,
	Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH] selftests/mm: Define PKEY_UNRESTRICTED for pkey_sighandler_tests
Date: Thu, 7 Nov 2024 09:50:20 -0700	[thread overview]
Message-ID: <96cc8ce1-1f64-45d5-8567-eb2adba1b47a@linuxfoundation.org> (raw)
In-Reply-To: <20241107131640.650703-1-kevin.brodsky@arm.com>

On 11/7/24 06:16, Kevin Brodsky wrote:
> 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.

What does mean to say "time being" - can this be removed in the
future. If so please add a FIXME so this define can be removed
later.

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

Where would this be defined in the future? I couldn't find it
in any kernel header files on linux-next.


> +
>   #ifndef set_pkey_bits
>   static inline u64 set_pkey_bits(u64 reg, int pkey, u64 flags)
>   {

thanks,
-- Shuah

  reply	other threads:[~2024-11-07 16:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-07 13:16 [PATCH] selftests/mm: Define PKEY_UNRESTRICTED for pkey_sighandler_tests Kevin Brodsky
2024-11-07 16:50 ` Shuah Khan [this message]
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

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=96cc8ce1-1f64-45d5-8567-eb2adba1b47a@linuxfoundation.org \
    --to=skhan@linuxfoundation.org \
    --cc=aishwarya.tcv@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=kevin.brodsky@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=will@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