]> Pileus Git - ~andy/linux/commitdiff
ARM: tlb: don't bother with barriers for branch predictor maintenance
authorWill Deacon <will.deacon@arm.com>
Thu, 23 May 2013 17:29:18 +0000 (18:29 +0100)
committerWill Deacon <will.deacon@arm.com>
Mon, 12 Aug 2013 11:25:44 +0000 (12:25 +0100)
Branch predictor maintenance is only required when we are either
changing the kernel's view of memory (switching tables completely) or
dealing with ASID rollover.

Both of these use-cases require subsequent TLB invalidation, which has
the relevant barrier instructions to ensure completion and visibility
of the maintenance, so this patch removes the instruction barrier from
[local_]flush_bp_all.

Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm/include/asm/tlbflush.h

index 3316264916e968b590cee85fb5e44cae5fc043ad..9b725d2bcb6b30e18ffb5b5164fd7dddaaf05173 100644 (file)
@@ -527,6 +527,10 @@ static inline void __flush_tlb_kernel_page(unsigned long kaddr)
        }
 }
 
+/*
+ * Branch predictor maintenance is paired with full TLB invalidation, so
+ * there is no need for any barriers here.
+ */
 static inline void local_flush_bp_all(void)
 {
        const int zero = 0;
@@ -536,9 +540,6 @@ static inline void local_flush_bp_all(void)
                asm("mcr p15, 0, %0, c7, c1, 6" : : "r" (zero));
        else if (tlb_flag(TLB_V6_BP))
                asm("mcr p15, 0, %0, c7, c5, 6" : : "r" (zero));
-
-       if (tlb_flag(TLB_BARRIER))
-               isb();
 }
 
 #include <asm/cputype.h>