summaryrefslogtreecommitdiffstats
path: root/arch/arm64/mm/init.c
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2020-11-10 19:05:11 +0100
committerCatalin Marinas <catalin.marinas@arm.com>2020-11-12 08:32:25 +0000
commitc1090bb10d5e15906d296936e64317e35c43f21d (patch)
treecaf928e4d9bd18669e753444458088a7f6654bb9 /arch/arm64/mm/init.c
parent68af6d2483dbd0385317bc87a338b155be75eeb6 (diff)
downloadlinux-c1090bb10d5e15906d296936e64317e35c43f21d.tar.gz
linux-c1090bb10d5e15906d296936e64317e35c43f21d.tar.bz2
linux-c1090bb10d5e15906d296936e64317e35c43f21d.zip
arm64: mm: don't assume struct page is always 64 bytes
Commit 8c96400d6a39be7 simplified the page-to-virt and virt-to-page conversions, based on the assumption that struct page is always 64 bytes in size, in which case we can use a single signed shift to perform the conversion (provided that the vmemmap array is placed appropriately in the kernel VA space) Unfortunately, this assumption turns out not to hold, and so we need to revert part of this commit, and go back to an affine transformation. Given that all the quantities involved are compile time constants, this should not make any practical difference. Fixes: 8c96400d6a39 ("arm64: mm: make vmemmap region a projection of the linear region") Reported-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Link: https://lore.kernel.org/r/20201110180511.29083-1-ardb@kernel.org Tested-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64/mm/init.c')
-rw-r--r--arch/arm64/mm/init.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
index 3a5e9f9298e9..7e15d92836d8 100644
--- a/arch/arm64/mm/init.c
+++ b/arch/arm64/mm/init.c
@@ -502,8 +502,6 @@ static void __init free_unused_memmap(void)
*/
void __init mem_init(void)
{
- BUILD_BUG_ON(!is_power_of_2(sizeof(struct page)));
-
if (swiotlb_force == SWIOTLB_FORCE ||
max_pfn > PFN_DOWN(arm64_dma_phys_limit ? : arm64_dma32_phys_limit))
swiotlb_init(1);