Skip to content

Commit c1b4ec8

Browse files
committed
Merge tag 'x86-mm-2020-10-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 mm updates from Ingo Molnar: "Do not sync vmalloc/ioremap mappings on x86-64 kernels. Hopefully now without the bugs!" * tag 'x86-mm-2020-10-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/mm/64: Update comment in preallocate_vmalloc_pages() x86/mm/64: Do not sync vmalloc/ioremap mappings
2 parents b85cac5 + 7a27ef5 commit c1b4ec8

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

arch/x86/include/asm/pgtable_64_types.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,4 @@ extern unsigned int ptrs_per_p4d;
159159

160160
#define PGD_KERNEL_START ((PAGE_SIZE / 2) / sizeof(pgd_t))
161161

162-
#define ARCH_PAGE_TABLE_SYNC_MASK (pgtable_l5_enabled() ? PGTBL_PGD_MODIFIED : PGTBL_P4D_MODIFIED)
163-
164162
#endif /* _ASM_X86_PGTABLE_64_DEFS_H */

arch/x86/mm/init_64.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,6 @@ static void sync_global_pgds(unsigned long start, unsigned long end)
217217
sync_global_pgds_l4(start, end);
218218
}
219219

220-
void arch_sync_kernel_mappings(unsigned long start, unsigned long end)
221-
{
222-
sync_global_pgds(start, end);
223-
}
224-
225220
/*
226221
* NOTE: This function is marked __ref because it calls __init function
227222
* (alloc_bootmem_pages). It's safe to do it ONLY when after_bootmem == 0.
@@ -1257,14 +1252,19 @@ static void __init preallocate_vmalloc_pages(void)
12571252
if (!p4d)
12581253
goto failed;
12591254

1260-
/*
1261-
* With 5-level paging the P4D level is not folded. So the PGDs
1262-
* are now populated and there is no need to walk down to the
1263-
* PUD level.
1264-
*/
12651255
if (pgtable_l5_enabled())
12661256
continue;
12671257

1258+
/*
1259+
* The goal here is to allocate all possibly required
1260+
* hardware page tables pointed to by the top hardware
1261+
* level.
1262+
*
1263+
* On 4-level systems, the P4D layer is folded away and
1264+
* the above code does no preallocation. Below, go down
1265+
* to the pud _software_ level to ensure the second
1266+
* hardware level is allocated on 4-level systems too.
1267+
*/
12681268
lvl = "pud";
12691269
pud = pud_alloc(&init_mm, p4d, addr);
12701270
if (!pud)

0 commit comments

Comments
 (0)