From: Paolo Bonzini <pbonzini@redhat.com>
To: Linus Torvalds <torvalds@linux-foundation.org>,
Jim Mattson <jmattson@google.com>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>
Cc: 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:03:24 +0200 [thread overview]
Message-ID: <daba6b06-66cb-6564-b7b0-26cb994a07cd@redhat.com> (raw)
In-Reply-To: <CAHk-=wg0+bWDKfApDHVR70hsaRA_7bEZfG1XtN2DxZGo+np9Ug@mail.gmail.com>
On 18/10/21 19:57, Linus Torvalds wrote:
> The way to do a logical "or" (instead of a bitwise one on two boolean
> expressions) is to use "||".
>
> Instead, the code was changed to completely insane
>
> (int) boolexpr1 | (int) boolexpr2
>
> thing, which is entirely illegible and pointless, and no sane person
> should ever write code like that.
>
> In other words, the*proper* fix to a warning is to look at the code,
> and*unsderstand* the code and the warning, instead of some mindless
> conversion to just avoid a warning.
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).
Paolo
next prev parent reply other threads:[~2021-10-18 18:03 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 [this message]
2021-10-18 18:15 ` Linus Torvalds
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=daba6b06-66cb-6564-b7b0-26cb994a07cd@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®