From: Richard Henderson <richard.henderson@linaro.org>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Dan Hoffman" <dhoff749@gmail.com>
Cc: Eduardo Habkost <eduardo@habkost.net>,
Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,
Paolo Bonzini <pbonzini@redhat.com>,
qemu-devel@nongnu.org, qemu-trivial@nongnu.org,
Eric Blake <eblake@redhat.com>
Subject: Re: [PATCH v3] hw/i386: fix short-circuit logic with non-optimizing builds
Date: Mon, 20 Nov 2023 07:30:12 -0800 [thread overview]
Message-ID: <54c7991d-7ba0-4d05-8653-b7218a3cb909@linaro.org> (raw)
In-Reply-To: <9282a606-794a-432c-8b56-fedf6af67768@linaro.org>
On 11/20/23 02:20, Philippe Mathieu-Daudé wrote:
> (Cc'ing Eric)
>
> On 20/11/23 10:28, Michael S. Tsirkin wrote:
>> On Sun, Nov 19, 2023 at 07:34:58PM -0600, Dan Hoffman wrote:
>>> As far as I can tell, yes. Any optimization level above O0 does not have this
>>> issue (on this version of Clang, at least)
>>
>> Aha, this is with -O0. That makes sense.
>
> But then, why the other cases aren't problematic?
>
> $ git grep -E ' (&&|\|\|) !?kvm_enabled'
> hw/arm/boot.c:1228: assert(!(info->secure_board_setup && kvm_enabled()));
> hw/i386/microvm.c:270: (mms->rtc == ON_OFF_AUTO_AUTO && !kvm_enabled())) {
> hw/i386/x86.c:135: if (x86ms->apic_id_limit > 255 && kvm_enabled() &&
> hw/mips/cps.c:62: return is_mt && !kvm_enabled();
> system/physmem.c:760: assert(asidx == 0 || !kvm_enabled());
> target/arm/cpu64.c:288: if (value && kvm_enabled() && !kvm_arm_sve_supported()) {
> target/i386/cpu.c:7264: if (requested_lbr_fmt && kvm_enabled()) {
> target/ppc/kvm.c:345: if (!cpu->hash64_opts || !kvm_enabled()) {
> target/s390x/cpu_models.c:574: if (xcc->kvm_required && !kvm_enabled()) {
> target/s390x/cpu_models_sysemu.c:124: if (S390_CPU_CLASS(oc)->kvm_required &&
> !kvm_enabled()) {
>
Because those are very simple tests that do not reference kvm-specific stuff, unlike...
>>> > - if (x86ms->apic_id_limit > 255 && kvm_enabled() &&
>>> > + if (kvm_enabled() && x86ms->apic_id_limit > 255 &&
>>> > (!kvm_irqchip_in_kernel() || !kvm_enable_x2apic())) {
... these function calls.
r~
next prev parent reply other threads:[~2023-11-20 15:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-19 20:31 [PATCH v3] hw/i386: fix short-circuit logic with non-optimizing builds Daniel Hoffman
2023-11-19 22:54 ` Philippe Mathieu-Daudé
2023-11-20 1:34 ` Dan Hoffman
2023-11-20 9:28 ` Michael S. Tsirkin
2023-11-20 10:20 ` Philippe Mathieu-Daudé
2023-11-20 15:30 ` Richard Henderson [this message]
2023-11-21 16:15 ` Eric Blake
2023-11-21 18:28 ` Dan Hoffman
2023-11-22 1:24 ` Dan Hoffman
2023-11-23 18:03 ` Dan Hoffman
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=54c7991d-7ba0-4d05-8653-b7218a3cb909@linaro.org \
--to=richard.henderson@linaro.org \
--cc=dhoff749@gmail.com \
--cc=eblake@redhat.com \
--cc=eduardo@habkost.net \
--cc=marcel.apfelbaum@gmail.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.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;
as well as URLs for NNTP newsgroup(s).