[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3ffd3e53-0fcd-4d50-807f-e75e221558a3@lucifer.local>
Date: Mon, 26 Aug 2024 15:12:33 +0100
From: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
To: Geert Uytterhoeven <geert@...ux-m68k.org>
Cc: "Liam R. Howlett" <Liam.Howlett@...cle.com>,
Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, Suren Baghdasaryan <surenb@...gle.com>,
Matthew Wilcox <willy@...radead.org>, Vlastimil Babka <vbabka@...e.cz>,
sidhartha.kumar@...cle.com, Bert Karwatzki <spasswolf@....de>,
Jiri Olsa <olsajiri@...il.com>, Kees Cook <kees@...nel.org>,
"Paul E . McKenney" <paulmck@...nel.org>
Subject: Re: [PATCH v7 12/21] mm/vma: Track start and end for munmap in
vma_munmap_struct
On Mon, Aug 26, 2024 at 04:01:10PM GMT, Geert Uytterhoeven wrote:
> Hi Liam,
>
> On Thu, Aug 22, 2024 at 9:27 PM Liam R. Howlett <Liam.Howlett@...cle.com> wrote:
> > From: "Liam R. Howlett" <Liam.Howlett@...cle.com>
> >
> > Set the start and end address for munmap when the prev and next are
> > gathered. This is needed to avoid incorrect addresses being used during
> > the vms_complete_munmap_vmas() function if the prev/next vma are
> > expanded.
> >
> > Add a new helper vms_complete_pte_clear(), which is needed later and
> > will avoid growing the argument list to unmap_region() beyond the 9 it
> > already has.
> >
> > Signed-off-by: Liam R. Howlett <Liam.Howlett@...cle.com>
> > Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
>
> Thanks for your patch, which is now commit ca39aca8db2d78ff ("mm/vma:
> track start and end for munmap in vma_munmap_struct") in next-20240826.
>
> > --- a/mm/vma.h
> > +++ b/mm/vma.h
> > @@ -38,6 +38,8 @@ struct vma_munmap_struct {
> > struct list_head *uf; /* Userfaultfd list_head */
> > unsigned long start; /* Aligned start addr (inclusive) */
> > unsigned long end; /* Aligned end addr (exclusive) */
> > + unsigned long unmap_start; /* Unmap PTE start */
> > + unsigned long unmap_end; /* Unmap PTE end */
> > int vma_count; /* Number of vmas that will be removed */
> > unsigned long nr_pages; /* Number of pages being removed */
> > unsigned long locked_vm; /* Number of locked pages */
> > @@ -108,6 +110,8 @@ static inline void init_vma_munmap(struct vma_munmap_struct *vms,
> > vms->vma_count = 0;
> > vms->nr_pages = vms->locked_vm = vms->nr_accounted = 0;
> > vms->exec_vm = vms->stack_vm = vms->data_vm = 0;
> > + vms->unmap_start = FIRST_USER_ADDRESS;
> > + vms->unmap_end = USER_PGTABLES_CEILING;
>
> noreply@...erman.id.au reported build failures for m5272c3_defconfig
> http://kisskb.ellerman.id.au/kisskb/buildresult/15224802/
>
> $ make ARCH=m68k m5272c3_defconfig mm/filemap.o
> In file included from mm/internal.h:22,
> from mm/filemap.c:52:
> mm/vma.h: In function ‘init_vma_munmap’:
> mm/vma.h:113:21: error: ‘FIRST_USER_ADDRESS’ undeclared (first use in
> this function)
> 113 | vms->unmap_start = FIRST_USER_ADDRESS;
> | ^~~~~~~~~~~~~~~~~~
> mm/vma.h:113:21: note: each undeclared identifier is reported only
> once for each function it appears in
> mm/vma.h:114:19: error: ‘USER_PGTABLES_CEILING’ undeclared (first use
> in this function)
> 114 | vms->unmap_end = USER_PGTABLES_CEILING;
> | ^~~~~~~~~~~~~~~~~~~~~
>
> Both are defined in include/linux/pgtable.h inside #ifdef CONFIG_MMU,
> so they are not available on nommu.
Thanks for the report, this was already resolved (or should be :) via fix-patch
in [0].
[0}:https://lore.kernel.org/all/7d0ea994-f750-49c5-b392-ae7117369cf3@lucifer.local/
>
>
> > }
> >
> > int vms_gather_munmap_vmas(struct vma_munmap_struct *vms,
>
> Gr{oetje,eeting}s,
>
> Geert
>
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds
Powered by blists - more mailing lists