12 #include <linux/sched.h>
14 #include <linux/string.h>
15 #include <linux/elf.h>
18 #include <linux/module.h>
20 #include <asm/cpufeature.h>
22 #include <asm/pgtable.h>
23 #include <asm/unistd.h>
25 #include <asm/tlbflush.h>
35 #ifdef CONFIG_COMPAT_VDSO
36 #define VDSO_DEFAULT VDSO_COMPAT
38 #define VDSO_DEFAULT VDSO_ENABLED
42 #define vdso_enabled sysctl_vsyscall32
43 #define arch_setup_additional_pages syscall32_setup_pages
51 #define VDSO_ADDR_ADJUST (VDSO_HIGH_BASE - (unsigned long)VDSO32_PRELINK)
59 static int __init vdso_setup(
char *
s)
83 unsigned nsym = size /
sizeof(*sym);
86 for(i = 0; i < nsym; i++, sym++) {
136 (dyn->
d_tag & 1) == 0)
172 phdr = (
void *)ehdr + ehdr->
e_phoff;
178 reloc_dyn(ehdr, phdr[i].p_offset);
182 shdr = (
void *)ehdr + ehdr->
e_shoff;
183 for(i = 0; i < ehdr->e_shnum; i++) {
191 reloc_symtab(ehdr, shdr[i].sh_offset,
196 static struct page *vdso32_pages[1];
200 #define vdso32_sysenter() (boot_cpu_has(X86_FEATURE_SYSENTER32))
201 #define vdso32_syscall() (boot_cpu_has(X86_FEATURE_SYSCALL32))
215 #define compat_uses_vma 1
217 static inline void map_compat_vdso(
int map)
223 #define vdso32_sysenter() (boot_cpu_has(X86_FEATURE_SEP))
224 #define vdso32_syscall() (0)
246 static int __init gate_vma_init(
void)
248 gate_vma.vm_mm =
NULL;
251 gate_vma.vm_flags = VM_READ | VM_MAYREAD | VM_EXEC | VM_MAYEXEC;
252 gate_vma.vm_page_prot =
__P101;
257 #define compat_uses_vma 0
259 static void map_compat_vdso(
int map)
261 static int vdso_mapped;
263 if (map == vdso_mapped)
280 const void *vsyscall;
300 memcpy(syscall_page, vsyscall, vsyscall_len);
301 relocate_vdso(syscall_page);
314 #ifdef CONFIG_X86_X32_ABI
328 map_compat_vdso(compat);
340 current->mm->context.vdso = (
void *)addr;
348 VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC,
356 VDSO32_SYMBOL(addr, SYSENTER_RETURN);
373 #include <linux/sysctl.h>
379 .maxlen =
sizeof(
int),
395 static __init int ia32_binfmt_init(
void)