qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Cornelia Huck <cohuck@redhat.com>, Eric Blake <eblake@redhat.com>
Cc: "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Greg Kurz" <groug@kaod.org>,
	qemu-devel@nongnu.org, "Alex Bennée" <alex.bennee@linaro.org>,
	"Fam Zheng" <famz@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] kvm: workaround build break on gcc-7.1.1 / fedora26
Date: Fri, 4 Aug 2017 18:54:04 +0200	[thread overview]
Message-ID: <3af2df1d-d250-98ff-e2e9-88fa50e24ea2@redhat.com> (raw)
In-Reply-To: <20170803162441.43f84f54@gondolin>

On 03/08/2017 16:24, Cornelia Huck wrote:
> On Thu, 3 Aug 2017 09:10:29 -0500
> Eric Blake <eblake@redhat.com> wrote:
> 
>> On 08/03/2017 08:46 AM, Philippe Mathieu-Daudé wrote:
>>> Hi Greg,
>>>
>>> On 08/02/2017 11:47 AM, Greg Kurz wrote:  
>>>> Building QEMU on fedora26 with the latest gcc package fails:
>>>>
>>>>    CC      ppc64-softmmu/target/ppc/kvm.o
>>>> In file included from include/sysemu/hw_accel.h:16:0,
>>>>                   from target/ppc/kvm.c:31:
>>>> target/ppc/kvm.c: In function ‘kvmppc_booke_watchdog_enable’:
>>>> include/sysemu/kvm.h:449:35: error: ‘args_tmp[i]’ may be used
>>>> uninitialized
>>>>   in this function [-Werror=maybe-uninitialized]
>>>>               cap.args[i] = args_tmp[i];                               \
>>>>                                     ^
>>>> target/ppc/kvm.c: In function ‘kvmppc_set_papr’:
>>>> include/sysemu/kvm.h:449:35: error: ‘args_tmp[i]’ may be used
>>>> uninitialized
>>>>   in this function [-Werror=maybe-uninitialized]
>>>> cc1: all warnings being treated as errors  
>>>
>>> I'm trying to reproduce this in our docker images (all x86_64 based) but
>>> can't reproduce.  
>>
>> That's because x86_64 hosts only call kvm_vm_enable_cap() with non-empty
>> varargs.  
> 
> There's
> 
> target/i386/kvm.c:            kvm_vcpu_enable_cap(cs, KVM_CAP_HYPERV_SYNIC, 0)) {
> 
>> But we have:
>>
>> accel/kvm/kvm-all.c: ret = kvm_vm_enable_cap(s, KVM_CAP_S390_IRQCHIP, 0);
>>
>> which is only compiled on s390 hosts (or, at least that's my guess,
>> based on the cap name)
> 
> I don't see how the compiler can optimize this away, as the check for
> this cap is an ioctl...

Indeed.  This is a compiler bug and it only provides a warning (meaning
--disable-werror silences it).  I don't think it's a good idea to uglify
the code for something that the compiler should easily optimize away...

Paolo

> This seems a bit ugly. And I still don't understand why this only seems
> to hit on ppc...

  reply	other threads:[~2017-08-04 16:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-02 14:47 [Qemu-devel] [PATCH] kvm: workaround build break on gcc-7.1.1 / fedora26 Greg Kurz
2017-08-03 13:34 ` Philippe Mathieu-Daudé
2017-08-03 13:55   ` Eric Blake
2017-08-03 14:07     ` Philippe Mathieu-Daudé
2017-08-03 18:38       ` Greg Kurz
2017-08-03 18:56         ` Eric Blake
2017-08-07 11:13           ` Greg Kurz
2017-08-03 14:31   ` Greg Kurz
2017-08-03 13:46 ` Philippe Mathieu-Daudé
2017-08-03 14:10   ` Eric Blake
2017-08-03 14:24     ` Cornelia Huck
2017-08-04 16:54       ` Paolo Bonzini [this message]
2017-08-03 14:36   ` Greg Kurz

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=3af2df1d-d250-98ff-e2e9-88fa50e24ea2@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=cohuck@redhat.com \
    --cc=eblake@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=famz@redhat.com \
    --cc=groug@kaod.org \
    --cc=qemu-devel@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).