Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1295317
| From | "H. Peter Anvin" <hpa@zytor.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] x86/signal: Cleanup get_nr_restart_syscall |
| Date | 2015-12-19 07:40 +0100 |
| Message-ID | <qHjln-85O-7@gated-at.bofh.it> (permalink) |
| References | <qDdoe-2Si-21@gated-at.bofh.it> <qF5Pz-30P-1@gated-at.bofh.it> <qGNlw-4hK-13@gated-at.bofh.it> <qHcMV-3PJ-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 12/18/15 15:37, Dmitry V. Levin wrote:
> Check for TS_COMPAT instead of TIF_IA32 to distinguish ia32 tasks
> from 64-bit tasks.
> Check for __X32_SYSCALL_BIT only if CONFIG_X86_X32_ABI is defined.
>
> Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
> Cc: Elvira Khabirova <lineprinter0@gmail.com>
> Cc: Andy Lutomirski <luto@amacapital.net>
> ---
> arch/x86/kernel/signal.c | 13 ++++++++-----
> 1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c
> index cb6282c..ff7dedc 100644
> --- a/arch/x86/kernel/signal.c
> +++ b/arch/x86/kernel/signal.c
> @@ -692,12 +692,15 @@ handle_signal(struct ksignal *ksig, struct pt_regs *regs)
>
> static inline unsigned long get_nr_restart_syscall(const struct pt_regs *regs)
> {
> -#if defined(CONFIG_X86_32) || !defined(CONFIG_X86_64)
> +#ifdef CONFIG_X86_64
> + if (is_ia32_task())
> + return __NR_ia32_restart_syscall;
> +# ifdef CONFIG_X86_X32_ABI
> + if (regs->orig_ax & __X32_SYSCALL_BIT)
> + return __NR_restart_syscall | __X32_SYSCALL_BIT;
> +# endif
> +#endif
> return __NR_restart_syscall;
> -#else /* !CONFIG_X86_32 && CONFIG_X86_64 */
> - return test_thread_flag(TIF_IA32) ? __NR_ia32_restart_syscall :
> - __NR_restart_syscall | (regs->orig_ax & __X32_SYSCALL_BIT);
> -#endif /* CONFIG_X86_32 || !CONFIG_X86_64 */
> }
>
> /*
>
I bet you actually made the code slower.
-hpa
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [PATCH] x86/signal: fix restart_syscall number for x32 tasks "Dmitry V. Levin" <ldv@altlinux.org> - 2015-12-13 04:50 +0100
Re: [PATCH] x86/signal: fix restart_syscall number for x32 tasks Andy Lutomirski <luto@amacapital.net> - 2015-12-17 21:30 +0100
[PATCH] x86/signal: Cleanup get_nr_restart_syscall "Dmitry V. Levin" <ldv@altlinux.org> - 2015-12-19 00:40 +0100
Re: [PATCH] x86/signal: Cleanup get_nr_restart_syscall "H. Peter Anvin" <hpa@zytor.com> - 2015-12-19 07:40 +0100
[PATCH v2] x86/signal: Cleanup get_nr_restart_syscall "Dmitry V. Levin" <ldv@altlinux.org> - 2015-12-19 15:50 +0100
Re: [PATCH v2] x86/signal: Cleanup get_nr_restart_syscall Andy Lutomirski <luto@amacapital.net> - 2015-12-19 21:50 +0100
csiph-web