Message ID | 20151123165214.GD32300@e104818-lin.cambridge.arm.com |
---|---|
State | New |
Headers | show |
diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index abb66f84d4ac..d110313e58e9 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -113,14 +113,20 @@ static void __populate_init_pte(pte_t *pte, unsigned long addr, pgprot_t prot) { unsigned long pfn = __phys_to_pfn(phys); + bool need_flush = false; do { + if (!pte_none(*pte)) + need_flush = true; /* clear all the bits except the pfn, then apply the prot */ set_pte(pte, pfn_pte(pfn, prot)); pte++; pfn++; addr += PAGE_SIZE; } while (addr != end); + + if (need_flush) + flush_tlb_all(); } static void alloc_init_pte(pmd_t *pmd, unsigned long addr,