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 /arch/x86/ia32/ia32_signal.c | |
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 'arch/x86/ia32/ia32_signal.c')
-rw-r--r-- | arch/x86/ia32/ia32_signal.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/arch/x86/ia32/ia32_signal.c b/arch/x86/ia32/ia32_signal.c index 0fc5d8563e1..39356a756b2 100644 --- a/arch/x86/ia32/ia32_signal.c +++ b/arch/x86/ia32/ia32_signal.c | |||
@@ -31,7 +31,7 @@ | |||
31 | #include <asm/sigcontext32.h> | 31 | #include <asm/sigcontext32.h> |
32 | #include <asm/fpu32.h> | 32 | #include <asm/fpu32.h> |
33 | #include <asm/proto.h> | 33 | #include <asm/proto.h> |
34 | #include <asm/vsyscall32.h> | 34 | #include <asm/vdso.h> |
35 | 35 | ||
36 | #define DEBUG_SIG 0 | 36 | #define DEBUG_SIG 0 |
37 | 37 | ||
@@ -465,13 +465,16 @@ int ia32_setup_frame(int sig, struct k_sigaction *ka, | |||
465 | goto give_sigsegv; | 465 | goto give_sigsegv; |
466 | } | 466 | } |
467 | 467 | ||
468 | /* Return stub is in 32bit vsyscall page */ | 468 | if (ka->sa.sa_flags & SA_RESTORER) { |
469 | if (current->binfmt->hasvdso) | ||
470 | restorer = VSYSCALL32_SIGRETURN; | ||
471 | else | ||
472 | restorer = (void *)&frame->retcode; | ||
473 | if (ka->sa.sa_flags & SA_RESTORER) | ||
474 | restorer = ka->sa.sa_restorer; | 469 | restorer = ka->sa.sa_restorer; |
470 | } else { | ||
471 | /* Return stub is in 32bit vsyscall page */ | ||
472 | if (current->binfmt->hasvdso) | ||
473 | restorer = VDSO32_SYMBOL(current->mm->context.vdso, | ||
474 | sigreturn); | ||
475 | else | ||
476 | restorer = (void *)&frame->retcode; | ||
477 | } | ||
475 | err |= __put_user(ptr_to_compat(restorer), &frame->pretcode); | 478 | err |= __put_user(ptr_to_compat(restorer), &frame->pretcode); |
476 | 479 | ||
477 | /* | 480 | /* |
@@ -519,7 +522,7 @@ int ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
519 | { | 522 | { |
520 | struct rt_sigframe __user *frame; | 523 | struct rt_sigframe __user *frame; |
521 | struct exec_domain *ed = current_thread_info()->exec_domain; | 524 | struct exec_domain *ed = current_thread_info()->exec_domain; |
522 | void __user *restorer = VSYSCALL32_RTSIGRETURN; | 525 | void __user *restorer; |
523 | int err = 0; | 526 | int err = 0; |
524 | 527 | ||
525 | /* __copy_to_user optimizes that into a single 8 byte store */ | 528 | /* __copy_to_user optimizes that into a single 8 byte store */ |
@@ -564,6 +567,9 @@ int ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
564 | 567 | ||
565 | if (ka->sa.sa_flags & SA_RESTORER) | 568 | if (ka->sa.sa_flags & SA_RESTORER) |
566 | restorer = ka->sa.sa_restorer; | 569 | restorer = ka->sa.sa_restorer; |
570 | else | ||
571 | restorer = VDSO32_SYMBOL(current->mm->context.vdso, | ||
572 | rt_sigreturn); | ||
567 | err |= __put_user(ptr_to_compat(restorer), &frame->pretcode); | 573 | err |= __put_user(ptr_to_compat(restorer), &frame->pretcode); |
568 | 574 | ||
569 | /* | 575 | /* |