From: Ard Biesheuvel Date: Wed, 30 Mar 2016 14:45:58 +0000 (+0200) Subject: arm64: mm: avoid virt_to_page() translation for the zero page X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=22b6f3b0549be61a2d5fe8210ff7628e6d2d8185;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git arm64: mm: avoid virt_to_page() translation for the zero page The zero page is statically allocated, so grab its struct page pointer without using virt_to_page(), which will be restricted to the linear mapping later. Signed-off-by: Ard Biesheuvel Signed-off-by: Will Deacon --- diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index aa6106ac050c..377257a8d393 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h @@ -57,7 +57,7 @@ extern void __pgd_error(const char *file, int line, unsigned long val); * for zero-mapped memory areas etc.. */ extern unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)]; -#define ZERO_PAGE(vaddr) virt_to_page(empty_zero_page) +#define ZERO_PAGE(vaddr) pfn_to_page(PHYS_PFN(__pa(empty_zero_page))) #define pte_ERROR(pte) __pte_error(__FILE__, __LINE__, pte_val(pte))