diff options
author | Roland McGrath <roland@redhat.com> | 2008-01-30 07:30:43 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:30:43 -0500 |
commit | af65d64845a90c8f2fc90b97e2148ff74672e979 (patch) | |
tree | e70a57a9635acaf8154c150f95e11dcb51937fd8 /include/asm-x86/elf.h | |
parent | 00f8b1bc0e44ba94fb33e1fbd8ac82841d7cc570 (diff) |
x86 vDSO: consolidate vdso32
This makes x86_64's ia32 emulation support share the sources used in the
32-bit kernel for the 32-bit vDSO and much of its setup code.
The 32-bit vDSO mapping now behaves the same on x86_64 as on native 32-bit.
The abi.syscall32 sysctl on x86_64 now takes the same values that
vm.vdso_enabled takes on the 32-bit kernel. That is, 1 means a randomized
vDSO location, 2 means the fixed old address. The CONFIG_COMPAT_VDSO
option is now available to make this the default setting, the same meaning
it has for the 32-bit kernel. (This does not affect the 64-bit vDSO.)
The argument vdso32=[012] can be used on both 32-bit and 64-bit kernels to
set this paramter at boot time. The vdso=[012] argument still does this
same thing on the 32-bit kernel.
Signed-off-by: Roland McGrath <roland@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/asm-x86/elf.h')
-rw-r--r-- | include/asm-x86/elf.h | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/include/asm-x86/elf.h b/include/asm-x86/elf.h index 70edff2d5671..60f5101d9483 100644 --- a/include/asm-x86/elf.h +++ b/include/asm-x86/elf.h | |||
@@ -74,17 +74,19 @@ typedef struct user_fxsr_struct elf_fpxregset_t; | |||
74 | 74 | ||
75 | #ifdef __KERNEL__ | 75 | #ifdef __KERNEL__ |
76 | 76 | ||
77 | /* | ||
78 | * This is used to ensure we don't load something for the wrong architecture. | ||
79 | */ | ||
80 | #define elf_check_arch_ia32(x) \ | ||
81 | (((x)->e_machine == EM_386) || ((x)->e_machine == EM_486)) | ||
82 | |||
77 | #ifdef CONFIG_X86_32 | 83 | #ifdef CONFIG_X86_32 |
78 | #include <asm/processor.h> | 84 | #include <asm/processor.h> |
79 | #include <asm/system.h> /* for savesegment */ | 85 | #include <asm/system.h> /* for savesegment */ |
80 | #include <asm/desc.h> | 86 | #include <asm/desc.h> |
81 | #include <asm/vdso.h> | 87 | #include <asm/vdso.h> |
82 | 88 | ||
83 | /* | 89 | #define elf_check_arch(x) elf_check_arch_ia32(x) |
84 | * This is used to ensure we don't load something for the wrong architecture. | ||
85 | */ | ||
86 | #define elf_check_arch(x) \ | ||
87 | (((x)->e_machine == EM_386) || ((x)->e_machine == EM_486)) | ||
88 | 90 | ||
89 | /* SVR4/i386 ABI (pages 3-31, 3-32) says that when the program starts %edx | 91 | /* SVR4/i386 ABI (pages 3-31, 3-32) says that when the program starts %edx |
90 | contains a pointer to a function which might be registered using `atexit'. | 92 | contains a pointer to a function which might be registered using `atexit'. |
@@ -247,10 +249,6 @@ extern int dump_task_extended_fpu (struct task_struct *, | |||
247 | #define ELF_CORE_XFPREG_TYPE NT_PRXFPREG | 249 | #define ELF_CORE_XFPREG_TYPE NT_PRXFPREG |
248 | 250 | ||
249 | #define VDSO_HIGH_BASE (__fix_to_virt(FIX_VDSO)) | 251 | #define VDSO_HIGH_BASE (__fix_to_virt(FIX_VDSO)) |
250 | #define VDSO_CURRENT_BASE ((unsigned long)current->mm->context.vdso) | ||
251 | |||
252 | #define VDSO_ENTRY \ | ||
253 | ((unsigned long) VDSO32_SYMBOL(VDSO_CURRENT_BASE, vsyscall)) | ||
254 | 252 | ||
255 | /* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */ | 253 | /* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */ |
256 | 254 | ||
@@ -262,6 +260,8 @@ do if (vdso_enabled) { \ | |||
262 | 260 | ||
263 | #else /* CONFIG_X86_32 */ | 261 | #else /* CONFIG_X86_32 */ |
264 | 262 | ||
263 | #define VDSO_HIGH_BASE 0xffffe000U /* CONFIG_COMPAT_VDSO address */ | ||
264 | |||
265 | /* 1GB for 64bit, 8MB for 32bit */ | 265 | /* 1GB for 64bit, 8MB for 32bit */ |
266 | #define STACK_RND_MASK (test_thread_flag(TIF_IA32) ? 0x7ff : 0x3fffff) | 266 | #define STACK_RND_MASK (test_thread_flag(TIF_IA32) ? 0x7ff : 0x3fffff) |
267 | 267 | ||
@@ -272,6 +272,11 @@ do if (vdso_enabled) { \ | |||
272 | 272 | ||
273 | #endif /* !CONFIG_X86_32 */ | 273 | #endif /* !CONFIG_X86_32 */ |
274 | 274 | ||
275 | #define VDSO_CURRENT_BASE ((unsigned long)current->mm->context.vdso) | ||
276 | |||
277 | #define VDSO_ENTRY \ | ||
278 | ((unsigned long) VDSO32_SYMBOL(VDSO_CURRENT_BASE, vsyscall)) | ||
279 | |||
275 | struct linux_binprm; | 280 | struct linux_binprm; |
276 | 281 | ||
277 | #define ARCH_HAS_SETUP_ADDITIONAL_PAGES 1 | 282 | #define ARCH_HAS_SETUP_ADDITIONAL_PAGES 1 |