mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Jim Mattson <jmattson@google.com>,
	Nathan Chancellor <nathan@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	KVM list <kvm@vger.kernel.org>
Subject: Re: [GIT PULL] KVM fixes for Linux 5.15-rc7
Date: Mon, 18 Oct 2021 20:29:12 +0200	[thread overview]
Message-ID: <93d4156f-4d81-da15-b93e-79f3ec9bebdb@redhat.com> (raw)
In-Reply-To: <CAHk-=wgScNWP7Ohh5eEKgcs3NLp9GZOoQ6Z-Kz0aByRtHoJSrw@mail.gmail.com>

On 18/10/21 20:15, Linus Torvalds wrote:
>>           * Use a bitwise-OR instead of a logical-OR to aggregate the reserved
>>           * bits and EPT's invalid memtype/XWR checks to avoid an extra Jcc
>>           * (this is extremely unlikely to be short-circuited as true).
> That makes very little sense.
> 
> It seems to be avoiding a 'jcc' and replace it with a 'setcc' and an
> 'or'. Which is likely both bigger and slower.

The compiler knows that the setcc is unnecessary, because a!=0|b!=0 is 
the same as (a|b)!=0.

> If the jcc were unpredictable, maybe that would be one thing. But at
> least from a quick look, that doesn't even seem likely
> 
>   The other use of that function has a "WARN_ONCE()" on it, so
> presumably it normally doesn't ever trigger either of the boolean
> conditions.

Yes, and that was why it used a "|".

Anyway, not worth arguing for or against; I'll just change it to logical OR.

Paolo


      reply	other threads:[~2021-10-18 18:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-18 17:41 Paolo Bonzini
2021-10-18 17:57 ` Linus Torvalds
2021-10-18 18:03   ` Paolo Bonzini
2021-10-18 18:15     ` Linus Torvalds
2021-10-18 18:29       ` Paolo Bonzini [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=93d4156f-4d81-da15-b93e-79f3ec9bebdb@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=torvalds@linux-foundation.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

all inboxes | Powered by JetHome®