linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Ryan Roberts <ryan.roberts@arm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH v1] mm: More ptep_get() conversion
Date: Tue, 14 Nov 2023 16:30:49 +0000	[thread overview]
Message-ID: <ZVOguexQ2rGhnwN7@casper.infradead.org> (raw)
In-Reply-To: <20231114154945.490401-1-ryan.roberts@arm.com>

On Tue, Nov 14, 2023 at 03:49:45PM +0000, Ryan Roberts wrote:
> Commit c33c794828f2 ("mm: ptep_get() conversion") converted all
> (non-arch) call sites to use ptep_get() instead of doing a direct
> dereference of the pte. Full rationale can be found in that commit's
> log.
> 
> Since then, three new call sites have snuck in, which directly
> dereference the pte, so let's fix those up.
> 
> Unfortunately there is no reliable automated mechanism to catch these;
> I'm relying on a combination of Coccinelle (which throws up a lot of
> false positives) and some compiler magic to force a compiler error on
> dereference (While this approach finds dereferences, it also yields a
> non-booting kernel so can't be committed).

Well ... let's see what we can come up with.

struct raw_pte {
	pte_t pte;
};

static inline pte_t ptep_get(struct raw_pte *rpte)
{
	return rpte.pte;
}

Probably quite a lot of churn to put that into place, but better than
a never-ending treadmill of fixing the places that people overlooked?


  reply	other threads:[~2023-11-14 16:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-14 15:49 Ryan Roberts
2023-11-14 16:30 ` Matthew Wilcox [this message]
2023-11-14 16:46   ` Ryan Roberts

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=ZVOguexQ2rGhnwN7@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ryan.roberts@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