@@ -65,7 +65,6 @@ static vm_fault_t vdso_fault(const struct vm_special_mapping *sm,
65
65
static void vdso_fix_landing (const struct vdso_image * image ,
66
66
struct vm_area_struct * new_vma )
67
67
{
68
- #if defined CONFIG_X86_32 || defined CONFIG_IA32_EMULATION
69
68
if (in_ia32_syscall () && image == & vdso_image_32 ) {
70
69
struct pt_regs * regs = current_pt_regs ();
71
70
unsigned long vdso_land = image -> sym_int80_landing_pad ;
@@ -76,7 +75,6 @@ static void vdso_fix_landing(const struct vdso_image *image,
76
75
if (regs -> ip == old_land_addr )
77
76
regs -> ip = new_vma -> vm_start + vdso_land ;
78
77
}
79
- #endif
80
78
}
81
79
82
80
static int vdso_mremap (const struct vm_special_mapping * sm ,
@@ -227,53 +225,45 @@ int map_vdso_once(const struct vdso_image *image, unsigned long addr)
227
225
return map_vdso (image , addr );
228
226
}
229
227
230
- #if defined(CONFIG_X86_32 ) || defined(CONFIG_IA32_EMULATION )
231
228
static int load_vdso32 (void )
232
229
{
233
230
if (vdso32_enabled != 1 ) /* Other values all mean "disabled" */
234
231
return 0 ;
235
232
236
233
return map_vdso (& vdso_image_32 , 0 );
237
234
}
238
- #endif
239
235
240
- #ifdef CONFIG_X86_64
241
236
int arch_setup_additional_pages (struct linux_binprm * bprm , int uses_interp )
242
237
{
243
- if (!vdso64_enabled )
244
- return 0 ;
238
+ if (IS_ENABLED (CONFIG_X86_64 )) {
239
+ if (!vdso64_enabled )
240
+ return 0 ;
241
+
242
+ return map_vdso (& vdso_image_64 , 0 );
243
+ }
245
244
246
- return map_vdso ( & vdso_image_64 , 0 );
245
+ return load_vdso32 ( );
247
246
}
248
247
249
248
#ifdef CONFIG_COMPAT
250
249
int compat_arch_setup_additional_pages (struct linux_binprm * bprm ,
251
250
int uses_interp , bool x32 )
252
251
{
253
- #ifdef CONFIG_X86_X32_ABI
254
- if (x32 ) {
252
+ if (IS_ENABLED (CONFIG_X86_X32_ABI ) && x32 ) {
255
253
if (!vdso64_enabled )
256
254
return 0 ;
257
255
return map_vdso (& vdso_image_x32 , 0 );
258
256
}
259
- #endif
260
- #ifdef CONFIG_IA32_EMULATION
261
- return load_vdso32 ();
262
- #else
257
+
258
+ if ( IS_ENABLED ( CONFIG_IA32_EMULATION ))
259
+ return load_vdso32 ();
260
+
263
261
return 0 ;
264
- #endif
265
- }
266
- #endif
267
- #else
268
- int arch_setup_additional_pages (struct linux_binprm * bprm , int uses_interp )
269
- {
270
- return load_vdso32 ();
271
262
}
272
263
#endif
273
264
274
265
bool arch_syscall_is_vdso_sigreturn (struct pt_regs * regs )
275
266
{
276
- #if defined(CONFIG_X86_32 ) || defined(CONFIG_IA32_EMULATION )
277
267
const struct vdso_image * image = current -> mm -> context .vdso_image ;
278
268
unsigned long vdso = (unsigned long ) current -> mm -> context .vdso ;
279
269
@@ -282,7 +272,6 @@ bool arch_syscall_is_vdso_sigreturn(struct pt_regs *regs)
282
272
regs -> ip == vdso + image -> sym_vdso32_rt_sigreturn_landing_pad )
283
273
return true;
284
274
}
285
- #endif
286
275
return false;
287
276
}
288
277
0 commit comments