path: root/arch/arm64/include/asm/tlbflush.h
diff options
authorCatalin Marinas <catalin.marinas@arm.com>2014-06-09 11:55:03 +0100
committerMark Brown <broonie@linaro.org>2014-07-25 12:47:54 +0100
commit6dca4f12e885d399d7a6fb9ab396981153886f9e (patch)
tree1bdf51c4f1a75cc3cb5efc893e3993fc92a5b96e /arch/arm64/include/asm/tlbflush.h
parent47672573e09067c14f7e248778acaf6360ec2770 (diff)
arm64: Fix barriers used for page table modifications
The architecture specification states that both DSB and ISB are required between page table modifications and subsequent memory accesses using the corresponding virtual address. When TLB invalidation takes place, the tlb_flush_* functions already have the necessary barriers. However, there are other functions like create_mapping() for which this is not the case. The patch adds the DSB+ISB instructions in the set_pte() function for valid kernel mappings. The invalid pte case is handled by tlb_flush_* and the user mappings in general have a corresponding update_mmu_cache() call containing a DSB. Even when update_mmu_cache() isn't called, the kernel can still cope with an unlikely spurious page fault by re-executing the instruction. In addition, the set_pmd, set_pud() functions gain an ISB for architecture compliance when block mappings are created. Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Reported-by: Leif Lindholm <leif.lindholm@linaro.org> Acked-by: Steve Capper <steve.capper@linaro.org> Cc: Will Deacon <will.deacon@arm.com> (cherry picked from commit 54d6ba0ede61f12b2a03d74bdbf004719a9cfefc) Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'arch/arm64/include/asm/tlbflush.h')
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/arm64/include/asm/tlbflush.h b/arch/arm64/include/asm/tlbflush.h
index b9349c4513ea..3796ea6bb734 100644
--- a/arch/arm64/include/asm/tlbflush.h
+++ b/arch/arm64/include/asm/tlbflush.h
@@ -122,6 +122,7 @@ static inline void flush_tlb_kernel_range(unsigned long start, unsigned long end
for (addr = start; addr < end; addr += 1 << (PAGE_SHIFT - 12))
asm("tlbi vaae1is, %0" : : "r"(addr));
+ isb();
@@ -131,8 +132,8 @@ static inline void update_mmu_cache(struct vm_area_struct *vma,
unsigned long addr, pte_t *ptep)
- * set_pte() does not have a DSB, so make sure that the page table
- * write is visible.
+ * set_pte() does not have a DSB for user mappings, so make sure that
+ * the page table write is visible.