public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Denys Vlasenko <dvlasenk@redhat.com>, Ingo Molnar <mingo@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Borislav Petkov <bp@alien8.de>,
	Andy Lutomirski <luto@amacapital.net>,
	Oleg Nesterov <oleg@redhat.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Alexei Starovoitov <ast@plumgrid.com>,
	Will Drewry <wad@chromium.org>, Kees Cook <keescook@chromium.org>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] x86/asm/entry/64: Use shorter MOVs from segmers registers
Date: Thu, 14 May 2015 14:50:34 -0700	[thread overview]
Message-ID: <555518AA.7040001@zytor.com> (raw)
In-Reply-To: <1431626841-21386-1-git-send-email-dvlasenk@redhat.com>

On 05/14/2015 11:07 AM, Denys Vlasenko wrote:
> "movw %ds,%cx" insn needs a 0x66 prefix, while "movw %ds,%ecx" does not.
> The difference is that latter form (on 64-bit CPUs) overwrites
> entire %ecx, not only its lower half.
> 
> But subsequent code doesn't depend on the value of upper
> half of %ecx, we can safely use the shorter insn.
> 
> The new code is also faster than old one - now we don't depend on old value
> of %ecx, but this code fragment is not performance-critical.

This is still misleading.  On P6 or later CPUs, not just 64 bits, this
zeroes the upper half, whereas on older CPUs it is undefined.  Which is
still fine, but if we are going to make such a minor change we should
get it correct.

	-hpa



  reply	other threads:[~2015-05-14 21:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-14 18:07 [PATCH v2] x86/asm/entry/64: Use shorter MOVs from segmers registers Denys Vlasenko
2015-05-14 21:50 ` H. Peter Anvin [this message]
2015-05-15 12:13 ` Jeff Epler

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=555518AA.7040001@zytor.com \
    --to=hpa@zytor.com \
    --cc=ast@plumgrid.com \
    --cc=bp@alien8.de \
    --cc=dvlasenk@redhat.com \
    --cc=fweisbec@gmail.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=torvalds@linux-foundation.org \
    --cc=wad@chromium.org \
    --cc=x86@kernel.org \
    /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