diff options
Diffstat (limited to 'include/asm-s390/tlbflush.h')
| -rw-r--r-- | include/asm-s390/tlbflush.h | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/include/asm-s390/tlbflush.h b/include/asm-s390/tlbflush.h index 35fb4f9127b2..9e57a93d7de1 100644 --- a/include/asm-s390/tlbflush.h +++ b/include/asm-s390/tlbflush.h | |||
| @@ -13,12 +13,14 @@ 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 | */ |
| 20 | void smp_ptlb_all(void); | ||
| 21 | |||
| 19 | static inline void __tlb_flush_global(void) | 22 | static inline void __tlb_flush_global(void) |
| 20 | { | 23 | { |
| 21 | extern void smp_ptlb_all(void); | ||
| 22 | register unsigned long reg2 asm("2"); | 24 | register unsigned long reg2 asm("2"); |
| 23 | register unsigned long reg3 asm("3"); | 25 | register unsigned long reg3 asm("3"); |
| 24 | register unsigned long reg4 asm("4"); | 26 | register unsigned long reg4 asm("4"); |
| @@ -39,6 +41,25 @@ static inline void __tlb_flush_global(void) | |||
| 39 | : : "d" (reg2), "d" (reg3), "d" (reg4), "m" (dummy) : "cc" ); | 41 | : : "d" (reg2), "d" (reg3), "d" (reg4), "m" (dummy) : "cc" ); |
| 40 | } | 42 | } |
| 41 | 43 | ||
| 44 | static inline void __tlb_flush_full(struct mm_struct *mm) | ||
| 45 | { | ||
| 46 | cpumask_t local_cpumask; | ||
| 47 | |||
| 48 | preempt_disable(); | ||
| 49 | /* | ||
| 50 | * If the process only ran on the local cpu, do a local flush. | ||
| 51 | */ | ||
| 52 | local_cpumask = cpumask_of_cpu(smp_processor_id()); | ||
| 53 | if (cpus_equal(mm->cpu_vm_mask, local_cpumask)) | ||
| 54 | __tlb_flush_local(); | ||
| 55 | else | ||
| 56 | __tlb_flush_global(); | ||
| 57 | preempt_enable(); | ||
| 58 | } | ||
| 59 | #else | ||
| 60 | #define __tlb_flush_full(mm) __tlb_flush_local() | ||
| 61 | #endif | ||
| 62 | |||
| 42 | /* | 63 | /* |
| 43 | * Flush all tlb entries of a page table on all cpus. | 64 | * Flush all tlb entries of a page table on all cpus. |
| 44 | */ | 65 | */ |
| @@ -51,8 +72,6 @@ static inline void __tlb_flush_idte(unsigned long asce) | |||
| 51 | 72 | ||
| 52 | static inline void __tlb_flush_mm(struct mm_struct * mm) | 73 | static inline void __tlb_flush_mm(struct mm_struct * mm) |
| 53 | { | 74 | { |
| 54 | cpumask_t local_cpumask; | ||
| 55 | |||
| 56 | if (unlikely(cpus_empty(mm->cpu_vm_mask))) | 75 | if (unlikely(cpus_empty(mm->cpu_vm_mask))) |
| 57 | return; | 76 | return; |
| 58 | /* | 77 | /* |
| @@ -69,16 +88,7 @@ static inline void __tlb_flush_mm(struct mm_struct * mm) | |||
| 69 | mm->context.asce_bits); | 88 | mm->context.asce_bits); |
| 70 | return; | 89 | return; |
| 71 | } | 90 | } |
| 72 | preempt_disable(); | 91 | __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 | } | 92 | } |
| 83 | 93 | ||
| 84 | static inline void __tlb_flush_mm_cond(struct mm_struct * mm) | 94 | static inline void __tlb_flush_mm_cond(struct mm_struct * mm) |
