X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fi386%2Fkernel%2Fsysenter.c;h=c340fff8fe2f1edb2eb1ec1d1b17d33abfca0e33;hb=refs%2Fheads%2Fvserver;hp=cc8eb3b32d5ec22362575b1e8c5a90584f071619;hpb=16c70f8c1b54b61c3b951b6fb220df250fe09b32;p=linux-2.6.git diff --git a/arch/i386/kernel/sysenter.c b/arch/i386/kernel/sysenter.c index cc8eb3b32..c340fff8f 100644 --- a/arch/i386/kernel/sysenter.c +++ b/arch/i386/kernel/sysenter.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -32,7 +33,11 @@ * Should the kernel map a VDSO page into processes and pass its * address down to glibc upon exec()? */ +#ifdef CONFIG_PARAVIRT +unsigned int __read_mostly vdso_enabled = 0; +#else unsigned int __read_mostly vdso_enabled = 1; +#endif EXPORT_SYMBOL_GPL(vdso_enabled); @@ -92,17 +97,8 @@ int __init sysenter_setup(void) #endif #ifdef CONFIG_COMPAT_VDSO - __set_fixmap(FIX_VDSO, __pa(syscall_page), PAGE_READONLY); + __set_fixmap(FIX_VDSO, __pa(syscall_page), PAGE_READONLY_EXEC); printk("Compat vDSO mapped to %08lx.\n", __fix_to_virt(FIX_VDSO)); -#else - /* - * In the non-compat case the ELF coredumping code needs the fixmap: - */ -#ifdef CONFIG_XEN - __set_fixmap(FIX_VDSO, virt_to_machine(syscall_page), PAGE_KERNEL_RO); -#else - __set_fixmap(FIX_VDSO, __pa(syscall_page), PAGE_KERNEL_RO); -#endif #endif if (!boot_cpu_has(X86_FEATURE_SEP)) { @@ -119,6 +115,7 @@ int __init sysenter_setup(void) return 0; } +#ifndef CONFIG_COMPAT_VDSO static struct page *syscall_nopage(struct vm_area_struct *vma, unsigned long adr, int *type) { @@ -156,7 +153,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int exstack, goto up_fail; } - vma = kmem_cache_zalloc(vm_area_cachep, SLAB_KERNEL); + vma = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL); if (!vma) { ret = -ENOMEM; goto up_fail; @@ -166,6 +163,13 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int exstack, vma->vm_end = addr + PAGE_SIZE; /* MAYWRITE to allow gdb to COW and set breakpoints */ vma->vm_flags = VM_READ|VM_EXEC|VM_MAYREAD|VM_MAYEXEC|VM_MAYWRITE; + /* + * Make sure the vDSO gets into every core dump. + * Dumping its contents makes post-mortem fully interpretable later + * without matching up the same kernel and hardware config to see + * what PC values meant. + */ + vma->vm_flags |= VM_ALWAYSDUMP; vma->vm_flags |= mm->def_flags; vma->vm_page_prot = protection_map[vma->vm_flags & 7]; vma->vm_ops = &syscall_vm_ops; @@ -207,3 +211,4 @@ int in_gate_area_no_task(unsigned long addr) { return 0; } +#endif