[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZgKIVogEUEnUMgpF@gmail.com>
Date: Tue, 26 Mar 2024 09:33:26 +0100
From: Ingo Molnar <mingo@...nel.org>
To: David Hildenbrand <david@...hat.com>
Cc: Matthew Wilcox <willy@...radead.org>, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, x86@...nel.org,
Wupeng Ma <mawupeng1@...wei.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Andy Lutomirski <luto@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
"H. Peter Anvin" <hpa@...or.com>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH v1] x86/mm/pat: fix VM_PAT handling in COW mappings
* David Hildenbrand <david@...hat.com> wrote:
> On 12.03.24 20:22, Matthew Wilcox wrote:
> > On Tue, Mar 12, 2024 at 07:11:18PM +0100, David Hildenbrand wrote:
> > > PAT handling won't do the right thing in COW mappings: the first PTE
> > > (or, in fact, all PTEs) can be replaced during write faults to point at
> > > anon folios. Reliably recovering the correct PFN and cachemode using
> > > follow_phys() from PTEs will not work in COW mappings.
> >
> > I guess the first question is: Why do we want to support COW mappings
> > of VM_PAT areas? What breaks if we just disallow it?
>
> Well, that was my first approach. Then I decided to be less radical (IOW
> make my life easier by breaking less user space) and "fix it" with
> minimal effort.
>
> Chances of breaking some weird user space is possible, although I believe
> for most such mappings MAP_PRIVATE doesn't make too much sense sense.
>
> Nasty COW support for VM_PFNMAP mappings dates back forever. So does PAT
> support.
>
> I can try finding digging through some possible user space users
> tomorrow.
I'd much prefer restricting VM_PAT areas than expanding support. Could we
try the trivial restriction approach first, and only go with your original
patch if that fails?
Thanks,
Ingo
Powered by blists - more mailing lists