ARM: tlb: don't perform inner-shareable invalidation for local BP ops
authorWill Deacon <will.deacon@arm.com>
Mon, 18 Feb 2013 22:07:47 +0000 (22:07 +0000)
committerWill Deacon <will.deacon@arm.com>
Mon, 12 Aug 2013 11:25:44 +0000 (12:25 +0100)
Now that the ASID allocator doesn't require inner-shareable maintenance,
we can convert the local_bp_flush_all function to perform only
non-shareable flushing, in a similar manner to the TLB invalidation
routines.

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

index 9b725d2bcb6b30e18ffb5b5164fd7dddaaf05173..84718240340c3ecee7999bf4bfa58868bb8029b4 100644 (file)
@@ -531,17 +531,35 @@ 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;
+       const unsigned int __tlb_flag = __cpu_tlb_flags;
+
+       if (tlb_flag(TLB_V6_BP))
+               asm("mcr p15, 0, %0, c7, c5, 6" : : "r" (zero));
+}
+
 static inline void local_flush_bp_all(void)
 {
        const int zero = 0;
        const unsigned int __tlb_flag = __cpu_tlb_flags;
 
+       __local_flush_bp_all();
        if (tlb_flag(TLB_V7_UIS_BP))
-               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));
 }
 
+static inline void __flush_bp_all(void)
+{
+       const int zero = 0;
+       const unsigned int __tlb_flag = __cpu_tlb_flags;
+
+       __local_flush_bp_all();
+       if (tlb_flag(TLB_V7_UIS_BP))
+               asm("mcr p15, 0, %0, c7, c1, 6" : : "r" (zero));
+}
+
 #include <asm/cputype.h>
 #ifdef CONFIG_ARM_ERRATA_798181
 static inline int erratum_a15_798181(void)
index 5883b8ae77c8594d035cc7b6a7e9e835cea4a658..83ccca303df83c4a1f40dce35f324153d979ad16 100644 (file)
@@ -173,5 +173,5 @@ void flush_bp_all(void)
        if (tlb_ops_need_broadcast())
                on_each_cpu(ipi_flush_bp_all, NULL, 1);
        else
-               local_flush_bp_all();
+               __flush_bp_all();
 }