LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: Roland McGrath <roland@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86_64 ia32 syscall restart fix
Date: Fri, 29 Feb 2008 08:26:14 -0800 (PST)	[thread overview]
Message-ID: <alpine.LFD.1.00.0802290814320.17889@woody.linux-foundation.org> (raw)
In-Reply-To: <20080229155207.GC27248@elte.hu>



On Fri, 29 Feb 2008, Ingo Molnar wrote:
> 
> * Roland McGrath <roland@redhat.com> wrote:
> 
> > The code to restart syscalls after signals depends on checking for a 
> > negative orig_ax, and for particular negative -ERESTART* values in ax. 
> > These fields are 64 bits and for a 32-bit task they get zero-extended. 
> > The syscall restart behavior is lost, a regression from a native 
> > 32-bit kernel and from 64-bit tasks' behavior.  This patch fixes the 
> > problem by doing sign-extension where it matters.  For orig_ax, the 
> > only time the value should be -1 but winds up as 0x0ffffffff is via a 
> > 32-bit ptrace call.  So the patch changes ptrace to sign-extend the 
> > 32-bit orig_eax value when it's stored; it doesn't change the checks 
> > on orig_ax, though it uses the new current_syscall() inline to better 
> > document the subtle importance of the used of signedness there.  The 
> > ax value is stored a lot of ways and it seems hard to get them all 
> > sign-extended at their origins.  So for that, we use the 
> > current_syscall_ret() to sign-extend it only for 32-bit tasks at the 
> > time of the -ERESTART* comparisons.
> 
> thanks, applied.

Btw, can we please try to keep commit log messages readable?

The above "blob of text" could/should have more structure than being just 
one big block, and could have been structured as a few shorter paragraphs 
to make it easier to read: (1) problem description (2) patch description 
and (3) explanation of why patch was done it was done.

I don't know about you guys, but I read a *lot* of emails (and commit 
messages), and I hate seeing big blobs of text without structure. Give it 
a few breaks to make it easier to read, like just making new paragraphs, 
ie something like:

> The code to restart syscalls after signals depends on checking for a 
> negative orig_ax, and for particular negative -ERESTART* values in ax. 
> These fields are 64 bits and for a 32-bit task they get zero-extended. 
> The syscall restart behavior is lost, a regression from a native 32-bit 
> kernel and from 64-bit tasks' behavior.
>
> This patch fixes the problem by doing sign-extension where it matters.  
> For orig_ax, the only time the value should be -1 but winds up as 
> 0x0ffffffff is via a 32-bit ptrace call.  So the patch changes ptrace to 
> sign-extend the 32-bit orig_eax value when it's stored; it doesn't 
> change the checks on orig_ax, though it uses the new current_syscall() 
> inline to better document the subtle importance of the used of 
> signedness there.
>
> The ax value is stored a lot of ways and it seems hard to get them all 
> sign-extended at their origins.  So for that, we use the 
> current_syscall_ret() to sign-extend it only for 32-bit tasks at the 
> time of the -ERESTART* comparisons.

and now you have a bit of a breather space and some visual cues for whare 
you are in the text.

Yeah, maybe it's just me, but I like my whitespace. Ihaveareallyhardtime
readingtextthatdoesn'thavethepropermarkersforwhereconceptsstartandbegin, 
andthatreallydoesincludetheverticalwhitespacetoo.

Now, the only reason I mention this is that normally I would probably just 
have fixed this up myself without even a comment (because it's such a tiny 
detail that it's not not worth one), but when Ingo merges it I'll now get 
it through git and it will be fixed.

			Linus "yeah, I can be anal" Torvalds

  reply	other threads:[~2008-02-29 16:27 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-29  3:57 Roland McGrath
2008-02-29 15:52 ` Ingo Molnar
2008-02-29 16:26   ` Linus Torvalds [this message]
2008-02-29 16:45     ` Ingo Molnar
2008-02-29 17:03       ` Linus Torvalds
2008-02-29 17:17         ` Ingo Molnar
2008-02-29 17:37           ` Ingo Molnar
2008-02-29 21:02             ` Andrew Morton
2008-02-29 21:20               ` Ingo Molnar
2008-03-01  5:48                 ` [stable] " Greg KH
2008-02-29 22:42     ` Roland McGrath
2008-02-29 23:18       ` Linus Torvalds
2008-03-07 22:56 ` [PATCH] x86_64 ptrace orig_ax on ia32 task Roland McGrath
2008-03-07 23:18   ` Linus Torvalds
2008-03-08  1:37     ` Roland McGrath
2008-03-10 19:19   ` Chuck Ebbert
2008-03-10 19:48     ` Linus Torvalds
2008-03-10 20:01       ` Roland McGrath
2008-03-11  9:32         ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.1.00.0802290814320.17889@woody.linux-foundation.org \
    --to=torvalds@linux-foundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=roland@redhat.com \
    --cc=tglx@linutronix.de \
    --subject='Re: [PATCH] x86_64 ia32 syscall restart fix' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).