arm64: mm: avoid virt_to_page() translation for the zero page
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Wed, 30 Mar 2016 14:45:58 +0000 (16:45 +0200)
committerWill Deacon <will.deacon@arm.com>
Thu, 14 Apr 2016 15:31:49 +0000 (16:31 +0100)
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 <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/include/asm/pgtable.h

index aa6106ac050c7e622a1a5e13c297b23c5a6464f4..377257a8d393598033d22c85713a0a05a752b8ff 100644 (file)
@@ -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))