mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 07:03:03 +02:00
Two changes to simplify the x86 vDSO code a bit.
Signed-off-by: Ingo Molnar <mingo@kernel.org> -----BEGIN PGP SIGNATURE----- iQJFBAABCgAvFiEEBpT5eoXrXCwVQwEKEnMQ0APhK1gFAmgy+aQRHG1pbmdvQGtl cm5lbC5vcmcACgkQEnMQ0APhK1gaJxAAoYLmzJfVa/s4NdjYXpEM4H+iUOiynbOX TQsQOprRLNrYvdMhduFWrre1uzrvid+RVyV/eKtJ2hQMyMWlC8bJ4IpXbxFC4jAJ kAOtYj0HjfAgZfOxZ+JRye0ODVe7vne0dXhfrPNmM6VjIZV0jvIj213uhvmZuXSN J59TSYB8J79r4WwrEexA1BFjjKrQsD2wEgi4LEryJRXtw/pWF7RpeuTga46ggLnn 7iTrWyo/fKQ6TVirGI2fJj1+g9jrvLED7hk5Lx4Ek1iYt6E/b6WjMyIvVL3HMlfo GVjMt1Or9eRG9n4iqmFaMwJSmL2w3HLJmHazl7dIC8KLOfgwKikxUu5l+QMdhTgm kKZbJoup7ZJ4XpjKDD1KcHNL07MkMYNgsmn1vCaBtt/Ez/YRfjtYbJy1PJtjFdNw 05pUWYXIx9ySjqPRVOwGbCTeXzFlJPSRFH0m7FARCbVMkFBXVcyF5NWpzmGF++iz GBW1oBgIz5uXyXDv9+U+QJklJPLMeXkrz3B9vz4O7VwEpNhujHJW3rqXdQB2/SAn T8LWCOw4NJIYIVl2gHrA7ZEOeN5lY9zv/QQS5zVZSh5tJl/lcX5C+QDXWjFl0oMI HxUI1b3Mb28aEyqNnJPaxY/K/S45X/BulL6nhnoU9NX2ulA/S72jhn3kMdxOPeKS 8fyX0O5TGA4= =WdUd -----END PGP SIGNATURE----- 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
This commit is contained in:
commit
24244df067
|
|
@ -65,7 +65,6 @@ static vm_fault_t vdso_fault(const struct vm_special_mapping *sm,
|
|||
static void vdso_fix_landing(const struct vdso_image *image,
|
||||
struct vm_area_struct *new_vma)
|
||||
{
|
||||
#if defined CONFIG_X86_32 || defined CONFIG_IA32_EMULATION
|
||||
if (in_ia32_syscall() && image == &vdso_image_32) {
|
||||
struct pt_regs *regs = current_pt_regs();
|
||||
unsigned long vdso_land = image->sym_int80_landing_pad;
|
||||
|
|
@ -76,7 +75,6 @@ static void vdso_fix_landing(const struct vdso_image *image,
|
|||
if (regs->ip == old_land_addr)
|
||||
regs->ip = new_vma->vm_start + vdso_land;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static int vdso_mremap(const struct vm_special_mapping *sm,
|
||||
|
|
@ -227,7 +225,6 @@ int map_vdso_once(const struct vdso_image *image, unsigned long addr)
|
|||
return map_vdso(image, addr);
|
||||
}
|
||||
|
||||
#if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
|
||||
static int load_vdso32(void)
|
||||
{
|
||||
if (vdso32_enabled != 1) /* Other values all mean "disabled" */
|
||||
|
|
@ -235,45 +232,38 @@ static int load_vdso32(void)
|
|||
|
||||
return map_vdso(&vdso_image_32, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_X86_64
|
||||
int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
|
||||
{
|
||||
if (!vdso64_enabled)
|
||||
return 0;
|
||||
if (IS_ENABLED(CONFIG_X86_64)) {
|
||||
if (!vdso64_enabled)
|
||||
return 0;
|
||||
|
||||
return map_vdso(&vdso_image_64, 0);
|
||||
return map_vdso(&vdso_image_64, 0);
|
||||
}
|
||||
|
||||
return load_vdso32();
|
||||
}
|
||||
|
||||
#ifdef CONFIG_COMPAT
|
||||
int compat_arch_setup_additional_pages(struct linux_binprm *bprm,
|
||||
int uses_interp, bool x32)
|
||||
{
|
||||
#ifdef CONFIG_X86_X32_ABI
|
||||
if (x32) {
|
||||
if (IS_ENABLED(CONFIG_X86_X32_ABI) && x32) {
|
||||
if (!vdso64_enabled)
|
||||
return 0;
|
||||
return map_vdso(&vdso_image_x32, 0);
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_IA32_EMULATION
|
||||
return load_vdso32();
|
||||
#else
|
||||
|
||||
if (IS_ENABLED(CONFIG_IA32_EMULATION))
|
||||
return load_vdso32();
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
|
||||
{
|
||||
return load_vdso32();
|
||||
}
|
||||
#endif
|
||||
|
||||
bool arch_syscall_is_vdso_sigreturn(struct pt_regs *regs)
|
||||
{
|
||||
#if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
|
||||
const struct vdso_image *image = current->mm->context.vdso_image;
|
||||
unsigned long vdso = (unsigned long) current->mm->context.vdso;
|
||||
|
||||
|
|
@ -282,7 +272,6 @@ bool arch_syscall_is_vdso_sigreturn(struct pt_regs *regs)
|
|||
regs->ip == vdso + image->sym_vdso32_rt_sigreturn_landing_pad)
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -76,12 +76,8 @@ typedef struct user_i387_struct elf_fpregset_t;
|
|||
|
||||
#include <asm/vdso.h>
|
||||
|
||||
#ifdef CONFIG_X86_64
|
||||
extern unsigned int vdso64_enabled;
|
||||
#endif
|
||||
#if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
|
||||
extern unsigned int vdso32_enabled;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This is used to ensure we don't load something for the wrong architecture.
|
||||
|
|
|
|||
|
|
@ -27,17 +27,9 @@ struct vdso_image {
|
|||
long sym_vdso32_rt_sigreturn_landing_pad;
|
||||
};
|
||||
|
||||
#ifdef CONFIG_X86_64
|
||||
extern const struct vdso_image vdso_image_64;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_X86_X32_ABI
|
||||
extern const struct vdso_image vdso_image_x32;
|
||||
#endif
|
||||
|
||||
#if defined CONFIG_X86_32 || defined CONFIG_COMPAT
|
||||
extern const struct vdso_image vdso_image_32;
|
||||
#endif
|
||||
|
||||
extern int __init init_vdso_image(const struct vdso_image *image);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user