Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'x86-entry-2025-05-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 vdso updates from Ingo Molnar:
"Two changes to simplify the x86 vDSO code a bit"

* tag 'x86-entry-2025-05-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/vdso: Remove redundant #ifdeffery around in_ia32_syscall()
x86/vdso: Remove #ifdeffery around page setup variants

+12 -35
+12 -23
arch/x86/entry/vdso/vma.c
··· 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; ··· 75 76 if (regs->ip == old_land_addr) 76 77 regs->ip = new_vma->vm_start + vdso_land; 77 78 } 78 - #endif 79 79 } 80 80 81 81 static int vdso_mremap(const struct vm_special_mapping *sm, ··· 225 227 return map_vdso(image, addr); 226 228 } 227 229 228 - #if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION) 229 230 static int load_vdso32(void) 230 231 { 231 232 if (vdso32_enabled != 1) /* Other values all mean "disabled" */ ··· 232 235 233 236 return map_vdso(&vdso_image_32, 0); 234 237 } 235 - #endif 236 238 237 - #ifdef CONFIG_X86_64 238 239 int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) 239 240 { 240 - if (!vdso64_enabled) 241 - return 0; 241 + if (IS_ENABLED(CONFIG_X86_64)) { 242 + if (!vdso64_enabled) 243 + return 0; 242 244 243 - return map_vdso(&vdso_image_64, 0); 245 + return map_vdso(&vdso_image_64, 0); 246 + } 247 + 248 + return load_vdso32(); 244 249 } 245 250 246 251 #ifdef CONFIG_COMPAT 247 252 int compat_arch_setup_additional_pages(struct linux_binprm *bprm, 248 253 int uses_interp, bool x32) 249 254 { 250 - #ifdef CONFIG_X86_X32_ABI 251 - if (x32) { 255 + if (IS_ENABLED(CONFIG_X86_X32_ABI) && x32) { 252 256 if (!vdso64_enabled) 253 257 return 0; 254 258 return map_vdso(&vdso_image_x32, 0); 255 259 } 256 - #endif 257 - #ifdef CONFIG_IA32_EMULATION 258 - return load_vdso32(); 259 - #else 260 + 261 + if (IS_ENABLED(CONFIG_IA32_EMULATION)) 262 + return load_vdso32(); 263 + 260 264 return 0; 261 - #endif 262 - } 263 - #endif 264 - #else 265 - int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) 266 - { 267 - return load_vdso32(); 268 265 } 269 266 #endif 270 267 271 268 bool arch_syscall_is_vdso_sigreturn(struct pt_regs *regs) 272 269 { 273 - #if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION) 274 270 const struct vdso_image *image = current->mm->context.vdso_image; 275 271 unsigned long vdso = (unsigned long) current->mm->context.vdso; 276 272 ··· 272 282 regs->ip == vdso + image->sym_vdso32_rt_sigreturn_landing_pad) 273 283 return true; 274 284 } 275 - #endif 276 285 return false; 277 286 } 278 287
-4
arch/x86/include/asm/elf.h
··· 76 76 77 77 #include <asm/vdso.h> 78 78 79 - #ifdef CONFIG_X86_64 80 79 extern unsigned int vdso64_enabled; 81 - #endif 82 - #if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION) 83 80 extern unsigned int vdso32_enabled; 84 - #endif 85 81 86 82 /* 87 83 * This is used to ensure we don't load something for the wrong architecture.
-8
arch/x86/include/asm/vdso.h
··· 27 27 long sym_vdso32_rt_sigreturn_landing_pad; 28 28 }; 29 29 30 - #ifdef CONFIG_X86_64 31 30 extern const struct vdso_image vdso_image_64; 32 - #endif 33 - 34 - #ifdef CONFIG_X86_X32_ABI 35 31 extern const struct vdso_image vdso_image_x32; 36 - #endif 37 - 38 - #if defined CONFIG_X86_32 || defined CONFIG_COMPAT 39 32 extern const struct vdso_image vdso_image_32; 40 - #endif 41 33 42 34 extern int __init init_vdso_image(const struct vdso_image *image); 43 35