All of lore.kernel.org
 help / color / mirror / Atom feed
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 03/10] ARM: tlb: don't bother with barriers for branch predictor maintenance
Date: Thu,  6 Jun 2013 15:28:27 +0100	[thread overview]
Message-ID: <1370528914-17506-4-git-send-email-will.deacon@arm.com> (raw)
In-Reply-To: <1370528914-17506-1-git-send-email-will.deacon@arm.com>

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 | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/arm/include/asm/tlbflush.h b/arch/arm/include/asm/tlbflush.h
index 55b5e18..e111027 100644
--- a/arch/arm/include/asm/tlbflush.h
+++ b/arch/arm/include/asm/tlbflush.h
@@ -488,6 +488,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;
@@ -497,9 +501,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();
 }
 
 #ifdef CONFIG_ARM_ERRATA_798181
-- 
1.8.2.2

  parent reply	other threads:[~2013-06-06 14:28 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-06 14:28 [PATCH 00/10] Make use of v7 barrier variants in Linux Will Deacon
2013-06-06 14:28 ` [PATCH 01/10] ARM: mm: remove redundant dsb() prior to range TLB invalidation Will Deacon
2013-06-06 14:28 ` [PATCH 02/10] ARM: tlb: don't perform inner-shareable invalidation for local TLB ops Will Deacon
2013-06-13 17:50   ` Jonathan Austin
2013-06-18 11:32     ` Will Deacon
2013-06-06 14:28 ` Will Deacon [this message]
2013-06-06 14:28 ` [PATCH 04/10] ARM: tlb: don't perform inner-shareable invalidation for local BP ops Will Deacon
2013-06-06 14:28 ` [PATCH 05/10] ARM: barrier: allow options to be passed to memory barrier instructions Will Deacon
2013-06-06 14:28 ` [PATCH 06/10] ARM: spinlock: use inner-shareable dsb variant prior to sev instruction Will Deacon
2013-06-06 14:28 ` [PATCH 07/10] ARM: mm: use inner-shareable barriers for TLB and user cache operations Will Deacon
2013-06-06 14:28 ` [PATCH 08/10] ARM: tlb: reduce scope of barrier domains for TLB invalidation Will Deacon
2013-06-06 14:28 ` [PATCH 09/10] ARM: kvm: use inner-shareable barriers after TLB flushing Will Deacon
2013-06-06 14:28 ` [PATCH 10/10] ARM: mcpm: use -st dsb option prior to sev instructions Will Deacon
2013-06-07  4:15   ` Nicolas Pitre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1370528914-17506-4-git-send-email-will.deacon@arm.com \
    --to=will.deacon@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.