mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Ritesh Harjani (IBM)" <ritesh.list@gmail.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Christophe Leroy <chleroy@kernel.org>,
	Venkat Rao Bagalkote <venkat88@linux.ibm.com>,
	Shrikanth Hegde <sshegde@linux.ibm.com>,
	linux-kernel@vger.kernel.org,
	"Ritesh Harjani (IBM)" <ritesh.list@gmail.com>
Subject: [RFC 0/4] powerpc/book3s64/radix: Add support for memfd_secret
Date: Sat, 10 Oct 2026 17:51:08 +0530	[thread overview]
Message-ID: <cover.1791608423.git.ritesh.list@gmail.com> (raw)

memfd_secret() gives a process a place to keep a secret that the kernel itself
should not be able to read. The page is still mapped in that process but it is
removed from the kernel linear map, so a kernel read or a speculative walk of
that map cannot see it.

On PowerPC book3s64, if the same address is translated by two pages of different
sizes at once, the TLB access can raise a machine check for a parity error or
a multi-hit. So that means breaking a 2M or a 1G mapping of kernel linear map is
not possible.

The way around that is to build the linear map out of base pages in the first
place and only then allow a single page to be dropped and put back. So, that is
what this series does by adding a linear_map_use_base_page cmdline option.

This is based out of mm-new branch for now (since few dependent function
definitions have been modified there). Once v7.4 is merge window closes - I will
rebase this to latest upstream powerpc tree.

Ritesh Harjani (IBM) (4):
  powerpc/64s: Add linear_map_use_base_page command line option
  powerpc/64s/radix: Implement ARCH_HAS_SET_DIRECT_MAP
  powerpc: Wire memfd_secret syscall
  selftests: mm: Enable memfd_secret for powerpc

 .../admin-guide/kernel-parameters.txt         | 10 ++
 arch/powerpc/Kconfig                          |  1 +
 arch/powerpc/include/asm/book3s/64/mmu.h      |  2 +
 arch/powerpc/include/asm/set_memory.h         |  9 ++
 arch/powerpc/kernel/syscalls/syscall.tbl      |  2 +-
 arch/powerpc/mm/book3s64/pgtable.c            | 22 +++++
 arch/powerpc/mm/book3s64/radix_pgtable.c      |  2 +-
 arch/powerpc/mm/pageattr.c                    | 96 +++++++++++++++++++
 tools/testing/selftests/mm/Makefile           |  2 +-
 9 files changed, 143 insertions(+), 3 deletions(-)

--
2.39.5


             reply	other threads:[~2026-10-10 12:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-10 12:21 Ritesh Harjani (IBM) [this message]
2026-10-10 12:21 ` [RFC 1/4] powerpc/64s: Add linear_map_use_base_page command line option Ritesh Harjani (IBM)
2026-10-10 12:21 ` [RFC 2/4] powerpc/64s/radix: Implement ARCH_HAS_SET_DIRECT_MAP Ritesh Harjani (IBM)
2026-10-10 12:21 ` [RFC 3/4] powerpc: Wire memfd_secret syscall Ritesh Harjani (IBM)
2026-10-10 12:21 ` [RFC 4/4] selftests: mm: Enable memfd_secret for powerpc Ritesh Harjani (IBM)

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=cover.1791608423.git.ritesh.list@gmail.com \
    --to=ritesh.list@gmail.com \
    --cc=chleroy@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=sshegde@linux.ibm.com \
    --cc=venkat88@linux.ibm.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

all inboxes | Powered by JetHome®