summaryrefslogtreecommitdiffstats
path: root/arch/arm/mm/context.c
diff options
context:
space:
mode:
authorWill Deacon2013-02-28 17:48:40 +0100
committerRussell King2013-03-03 23:54:16 +0100
commit89c7e4b8bbb3d4fa52df5746a8ad38e610143651 (patch)
treef6d3d835f5fca88fd4de01f166d782f16c2fe3c9 /arch/arm/mm/context.c
parentARM: 7660/1: tlb: add branch predictor maintenance operations (diff)
downloadkernel-qcow2-linux-89c7e4b8bbb3d4fa52df5746a8ad38e610143651.tar.gz
kernel-qcow2-linux-89c7e4b8bbb3d4fa52df5746a8ad38e610143651.tar.xz
kernel-qcow2-linux-89c7e4b8bbb3d4fa52df5746a8ad38e610143651.zip
ARM: 7661/1: mm: perform explicit branch predictor maintenance when required
The ARM ARM requires branch predictor maintenance if, for a given ASID, the instructions at a specific virtual address appear to change. From the kernel's point of view, that means: - Changing the kernel's view of memory (e.g. switching to the identity map) - ASID rollover (since ASIDs will be re-allocated to new tasks) This patch adds explicit branch predictor maintenance when either of the two conditions above are met. Reviewed-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mm/context.c')
-rw-r--r--arch/arm/mm/context.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/arm/mm/context.c b/arch/arm/mm/context.c
index 44d4ee52f3e2..a5a4b2bc42ba 100644
--- a/arch/arm/mm/context.c
+++ b/arch/arm/mm/context.c
@@ -212,8 +212,10 @@ void check_and_switch_context(struct mm_struct *mm, struct task_struct *tsk)
atomic64_set(&mm->context.id, asid);
}
- if (cpumask_test_and_clear_cpu(cpu, &tlb_flush_pending))
+ if (cpumask_test_and_clear_cpu(cpu, &tlb_flush_pending)) {
+ local_flush_bp_all();
local_flush_tlb_all();
+ }
atomic64_set(&per_cpu(active_asids, cpu), asid);
cpumask_set_cpu(cpu, mm_cpumask(mm));