public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Jan Beulich <JBeulich@novell.com>
Cc: mingo@elte.hu, tglx@linutronix.de, akpm@linux-foundation.org,
	Roland McGrath <roland@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86-64: simplify is32entry.S again
Date: Fri, 24 Sep 2010 09:18:47 -0700	[thread overview]
Message-ID: <4C9CCF67.3000106@zytor.com> (raw)
In-Reply-To: <4C9CB7170200007800018D0B@vpn.id2.novell.com>

On 09/24/2010 05:35 AM, Jan Beulich wrote:
> Commits 36d001c70d8a0144ac1d038f6876c484849a74de and
> eefdca043e8391dcd719711716492063030b55ac fixed the same problem in two
> different, redundant of one another ways: Zero-extending the system
> call index from 32 to 64 bits and then doing comparison on the 64 bit
> register is just pointless.
> 
> Undo the second commit completely, as using REX prefixes where needed
> produces more efficient code than having an extra instruction in the
> stream (no matter how simple it is).
> 
> The first commit by itself also did quite a bit more than needed -
> comparison on the full 64-bit register is definitely unnecessary in
> all paths where the value is known to zero extended from 32 bits
> already (in one case this is even directly visible from the patch, as
> the zero extending instruction is the immediately preceding one). Undo
> those parts of the first commit too.

Yes, this optimizes the code slightly... it also removes any redundancy
in the protections which is part of why the bug could reappear in the
first place. Unless you have concrete numbers on system call entry
latency and that these longer instructions hurt, I *really don't* want that.

As Linus said, "the code was too subtle in the first place".

Furthermore, Roland was concerned about buggy ptrace users relying on
the zero-extension... if nothing else zero-extending in some paths and
not in others would open up for another instance of the same class of
problems (tested-is-not-what-is-executed).

So I'm going to NAK this patch unless provided with strong evidence that
the efficiency pays off.  Sorry.

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.


      reply	other threads:[~2010-09-24 16:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-24 12:35 [PATCH] x86-64: simplify is32entry.S again Jan Beulich
2010-09-24 16:18 ` H. Peter Anvin [this message]

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=4C9CCF67.3000106@zytor.com \
    --to=hpa@zytor.com \
    --cc=JBeulich@novell.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=roland@redhat.com \
    --cc=tglx@linutronix.de \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox