qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3] hw/i386: fix short-circuit logic with non-optimizing buil


From: Richard Henderson
Subject: Re: [PATCH v3] hw/i386: fix short-circuit logic with non-optimizing builds
Date: Mon, 20 Nov 2023 07:30:12 -0800
User-agent: Mozilla Thunderbird

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~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]