public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: Uros Bizjak <ubizjak@gmail.com>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	"H. Peter Anvin" <hpa@zytor.com>
Subject: Re: [PATCH v2] x86: Use xorl %0,%0 in __get_user_asm
Date: Thu, 27 Aug 2020 21:14:23 +0100	[thread overview]
Message-ID: <20200827201423.GD1236603@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20200827180904.96399-1-ubizjak@gmail.com>

On Thu, Aug 27, 2020 at 08:09:04PM +0200, Uros Bizjak wrote:
> xorl %0,%0 is equivalent to xorq %0,%0 as both will zero the
> entire register.  Use xorl %0,%0 for all operand sizes to avoid
> REX prefix byte when legacy registers are used and to avoid size
> prefix byte when 16bit registers are used.
> 
> Zeroing the full register is OK in this use case.  xorl %0,%0 also
> breaks register dependency chains, avoiding potential partial
> register stalls with 8 and 16bit operands.

No objections, but talking about stalls is more than slightly
ridiculous - we'd just taken a #PF, failed there, flipped
pt_regs %rip to fixup section, returned from fault and are
about to fail whatever syscall that had been; a stall here
is really not an issue...

  parent reply	other threads:[~2020-08-27 20:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-27 18:09 [PATCH v2] x86: Use xorl %0,%0 in __get_user_asm Uros Bizjak
2020-08-27 18:55 ` H. Peter Anvin
2020-08-27 20:14 ` Al Viro [this message]
2020-08-28  6:41   ` Uros Bizjak
2020-09-03 20:57 ` [tip: x86/asm] x86/uaccess: Use XORL %0,%0 in __get_user_asm() tip-bot2 for Uros Bizjak

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=20200827201423.GD1236603@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=ubizjak@gmail.com \
    --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