public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] x86/signal: fix restart_syscall number for x32 tasks
@ 2015-12-07 23:22 Andy Lutomirski
  2015-12-13  3:44 ` Dmitry V. Levin
  0 siblings, 1 reply; 9+ messages in thread
From: Andy Lutomirski @ 2015-12-07 23:22 UTC (permalink / raw)
  To: X86 ML, linux-kernel@vger.kernel.org, Dmitry V. Levin,
	lvira Khabirova

[not real reply because I'm using a bad internet connection right now
and I'm not set up with my usual Gmane reply hack right now]

The new code is (whitespace-damaged):

static inline unsigned long get_nr_restart_syscall(const struct pt_regs *regs)
{
#if defined(CONFIG_X86_32) || !defined(CONFIG_X86_64)
 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 */
}

This is IMO awful.  This use of TIF_IA32 is wrong, and this is
otherwise gross.  Can we do it for real:

if (is_ia32_task())
  return __NR_ia32_restart_syscall;
else
  return __NR_restart_syscall | (regs->orig_ax & __X32_SYSCALL_BIT);
/* preserve x32 bit */

I'd send the patch myself, but you apparently have a good test case
for this, and I don't.

(this isn't a regression, and I'm not suggesting any change for 4.4 or
for stable.  But for 4.5, can we do it right, please?)

And yes, I'll send a patch to rename is_ia32_task, but that's orthogonal.

--Andy

P.S. I'm still hoping to kill TIF_IA32 entirely some time soon.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-01-19 13:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-07 23:22 [PATCH] x86/signal: fix restart_syscall number for x32 tasks Andy Lutomirski
2015-12-13  3:44 ` Dmitry V. Levin
2015-12-17 20:27   ` Andy Lutomirski
2015-12-18 23:37     ` [PATCH] x86/signal: Cleanup get_nr_restart_syscall Dmitry V. Levin
2015-12-19  6:34       ` H. Peter Anvin
2015-12-19 14:43         ` [PATCH v2] " Dmitry V. Levin
2015-12-19 20:48           ` Andy Lutomirski
2016-01-11 14:55             ` [RESEND PATCH " Dmitry V. Levin
2016-01-19 13:39               ` [tip:x86/asm] x86/signal: Cleanup get_nr_restart_syscall() tip-bot for Dmitry V. Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox