diff options
Diffstat (limited to 'arch/s390/kernel/vdso.c')
-rw-r--r-- | arch/s390/kernel/vdso.c | 38 |
1 files changed, 9 insertions, 29 deletions
diff --git a/arch/s390/kernel/vdso.c b/arch/s390/kernel/vdso.c index d73630b4fe1d..9c80138206b0 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 | /* |
@@ -253,17 +241,11 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) | |||
253 | * on the "data" page of the vDSO or you'll stop getting kernel | 241 | * on the "data" page of the vDSO or you'll stop getting kernel |
254 | * updates and your nice userland gettimeofday will be totally dead. | 242 | * updates and your nice userland gettimeofday will be totally dead. |
255 | * It's fine to use that for setting breakpoints in the vDSO code | 243 | * It's fine to use that for setting breakpoints in the vDSO code |
256 | * pages though | 244 | * pages though. |
257 | * | ||
258 | * Make sure the vDSO gets into every core dump. | ||
259 | * Dumping its contents makes post-mortem fully interpretable later | ||
260 | * without matching up the same kernel and hardware config to see | ||
261 | * what PC values meant. | ||
262 | */ | 245 | */ |
263 | rc = install_special_mapping(mm, vdso_base, vdso_pages << PAGE_SHIFT, | 246 | rc = install_special_mapping(mm, vdso_base, vdso_pages << PAGE_SHIFT, |
264 | VM_READ|VM_EXEC| | 247 | VM_READ|VM_EXEC| |
265 | VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC| | 248 | VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC, |
266 | VM_ALWAYSDUMP, | ||
267 | vdso_pagelist); | 249 | vdso_pagelist); |
268 | if (rc) | 250 | if (rc) |
269 | current->mm->context.vdso_base = 0; | 251 | current->mm->context.vdso_base = 0; |
@@ -322,10 +304,8 @@ static int __init vdso_init(void) | |||
322 | } | 304 | } |
323 | vdso64_pagelist[vdso64_pages - 1] = virt_to_page(vdso_data); | 305 | vdso64_pagelist[vdso64_pages - 1] = virt_to_page(vdso_data); |
324 | vdso64_pagelist[vdso64_pages] = NULL; | 306 | vdso64_pagelist[vdso64_pages] = NULL; |
325 | #ifndef CONFIG_SMP | 307 | if (vdso_alloc_per_cpu(&S390_lowcore)) |
326 | if (vdso_alloc_per_cpu(0, &S390_lowcore)) | ||
327 | BUG(); | 308 | BUG(); |
328 | #endif | ||
329 | vdso_init_cr5(); | 309 | vdso_init_cr5(); |
330 | #endif /* CONFIG_64BIT */ | 310 | #endif /* CONFIG_64BIT */ |
331 | 311 | ||
@@ -335,7 +315,7 @@ static int __init vdso_init(void) | |||
335 | 315 | ||
336 | return 0; | 316 | return 0; |
337 | } | 317 | } |
338 | arch_initcall(vdso_init); | 318 | early_initcall(vdso_init); |
339 | 319 | ||
340 | int in_gate_area_no_mm(unsigned long addr) | 320 | int in_gate_area_no_mm(unsigned long addr) |
341 | { | 321 | { |