linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jim Mattson <jmattson@google.com>
To: Sean Christopherson <sean.j.christopherson@intel.com>
Cc: Julian Stecklina <jsteckli@amazon.de>,
	kvm list <kvm@vger.kernel.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	js@alien8.de, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/4] kvm, vmx: move register clearing out of assembly path
Date: Fri, 26 Oct 2018 09:30:17 -0700	[thread overview]
Message-ID: <CALMp9eTtB1te3kyHxZjm244BwdVKrVrjOTgiLufQFwD8Y2g_LQ@mail.gmail.com> (raw)
In-Reply-To: <20181026154617.GA23663@linux.intel.com>

On Fri, Oct 26, 2018 at 8:46 AM, Sean Christopherson
<sean.j.christopherson@intel.com> wrote:

> Since clearing the GPRs exists to mitigate speculation junk, I think
> we should keep the explicit XOR zeroing instead of deferring to the
> compiler.  Explicit XORs will ensure the resulting assembly is the
> same regardless of compiler, version, target arch, etc..., whereas the
> compiler could theoretically use different zeroing methods[1], e.g. on
> my system it generates "mov r32,r32" for EBX, ESI and EDI (loading
> from EAX after EAX is zeroed).
>
> And FWIW, I find the original code to be more readable since all GRPs
> are zeroed with the same method.

I concur. I really do prefer the explicit xors to the input arguments.

  reply	other threads:[~2018-10-26 16:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-24  8:28 [PATCH 1/4] kvm, vmx: move CR2 context switch out of assembly path Julian Stecklina
2018-10-24  8:28 ` [PATCH 2/4] kvm, vmx: move register clearing " Julian Stecklina
2018-10-25 16:55   ` Jim Mattson
2018-10-26 10:31     ` Stecklina, Julian
2018-10-26 15:46   ` Sean Christopherson
2018-10-26 16:30     ` Jim Mattson [this message]
2018-10-29 13:47       ` Stecklina, Julian
2018-10-24  8:28 ` [PATCH 3/4] kvm, vmx: fix __invvpid style Julian Stecklina
2018-10-24  8:28 ` [PATCH 4/4] kvm, vmx: remove manually coded vmx instructions Julian Stecklina
2018-10-24 17:44   ` Eric Northup
2018-10-26 10:46     ` Stecklina, Julian
2018-10-26 14:30       ` Sean Christopherson
2018-10-25 17:02 ` [PATCH 1/4] kvm, vmx: move CR2 context switch out of assembly path Jim Mattson

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=CALMp9eTtB1te3kyHxZjm244BwdVKrVrjOTgiLufQFwD8Y2g_LQ@mail.gmail.com \
    --to=jmattson@google.com \
    --cc=js@alien8.de \
    --cc=jsteckli@amazon.de \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=sean.j.christopherson@intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).