From: Linus Torvalds <torvalds@linux-foundation.org>
To: Paolo Bonzini <pbonzini@redhat.com>
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 08:15:05 -1000 [thread overview]
Message-ID: <CAHk-=wgScNWP7Ohh5eEKgcs3NLp9GZOoQ6Z-Kz0aByRtHoJSrw@mail.gmail.com> (raw)
In-Reply-To: <daba6b06-66cb-6564-b7b0-26cb994a07cd@redhat.com>
On Mon, Oct 18, 2021 at 8:03 AM Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> The code is not wrong, there is a comment explaining it:
>
> * 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.
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.
Very strange code.
Linus
next prev parent reply other threads:[~2021-10-18 18:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-18 17:41 [GIT PULL] KVM fixes for Linux 5.15-rc7 Paolo Bonzini
2021-10-18 17:57 ` Linus Torvalds
2021-10-18 18:03 ` Paolo Bonzini
2021-10-18 18:15 ` Linus Torvalds [this message]
2021-10-18 18:29 ` Paolo Bonzini
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='CAHk-=wgScNWP7Ohh5eEKgcs3NLp9GZOoQ6Z-Kz0aByRtHoJSrw@mail.gmail.com' \
--to=torvalds@linux-foundation.org \
--cc=jmattson@google.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=pbonzini@redhat.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).