Re: [PATCH 1/9] x86/mm/pat: flush the TLB when only an alias mapping changed
From: Edgecombe, Rick P
Date: Mon Nov 30 2026 - 17:55:33 EST
On Thu, 2026-11-26 at 09:34 +0200, Mike Rapoport wrote:
> On Wed, Nov 25, 2026 at 08:38:18PM +0000, Edgecombe, Rick P wrote:
> > On Wed, 2026-11-25 at 10:59 +0200, Mike Rapoport wrote:
> > > Like the cover letter said it's "unlikely to happen in practice" :)
> > >
> > > Currently there are no callers in the tree that could trigger that.
> > >
> > > I'm working the generic set_memory_core [1] and the bots keep yelling at me
> > > whenever I touch anything around.
> > >
> > > So while is a defense against potential future issues, the change is simple
> > > and I think it's better to have it.
> > >
> > > Might also save us from reviewing several LLM generated reports that would
> > > find the same thing ;-)
> >
> > Yea duplicates and AI false positives are a problem. But changing the code to
> > prevent the reports seems backwards. Though I don't have any other solution then
> > just drown in things to check.
>
> The change is more to prevent a potential future issue than to stop AI
> reports.
>
> With more and more use cases using set_memory, adding code that ensures
> there is no missing flush now is better than hunting it down when some new
> caller hits it :)
>
> > > [1]
> > > https://lore.kernel.org/all/20260721-generic-set-memory-v0-1-v1-0-2c1fc62306b3@xxxxxxxxxx
> >
> > Neat... But I think set_memory() was never the ideal interface for kernel memory
> > management. Maybe this is step towards that?
>
> The very first one, yes.
Cool.
>
> Right now it's a total mess:
>
> https://docs.kernel.org/mm/kernel-page-tables.html
Ha! Yes.
>
> and the first step I'm working on is at least to make all architectures
> behave consistently.
It will be tricky. I'd think to stick to just unifying the virtual memory
permissions. The cache property stuff gets very x86 specific. MTRRs, etc.
What is the intended scope? Depending, it may be better to build a new thing and
then unify it, rather than unify the old implementations only to rebuild it.