This source file includes following definitions.
- __tlb_flush_local
- __tlb_flush_idte
- __tlb_flush_global
- __tlb_flush_mm
- __tlb_flush_kernel
- __tlb_flush_mm_lazy
- flush_tlb_mm
- flush_tlb_range
- flush_tlb_kernel_range
1
2 #ifndef _S390_TLBFLUSH_H
3 #define _S390_TLBFLUSH_H
4
5 #include <linux/mm.h>
6 #include <linux/sched.h>
7 #include <asm/processor.h>
8 #include <asm/pgalloc.h>
9 #include <asm/pgtable.h>
10
11
12
13
14 static inline void __tlb_flush_local(void)
15 {
16 asm volatile("ptlb" : : : "memory");
17 }
18
19
20
21
22 static inline void __tlb_flush_idte(unsigned long asce)
23 {
24 unsigned long opt;
25
26 opt = IDTE_PTOA;
27 if (MACHINE_HAS_TLB_GUEST)
28 opt |= IDTE_GUEST_ASCE;
29
30 asm volatile(
31 " .insn rrf,0xb98e0000,0,%0,%1,0"
32 : : "a" (opt), "a" (asce) : "cc");
33 }
34
35 void smp_ptlb_all(void);
36
37
38
39
40 static inline void __tlb_flush_global(void)
41 {
42 unsigned int dummy = 0;
43
44 csp(&dummy, 0, 0);
45 }
46
47
48
49
50
51 static inline void __tlb_flush_mm(struct mm_struct *mm)
52 {
53 unsigned long gmap_asce;
54
55
56
57
58
59
60 preempt_disable();
61 atomic_inc(&mm->context.flush_count);
62
63 cpumask_copy(mm_cpumask(mm), &mm->context.cpu_attach_mask);
64 barrier();
65 gmap_asce = READ_ONCE(mm->context.gmap_asce);
66 if (MACHINE_HAS_IDTE && gmap_asce != -1UL) {
67 if (gmap_asce)
68 __tlb_flush_idte(gmap_asce);
69 __tlb_flush_idte(mm->context.asce);
70 } else {
71
72 __tlb_flush_global();
73 }
74 atomic_dec(&mm->context.flush_count);
75 preempt_enable();
76 }
77
78 static inline void __tlb_flush_kernel(void)
79 {
80 if (MACHINE_HAS_IDTE)
81 __tlb_flush_idte(init_mm.context.asce);
82 else
83 __tlb_flush_global();
84 }
85
86 static inline void __tlb_flush_mm_lazy(struct mm_struct * mm)
87 {
88 spin_lock(&mm->context.lock);
89 if (mm->context.flush_mm) {
90 mm->context.flush_mm = 0;
91 __tlb_flush_mm(mm);
92 }
93 spin_unlock(&mm->context.lock);
94 }
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114 #define flush_tlb() do { } while (0)
115 #define flush_tlb_all() do { } while (0)
116 #define flush_tlb_page(vma, addr) do { } while (0)
117
118 static inline void flush_tlb_mm(struct mm_struct *mm)
119 {
120 __tlb_flush_mm_lazy(mm);
121 }
122
123 static inline void flush_tlb_range(struct vm_area_struct *vma,
124 unsigned long start, unsigned long end)
125 {
126 __tlb_flush_mm_lazy(vma->vm_mm);
127 }
128
129 static inline void flush_tlb_kernel_range(unsigned long start,
130 unsigned long end)
131 {
132 __tlb_flush_kernel();
133 }
134
135 #endif