On Tue, 19 May 2020 14:34:29 +0200 Joerg Roedel <jroedel@xxxxxxx> wrote: > On Mon, May 18, 2020 at 08:47:54PM -0700, Andrew Morton wrote: > > --- a/mm/vmalloc.c~mm-vmalloc-track-which-page-table-levels-were-modified-fix-fix > > +++ a/mm/vmalloc.c > > @@ -310,7 +310,7 @@ int map_kernel_range_noflush(unsigned lo > > } while (pgd++, addr = next, addr != end); > > > > if (mask & ARCH_PAGE_TABLE_SYNC_MASK) > > - arch_sync_kernel_mappings(start, end); > > + arch_sync_kernel_mappings(addr, end); > > I think this is wrong, as addr will be equal to end when the loop above > finishes. Using start was right, it needs to contain the address where > the mapping started. > Um, yeah, that was me trying to get a kernel to compile at 9PM :( --- a/mm/vmalloc.c~mm-vmalloc-track-which-page-table-levels-were-modified-fix +++ a/mm/vmalloc.c @@ -291,6 +291,7 @@ static int vmap_p4d_range(pgd_t *pgd, un int map_kernel_range_noflush(unsigned long addr, unsigned long size, pgprot_t prot, struct page **pages) { + unsigned long start = addr; unsigned long end = addr + size; unsigned long next; pgd_t *pgd; @@ -309,6 +310,9 @@ int map_kernel_range_noflush(unsigned lo return err; } while (pgd++, addr = next, addr != end); + if (mask & ARCH_PAGE_TABLE_SYNC_MASK) + arch_sync_kernel_mappings(start, end); + return 0; } _