linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Suren Baghdasaryan <surenb@google.com>,
	"Liam R . Howlett" <Liam.Howlett@oracle.com>,
	Matthew Wilcox <willy@infradead.org>,
	Vlastimil Babka <vbabka@suse.cz>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Jann Horn <jannh@google.com>,
	David Hildenbrand <david@redhat.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Muchun Song <muchun.song@linux.dev>,
	Richard Henderson <richard.henderson@linaro.org>,
	Ivan Kokshaysky <ink@jurassic.park.msu.ru>,
	Matt Turner <mattst88@gmail.com>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	"James E . J . Bottomley" <James.Bottomley@hansenpartnership.com>,
	Helge Deller <deller@gmx.de>, Chris Zankel <chris@zankel.net>,
	Max Filippov <jcmvbkbc@gmail.com>, Arnd Bergmann <arnd@arndb.de>,
	linux-alpha@vger.kernel.org, linux-mips@vger.kernel.org,
	linux-parisc@vger.kernel.org, linux-arch@vger.kernel.org,
	Shuah Khan <shuah@kernel.org>,
	Christian Brauner <brauner@kernel.org>,
	linux-kselftest@vger.kernel.org,
	Sidhartha Kumar <sidhartha.kumar@oracle.com>
Subject: Re: [RFC PATCH 1/4] mm: pagewalk: add the ability to install PTEs
Date: Mon, 14 Oct 2024 23:47:58 -0700	[thread overview]
Message-ID: <Zw4QHoPArxEQan0G@infradead.org> (raw)
In-Reply-To: <59e218670565accf978aeb8cf4745de4c0738773.1727440966.git.lorenzo.stoakes@oracle.com>

Hi Lorenzo,

sorry for only replying to this so late.

On Fri, Sep 27, 2024 at 01:51:11PM +0100, Lorenzo Stoakes wrote:
> The existing generic pagewalk logic permits the walking of page tables,
> invoking callbacks at individual page table levels via user-provided
> mm_walk_ops callbacks.
> 
> This is useful for traversing existing page table entries, but precludes
> the ability to establish new ones.
> 
> Existing mechanism for performing a walk which also installs page table
> entries if necessary are heavily duplicated throughout the kernel, each
> with semantic differences from one another and largely unavailable for use
> elsewhere.

I do like the idea of having common code for installing page tables!

Minor nits below:

> +int walk_page_range_mm(struct mm_struct *mm, unsigned long start,
>  		unsigned long end, const struct mm_walk_ops *ops,
>  		void *private)

It would be good to have a minimum level of documentation for this
function, including how it differs from walk_page_range and why
it should remain internal.

> +	/* For internal use only. */
> +	if (ops->install_pte)
> +		return -EINVAL;

And this should probably be expanded a bit, including that no exported
symbol should allow inserting arbitrary PTEs.  Maybe best done with
a helper to share that comment with the other places that have this
check.


  parent reply	other threads:[~2024-10-15  6:48 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-27 12:51 [RFC PATCH 0/4] implement lightweight guard pages Lorenzo Stoakes
2024-09-27 12:51 ` [RFC PATCH 1/4] mm: pagewalk: add the ability to install PTEs Lorenzo Stoakes
2024-09-30 16:05   ` Lorenzo Stoakes
2024-10-11 18:11   ` Jann Horn
2024-10-14 11:10     ` Lorenzo Stoakes
2024-10-15  6:47   ` Christoph Hellwig [this message]
2024-10-15  7:27     ` Lorenzo Stoakes
2024-09-27 12:51 ` [RFC PATCH 2/4] mm: add PTE_MARKER_GUARD PTE marker Lorenzo Stoakes
2024-10-11 18:11   ` Jann Horn
2024-10-14 10:23     ` Lorenzo Stoakes
2024-09-27 12:51 ` [RFC PATCH 3/4] mm: madvise: implement lightweight guard page mechanism Lorenzo Stoakes
2024-10-04 18:17   ` Jeff Xu
2024-10-04 18:26     ` Lorenzo Stoakes
2024-10-07 15:30       ` Jeff Xu
2024-10-11 18:11   ` Jann Horn
2024-10-11 20:55     ` Suren Baghdasaryan
2024-10-14 11:21       ` Lorenzo Stoakes
2024-10-14 11:08     ` Lorenzo Stoakes
2024-10-14 15:56       ` Jann Horn
2024-10-14 16:56         ` Lorenzo Stoakes
2024-10-14 18:14           ` Jann Horn
2024-10-14 19:27             ` Lorenzo Stoakes
2024-09-27 12:51 ` [RFC PATCH 4/4] selftests/mm: add self tests for guard page feature Lorenzo Stoakes
2024-09-30  7:23 ` [RFC PATCH 0/4] implement lightweight guard pages Pavel Machek
2024-09-30  8:00   ` Lorenzo Stoakes

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=Zw4QHoPArxEQan0G@infradead.org \
    --to=hch@infradead.org \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=brauner@kernel.org \
    --cc=chris@zankel.net \
    --cc=david@redhat.com \
    --cc=deller@gmx.de \
    --cc=ink@jurassic.park.msu.ru \
    --cc=jannh@google.com \
    --cc=jcmvbkbc@gmail.com \
    --cc=linux-alpha@vger.kernel.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-parisc@vger.kernel.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=mattst88@gmail.com \
    --cc=muchun.song@linux.dev \
    --cc=paulmck@kernel.org \
    --cc=richard.henderson@linaro.org \
    --cc=shuah@kernel.org \
    --cc=sidhartha.kumar@oracle.com \
    --cc=surenb@google.com \
    --cc=tsbogend@alpha.franken.de \
    --cc=vbabka@suse.cz \
    --cc=willy@infradead.org \
    /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).