linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: Yury Khrustalev <yury.khrustalev@arm.com>,
	linux-arch@vger.kernel.org, acme@kernel.org
Cc: Arnd Bergmann <arnd@arndb.de>,
	Kevin Brodsky <kevin.brodsky@arm.com>,
	Joey Gouly <joey.gouly@arm.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Sandipan Das <sandipan@linux.ibm.com>,
	linuxppc-dev@lists.ozlabs.org, nd@arm.com,
	Yury Khrustalev <yury.khrustalev@arm.com>
Subject: Re: [PATCH v3 1/3] mm/pkey: Add PKEY_UNRESTRICTED macro
Date: Wed, 06 Nov 2024 12:00:42 +1100	[thread overview]
Message-ID: <87ttcl89c5.fsf@mpe.ellerman.id.au> (raw)
In-Reply-To: <20241028090715.509527-2-yury.khrustalev@arm.com>

Yury Khrustalev <yury.khrustalev@arm.com> writes:
> Memory protection keys (pkeys) uapi has two macros for pkeys restrictions:
>
>  - PKEY_DISABLE_ACCESS 0x1
>  - PKEY_DISABLE_WRITE  0x2
>
> with implicit literal value of 0x0 that means "unrestricted". Code that
> works with pkeys has to use this literal value when implying that a pkey
> imposes no restrictions. This may reduce readability because 0 can be
> written in various ways (e.g. 0x0 or 0) and also because 0 in the context
> of pkeys can be mistaken for "no permissions" (akin PROT_NONE) while it
> actually means "no restrictions". This is important because pkeys are
> oftentimes used near mprotect() that uses PROT_ macros.
>
> This patch adds PKEY_UNRESTRICTED macro defined as 0x0.
>
> Signed-off-by: Yury Khrustalev <yury.khrustalev@arm.com>
> ---
>  include/uapi/asm-generic/mman-common.h       | 1 +
>  tools/include/uapi/asm-generic/mman-common.h | 1 +
>  2 files changed, 2 insertions(+)
  
Apparently you're not meant to modify the copy in tools/, there's a
script that does that, which is run by acme, see:

  https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/include/uapi/README

cheers


  reply	other threads:[~2024-11-06  1:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-28  9:07 [PATCH v3 0/3] mm/pkey: Add PKEY_UNRESTRICTED macro Yury Khrustalev
2024-10-28  9:07 ` [PATCH v3 1/3] " Yury Khrustalev
2024-11-06  1:00   ` Michael Ellerman [this message]
2024-11-08  8:59     ` Yury Khrustalev
2024-10-28  9:07 ` [PATCH v3 2/3] selftests/mm: Use " Yury Khrustalev
2024-10-28  9:07 ` [PATCH v3 3/3] selftests/powerpc: " Yury Khrustalev
2024-10-28  9:21   ` Kevin Brodsky

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=87ttcl89c5.fsf@mpe.ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=acme@kernel.org \
    --cc=arnd@arndb.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=joey.gouly@arm.com \
    --cc=kevin.brodsky@arm.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=nd@arm.com \
    --cc=sandipan@linux.ibm.com \
    --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;
as well as URLs for NNTP newsgroup(s).