Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux

Pull arm64 fix from Will Deacon:
"Arm64 fix for -rc7. Without it, our struct page array can overflow
the vmemmap region on systems with a large PHYS_OFFSET.

Nothing else on the radar at the moment, so hopefully that's it for
4.5 from us.

Summary: Ensure struct page array fits within vmemmap area"

* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
arm64: vmemmap: use virtual projection of linear region

+6 -5
+4 -3
arch/arm64/include/asm/pgtable.h
··· 34 34 /* 35 35 * VMALLOC and SPARSEMEM_VMEMMAP ranges. 36 36 * 37 - * VMEMAP_SIZE: allows the whole VA space to be covered by a struct page array 37 + * VMEMAP_SIZE: allows the whole linear region to be covered by a struct page array 38 38 * (rounded up to PUD_SIZE). 39 39 * VMALLOC_START: beginning of the kernel VA space 40 40 * VMALLOC_END: extends to the available space below vmmemmap, PCI I/O space, 41 41 * fixed mappings and modules 42 42 */ 43 - #define VMEMMAP_SIZE ALIGN((1UL << (VA_BITS - PAGE_SHIFT)) * sizeof(struct page), PUD_SIZE) 43 + #define VMEMMAP_SIZE ALIGN((1UL << (VA_BITS - PAGE_SHIFT - 1)) * sizeof(struct page), PUD_SIZE) 44 44 45 45 #ifndef CONFIG_KASAN 46 46 #define VMALLOC_START (VA_START) ··· 51 51 52 52 #define VMALLOC_END (PAGE_OFFSET - PUD_SIZE - VMEMMAP_SIZE - SZ_64K) 53 53 54 - #define vmemmap ((struct page *)(VMALLOC_END + SZ_64K)) 54 + #define VMEMMAP_START (VMALLOC_END + SZ_64K) 55 + #define vmemmap ((struct page *)VMEMMAP_START - (memstart_addr >> PAGE_SHIFT)) 55 56 56 57 #define FIRST_USER_ADDRESS 0UL 57 58
+2 -2
arch/arm64/mm/init.c
··· 319 319 #endif 320 320 MLG(VMALLOC_START, VMALLOC_END), 321 321 #ifdef CONFIG_SPARSEMEM_VMEMMAP 322 - MLG((unsigned long)vmemmap, 323 - (unsigned long)vmemmap + VMEMMAP_SIZE), 322 + MLG(VMEMMAP_START, 323 + VMEMMAP_START + VMEMMAP_SIZE), 324 324 MLM((unsigned long)virt_to_page(PAGE_OFFSET), 325 325 (unsigned long)virt_to_page(high_memory)), 326 326 #endif