diff options
author | Roland McGrath <roland@redhat.com> | 2007-01-26 03:56:46 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-01-26 16:50:58 -0500 |
commit | a1f3bb9ae4497a2ed3eac773fd7798ac33a0371f (patch) | |
tree | 18a8b6a9a26f2148e67109d79d2fe0c330fdeb64 | |
parent | 7f6ee1adc75bf31d1b76814338f76a88e653cb60 (diff) |
[PATCH] Fix CONFIG_COMPAT_VDSO
I wouldn't mind if CONFIG_COMPAT_VDSO went away entirely. But if it's there,
it should work properly. Currently it's quite haphazard: both real vma and
fixmap are mapped, both are put in the two different AT_* slots, sysenter
returns to the vma address rather than the fixmap address, and core dumps yet
are another story.
This patch makes CONFIG_COMPAT_VDSO disable the real vma and use the fixmap
area consistently. This makes it actually compatible with what the old vdso
implementation did.
Signed-off-by: Roland McGrath <roland@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | arch/i386/kernel/entry.S | 4 | ||||
-rw-r--r-- | arch/i386/kernel/sysenter.c | 2 | ||||
-rw-r--r-- | include/asm-i386/elf.h | 7 | ||||
-rw-r--r-- | include/asm-i386/fixmap.h | 2 | ||||
-rw-r--r-- | include/asm-i386/page.h | 2 |
5 files changed, 13 insertions, 4 deletions
diff --git a/arch/i386/kernel/entry.S b/arch/i386/kernel/entry.S index 06461b8b715d..5e47683fc63a 100644 --- a/arch/i386/kernel/entry.S +++ b/arch/i386/kernel/entry.S | |||
@@ -302,12 +302,16 @@ sysenter_past_esp: | |||
302 | pushl $(__USER_CS) | 302 | pushl $(__USER_CS) |
303 | CFI_ADJUST_CFA_OFFSET 4 | 303 | CFI_ADJUST_CFA_OFFSET 4 |
304 | /*CFI_REL_OFFSET cs, 0*/ | 304 | /*CFI_REL_OFFSET cs, 0*/ |
305 | #ifndef CONFIG_COMPAT_VDSO | ||
305 | /* | 306 | /* |
306 | * Push current_thread_info()->sysenter_return to the stack. | 307 | * Push current_thread_info()->sysenter_return to the stack. |
307 | * A tiny bit of offset fixup is necessary - 4*4 means the 4 words | 308 | * A tiny bit of offset fixup is necessary - 4*4 means the 4 words |
308 | * pushed above; +8 corresponds to copy_thread's esp0 setting. | 309 | * pushed above; +8 corresponds to copy_thread's esp0 setting. |
309 | */ | 310 | */ |
310 | pushl (TI_sysenter_return-THREAD_SIZE+8+4*4)(%esp) | 311 | pushl (TI_sysenter_return-THREAD_SIZE+8+4*4)(%esp) |
312 | #else | ||
313 | pushl $SYSENTER_RETURN | ||
314 | #endif | ||
311 | CFI_ADJUST_CFA_OFFSET 4 | 315 | CFI_ADJUST_CFA_OFFSET 4 |
312 | CFI_REL_OFFSET eip, 0 | 316 | CFI_REL_OFFSET eip, 0 |
313 | 317 | ||
diff --git a/arch/i386/kernel/sysenter.c b/arch/i386/kernel/sysenter.c index 7de9117b5a3a..454d12df59ea 100644 --- a/arch/i386/kernel/sysenter.c +++ b/arch/i386/kernel/sysenter.c | |||
@@ -100,6 +100,7 @@ int __init sysenter_setup(void) | |||
100 | return 0; | 100 | return 0; |
101 | } | 101 | } |
102 | 102 | ||
103 | #ifndef CONFIG_COMPAT_VDSO | ||
103 | static struct page *syscall_nopage(struct vm_area_struct *vma, | 104 | static struct page *syscall_nopage(struct vm_area_struct *vma, |
104 | unsigned long adr, int *type) | 105 | unsigned long adr, int *type) |
105 | { | 106 | { |
@@ -187,3 +188,4 @@ int in_gate_area_no_task(unsigned long addr) | |||
187 | { | 188 | { |
188 | return 0; | 189 | return 0; |
189 | } | 190 | } |
191 | #endif | ||
diff --git a/include/asm-i386/elf.h b/include/asm-i386/elf.h index 45d21a0c95bf..0515d61d5411 100644 --- a/include/asm-i386/elf.h +++ b/include/asm-i386/elf.h | |||
@@ -143,11 +143,8 @@ extern int dump_task_extended_fpu (struct task_struct *, struct user_fxsr_struct | |||
143 | # define VDSO_PRELINK 0 | 143 | # define VDSO_PRELINK 0 |
144 | #endif | 144 | #endif |
145 | 145 | ||
146 | #define VDSO_COMPAT_SYM(x) \ | ||
147 | (VDSO_COMPAT_BASE + (unsigned long)(x) - VDSO_PRELINK) | ||
148 | |||
149 | #define VDSO_SYM(x) \ | 146 | #define VDSO_SYM(x) \ |
150 | (VDSO_BASE + (unsigned long)(x) - VDSO_PRELINK) | 147 | (VDSO_COMPAT_BASE + (unsigned long)(x) - VDSO_PRELINK) |
151 | 148 | ||
152 | #define VDSO_HIGH_EHDR ((const struct elfhdr *) VDSO_HIGH_BASE) | 149 | #define VDSO_HIGH_EHDR ((const struct elfhdr *) VDSO_HIGH_BASE) |
153 | #define VDSO_EHDR ((const struct elfhdr *) VDSO_COMPAT_BASE) | 150 | #define VDSO_EHDR ((const struct elfhdr *) VDSO_COMPAT_BASE) |
@@ -156,10 +153,12 @@ extern void __kernel_vsyscall; | |||
156 | 153 | ||
157 | #define VDSO_ENTRY VDSO_SYM(&__kernel_vsyscall) | 154 | #define VDSO_ENTRY VDSO_SYM(&__kernel_vsyscall) |
158 | 155 | ||
156 | #ifndef CONFIG_COMPAT_VDSO | ||
159 | #define ARCH_HAS_SETUP_ADDITIONAL_PAGES | 157 | #define ARCH_HAS_SETUP_ADDITIONAL_PAGES |
160 | struct linux_binprm; | 158 | struct linux_binprm; |
161 | extern int arch_setup_additional_pages(struct linux_binprm *bprm, | 159 | extern int arch_setup_additional_pages(struct linux_binprm *bprm, |
162 | int executable_stack); | 160 | int executable_stack); |
161 | #endif | ||
163 | 162 | ||
164 | extern unsigned int vdso_enabled; | 163 | extern unsigned int vdso_enabled; |
165 | 164 | ||
diff --git a/include/asm-i386/fixmap.h b/include/asm-i386/fixmap.h index 02428cb36621..3e9f610c35df 100644 --- a/include/asm-i386/fixmap.h +++ b/include/asm-i386/fixmap.h | |||
@@ -23,6 +23,8 @@ | |||
23 | extern unsigned long __FIXADDR_TOP; | 23 | extern unsigned long __FIXADDR_TOP; |
24 | #else | 24 | #else |
25 | #define __FIXADDR_TOP 0xfffff000 | 25 | #define __FIXADDR_TOP 0xfffff000 |
26 | #define FIXADDR_USER_START __fix_to_virt(FIX_VDSO) | ||
27 | #define FIXADDR_USER_END __fix_to_virt(FIX_VDSO - 1) | ||
26 | #endif | 28 | #endif |
27 | 29 | ||
28 | #ifndef __ASSEMBLY__ | 30 | #ifndef __ASSEMBLY__ |
diff --git a/include/asm-i386/page.h b/include/asm-i386/page.h index fd3f64ace248..7b19f454761d 100644 --- a/include/asm-i386/page.h +++ b/include/asm-i386/page.h | |||
@@ -143,7 +143,9 @@ extern int page_is_ram(unsigned long pagenr); | |||
143 | #include <asm-generic/memory_model.h> | 143 | #include <asm-generic/memory_model.h> |
144 | #include <asm-generic/page.h> | 144 | #include <asm-generic/page.h> |
145 | 145 | ||
146 | #ifndef CONFIG_COMPAT_VDSO | ||
146 | #define __HAVE_ARCH_GATE_AREA 1 | 147 | #define __HAVE_ARCH_GATE_AREA 1 |
148 | #endif | ||
147 | #endif /* __KERNEL__ */ | 149 | #endif /* __KERNEL__ */ |
148 | 150 | ||
149 | #endif /* _I386_PAGE_H */ | 151 | #endif /* _I386_PAGE_H */ |