@@ -65,7 +65,6 @@ static vm_fault_t vdso_fault(const struct vm_special_mapping *sm,
6565static void vdso_fix_landing (const struct vdso_image * image ,
6666 struct vm_area_struct * new_vma )
6767{
68- #if defined CONFIG_X86_32 || defined CONFIG_IA32_EMULATION
6968 if (in_ia32_syscall () && image == & vdso_image_32 ) {
7069 struct pt_regs * regs = current_pt_regs ();
7170 unsigned long vdso_land = image -> sym_int80_landing_pad ;
@@ -76,7 +75,6 @@ static void vdso_fix_landing(const struct vdso_image *image,
7675 if (regs -> ip == old_land_addr )
7776 regs -> ip = new_vma -> vm_start + vdso_land ;
7877 }
79- #endif
8078}
8179
8280static 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)
227225 return map_vdso (image , addr );
228226}
229227
230- #if defined(CONFIG_X86_32 ) || defined(CONFIG_IA32_EMULATION )
231228static int load_vdso32 (void )
232229{
233230 if (vdso32_enabled != 1 ) /* Other values all mean "disabled" */
234231 return 0 ;
235232
236233 return map_vdso (& vdso_image_32 , 0 );
237234}
238- #endif
239235
240- #ifdef CONFIG_X86_64
241236int arch_setup_additional_pages (struct linux_binprm * bprm , int uses_interp )
242237{
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+ }
245244
246- return map_vdso ( & vdso_image_64 , 0 );
245+ return load_vdso32 ( );
247246}
248247
249248#ifdef CONFIG_COMPAT
250249int compat_arch_setup_additional_pages (struct linux_binprm * bprm ,
251250 int uses_interp , bool x32 )
252251{
253- #ifdef CONFIG_X86_X32_ABI
254- if (x32 ) {
252+ if (IS_ENABLED (CONFIG_X86_X32_ABI ) && x32 ) {
255253 if (!vdso64_enabled )
256254 return 0 ;
257255 return map_vdso (& vdso_image_x32 , 0 );
258256 }
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+
263261 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 ();
271262}
272263#endif
273264
274265bool arch_syscall_is_vdso_sigreturn (struct pt_regs * regs )
275266{
276- #if defined(CONFIG_X86_32 ) || defined(CONFIG_IA32_EMULATION )
277267 const struct vdso_image * image = current -> mm -> context .vdso_image ;
278268 unsigned long vdso = (unsigned long ) current -> mm -> context .vdso ;
279269
@@ -282,7 +272,6 @@ bool arch_syscall_is_vdso_sigreturn(struct pt_regs *regs)
282272 regs -> ip == vdso + image -> sym_vdso32_rt_sigreturn_landing_pad )
283273 return true;
284274 }
285- #endif
286275 return false;
287276}
288277
0 commit comments