diff options
Diffstat (limited to 'arch/s390/kernel/vdso.c')
-rw-r--r-- | arch/s390/kernel/vdso.c | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/arch/s390/kernel/vdso.c b/arch/s390/kernel/vdso.c index d73630b4fe1d..e704a9965f90 100644 --- a/arch/s390/kernel/vdso.c +++ b/arch/s390/kernel/vdso.c | |||
@@ -89,18 +89,11 @@ static void vdso_init_data(struct vdso_data *vd) | |||
89 | 89 | ||
90 | #ifdef CONFIG_64BIT | 90 | #ifdef CONFIG_64BIT |
91 | /* | 91 | /* |
92 | * Setup per cpu vdso data page. | ||
93 | */ | ||
94 | static void vdso_init_per_cpu_data(int cpu, struct vdso_per_cpu_data *vpcd) | ||
95 | { | ||
96 | } | ||
97 | |||
98 | /* | ||
99 | * Allocate/free per cpu vdso data. | 92 | * Allocate/free per cpu vdso data. |
100 | */ | 93 | */ |
101 | #define SEGMENT_ORDER 2 | 94 | #define SEGMENT_ORDER 2 |
102 | 95 | ||
103 | int vdso_alloc_per_cpu(int cpu, struct _lowcore *lowcore) | 96 | int vdso_alloc_per_cpu(struct _lowcore *lowcore) |
104 | { | 97 | { |
105 | unsigned long segment_table, page_table, page_frame; | 98 | unsigned long segment_table, page_table, page_frame; |
106 | u32 *psal, *aste; | 99 | u32 *psal, *aste; |
@@ -139,7 +132,6 @@ int vdso_alloc_per_cpu(int cpu, struct _lowcore *lowcore) | |||
139 | aste[4] = (u32)(addr_t) psal; | 132 | aste[4] = (u32)(addr_t) psal; |
140 | lowcore->vdso_per_cpu_data = page_frame; | 133 | lowcore->vdso_per_cpu_data = page_frame; |
141 | 134 | ||
142 | vdso_init_per_cpu_data(cpu, (struct vdso_per_cpu_data *) page_frame); | ||
143 | return 0; | 135 | return 0; |
144 | 136 | ||
145 | out: | 137 | out: |
@@ -149,7 +141,7 @@ out: | |||
149 | return -ENOMEM; | 141 | return -ENOMEM; |
150 | } | 142 | } |
151 | 143 | ||
152 | void vdso_free_per_cpu(int cpu, struct _lowcore *lowcore) | 144 | void vdso_free_per_cpu(struct _lowcore *lowcore) |
153 | { | 145 | { |
154 | unsigned long segment_table, page_table, page_frame; | 146 | unsigned long segment_table, page_table, page_frame; |
155 | u32 *psal, *aste; | 147 | u32 *psal, *aste; |
@@ -168,19 +160,15 @@ void vdso_free_per_cpu(int cpu, struct _lowcore *lowcore) | |||
168 | free_pages(segment_table, SEGMENT_ORDER); | 160 | free_pages(segment_table, SEGMENT_ORDER); |
169 | } | 161 | } |
170 | 162 | ||
171 | static void __vdso_init_cr5(void *dummy) | 163 | static void vdso_init_cr5(void) |
172 | { | 164 | { |
173 | unsigned long cr5; | 165 | unsigned long cr5; |
174 | 166 | ||
167 | if (user_mode == HOME_SPACE_MODE || !vdso_enabled) | ||
168 | return; | ||
175 | cr5 = offsetof(struct _lowcore, paste); | 169 | cr5 = offsetof(struct _lowcore, paste); |
176 | __ctl_load(cr5, 5, 5); | 170 | __ctl_load(cr5, 5, 5); |
177 | } | 171 | } |
178 | |||
179 | static void vdso_init_cr5(void) | ||
180 | { | ||
181 | if (user_mode != HOME_SPACE_MODE && vdso_enabled) | ||
182 | on_each_cpu(__vdso_init_cr5, NULL, 1); | ||
183 | } | ||
184 | #endif /* CONFIG_64BIT */ | 172 | #endif /* CONFIG_64BIT */ |
185 | 173 | ||
186 | /* | 174 | /* |
@@ -322,10 +310,8 @@ static int __init vdso_init(void) | |||
322 | } | 310 | } |
323 | vdso64_pagelist[vdso64_pages - 1] = virt_to_page(vdso_data); | 311 | vdso64_pagelist[vdso64_pages - 1] = virt_to_page(vdso_data); |
324 | vdso64_pagelist[vdso64_pages] = NULL; | 312 | vdso64_pagelist[vdso64_pages] = NULL; |
325 | #ifndef CONFIG_SMP | 313 | if (vdso_alloc_per_cpu(&S390_lowcore)) |
326 | if (vdso_alloc_per_cpu(0, &S390_lowcore)) | ||
327 | BUG(); | 314 | BUG(); |
328 | #endif | ||
329 | vdso_init_cr5(); | 315 | vdso_init_cr5(); |
330 | #endif /* CONFIG_64BIT */ | 316 | #endif /* CONFIG_64BIT */ |
331 | 317 | ||
@@ -335,7 +321,7 @@ static int __init vdso_init(void) | |||
335 | 321 | ||
336 | return 0; | 322 | return 0; |
337 | } | 323 | } |
338 | arch_initcall(vdso_init); | 324 | early_initcall(vdso_init); |
339 | 325 | ||
340 | int in_gate_area_no_mm(unsigned long addr) | 326 | int in_gate_area_no_mm(unsigned long addr) |
341 | { | 327 | { |