aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-s390
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-s390')
-rw-r--r--include/asm-s390/tlbflush.h33
1 files changed, 21 insertions, 12 deletions
diff --git a/include/asm-s390/tlbflush.h b/include/asm-s390/tlbflush.h
index 35fb4f9127b2..de723470c5d4 100644
--- a/include/asm-s390/tlbflush.h
+++ b/include/asm-s390/tlbflush.h
@@ -13,6 +13,7 @@ static inline void __tlb_flush_local(void)
13 asm volatile("ptlb" : : : "memory"); 13 asm volatile("ptlb" : : : "memory");
14} 14}
15 15
16#ifdef CONFIG_SMP
16/* 17/*
17 * Flush all tlb entries on all cpus. 18 * Flush all tlb entries on all cpus.
18 */ 19 */
@@ -39,6 +40,25 @@ static inline void __tlb_flush_global(void)
39 : : "d" (reg2), "d" (reg3), "d" (reg4), "m" (dummy) : "cc" ); 40 : : "d" (reg2), "d" (reg3), "d" (reg4), "m" (dummy) : "cc" );
40} 41}
41 42
43static inline void __tlb_flush_full(struct mm_struct *mm)
44{
45 cpumask_t local_cpumask;
46
47 preempt_disable();
48 /*
49 * If the process only ran on the local cpu, do a local flush.
50 */
51 local_cpumask = cpumask_of_cpu(smp_processor_id());
52 if (cpus_equal(mm->cpu_vm_mask, local_cpumask))
53 __tlb_flush_local();
54 else
55 __tlb_flush_global();
56 preempt_enable();
57}
58#else
59#define __tlb_flush_full(mm) __tlb_flush_local()
60#endif
61
42/* 62/*
43 * Flush all tlb entries of a page table on all cpus. 63 * Flush all tlb entries of a page table on all cpus.
44 */ 64 */
@@ -51,8 +71,6 @@ static inline void __tlb_flush_idte(unsigned long asce)
51 71
52static inline void __tlb_flush_mm(struct mm_struct * mm) 72static inline void __tlb_flush_mm(struct mm_struct * mm)
53{ 73{
54 cpumask_t local_cpumask;
55
56 if (unlikely(cpus_empty(mm->cpu_vm_mask))) 74 if (unlikely(cpus_empty(mm->cpu_vm_mask)))
57 return; 75 return;
58 /* 76 /*
@@ -69,16 +87,7 @@ static inline void __tlb_flush_mm(struct mm_struct * mm)
69 mm->context.asce_bits); 87 mm->context.asce_bits);
70 return; 88 return;
71 } 89 }
72 preempt_disable(); 90 __tlb_flush_full(mm);
73 /*
74 * If the process only ran on the local cpu, do a local flush.
75 */
76 local_cpumask = cpumask_of_cpu(smp_processor_id());
77 if (cpus_equal(mm->cpu_vm_mask, local_cpumask))
78 __tlb_flush_local();
79 else
80 __tlb_flush_global();
81 preempt_enable();
82} 91}
83 92
84static inline void __tlb_flush_mm_cond(struct mm_struct * mm) 93static inline void __tlb_flush_mm_cond(struct mm_struct * mm)