Patch "arm64: account for sparsemem section alignment when choosing vmemmap offset" has been added to the 4.4-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
arm64: account for sparsemem section alignment when choosing vmemmap offset
to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
arm64-account-for-sparsemem-section-alignment-when-choosing-vmemmap-offset.patch
and it can be found in the queue-4.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
36e5cd6b897e17d03008f81e075625d8e43e52d0Mon Sep 17 00:00:00 2001
From: Ard Biesheuvel <[email protected]>
Date: Tue, 8 Mar 2016 21:09:29 +0700
Subject: arm64: account for sparsemem section alignment when choosing vmemmap offset
From: Ard Biesheuvel <[email protected]>
commit 36e5cd6b897e17d03008f81e075625d8e43e52d0 upstream.
Commit dfd55ad85e4a ("arm64: vmemmap: use virtual projection of linear region") fixed an issue where the struct page array would overflow into the adjacent virtual memory region if system RAM was placed so high up in physical memory that its addresses were not representable in the build time configured virtual address size.
However, the fix failed to take into account that the vmemmap region needs to be relatively aligned with respect to the sparsemem section size, so that a sequence of page structs corresponding with a sparsemem section in the linear region appears naturally aligned in the vmemmap region.
So round up vmemmap to sparsemem section size. Since this essentially moves the projection of the linear region up in memory, also revert the reduction of the size of the vmemmap region.
--- arch/arm64/include/asm/pgtable.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
arch/arm64/include/asm/pgtable.h +3 -2
@@ -40,7 +40,7 @@* VMALLOC_END: extends to the available space below vmmemmap, PCI I/O space, * fixed mappings and modules */ -#define VMEMMAP_SIZE ALIGN((1UL << (VA_BITS - PAGE_SHIFT - 1)) * sizeof(struct page), PUD_SIZE) +#define VMEMMAP_SIZE ALIGN((1UL << (VA_BITS - PAGE_SHIFT)) * sizeof(struct page), PUD_SIZE)#ifndef CONFIG_KASAN #define VMALLOC_START (VA_START)
@@ -52,7 +52,8 @@#define VMALLOC_END (PAGE_OFFSET - PUD_SIZE - VMEMMAP_SIZE - SZ_64K)#define VMEMMAP_START (VMALLOC_END + SZ_64K) -#define vmemmap ((struct page *)VMEMMAP_START - (memstart_addr >> PAGE_SHIFT)) +#define vmemmap ((struct page *)VMEMMAP_START - \ + SECTION_ALIGN_DOWN(memstart_addr >> PAGE_SHIFT))#define FIRST_USER_ADDRESS 0UL
Patches currently in stable-queue which might be from [email protected] are
queue-4.4/arm64-account-for-sparsemem-section-alignment-when-choosing-vmemmap-offset.patch