All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] Build error with git commit 8eb29f1bf5a974dc4c11d2d1f5e7c7f7a62be116 on x86_64
@ 2019-02-23  0:35 Andrew Randrianasulu
  2019-02-25 14:13 ` Eric Blake
  2019-02-25 16:19 ` Philippe Mathieu-Daudé
  0 siblings, 2 replies; 12+ messages in thread
From: Andrew Randrianasulu @ 2019-02-23  0:35 UTC (permalink / raw)
  To: qemu-devel

Hello!

I just pulled latest git

up to 
commit 8eb29f1bf5a974dc4c11d2d1f5e7c7f7a62be116 (HEAD -> master, origin/master, 
origin/HEAD)
Merge: a05838cb2a 2b6326c0bf
Author: Peter Maydell <peter.maydell@linaro.org>
Date:   Fri Feb 22 15:48:04 2019 +0000

    Merge remote-tracking branch 'remotes/awilliam/tags/vfio-updates-20190221.0' 
into staging

    VFIO updates 2019-02-21

     - Workaround kernel overflow bug in vfio type1 DMA unmap
       (Alex Williamson)

     - Refactor vfio container initialization (Eric Auger)

    # gpg: Signature made Fri 22 Feb 2019 05:21:07 GMT
    # gpg:                using RSA key 239B9B6E3BB08B22
    # gpg: Good signature from "Alex Williamson <alex.williamson@redhat.com>" 
[full]
    # gpg:                 aka "Alex Williamson <alex@shazbot.org>" [full]
    # gpg:                 aka "Alex Williamson <alwillia@redhat.com>" [full]
    # gpg:                 aka "Alex Williamson <alex.l.williamson@gmail.com>" 
[full]
    # Primary key fingerprint: 42F6 C04E 540B D1A9 9E7B  8A90 239B 9B6E 3BB0 
8B22

    * remotes/awilliam/tags/vfio-updates-20190221.0:
      hw/vfio/common: Refactor container initialization
      vfio/common: Work around kernel overflow bug in DMA unmap

    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-----------------

and default build with simple ./configure on slackware 14.2 x86-64 box failed 
like this:

root@slax:~/src/qemu# LANG=C make -j 5
        CHK version_gen.h
  CC      qobject/block-qdict.o
  CC      util/thread-pool.o
  CC      util/main-loop.o
  CC      util/qemu-timer.o
  CC      util/iohandler.o
  CC      util/aio-posix.o
qobject/block-qdict.c: In function 'qdict_array_split':
qobject/block-qdict.c:259:9: error: 'subqdict' may be used uninitialized in this 
function [-Werror=maybe-uninitialized]
         qlist_append_obj(*dst, subqobj ?: QOBJECT(subqdict));
         ^
  CC      util/compatfd.o
  CC      util/event_notifier-posix.o
cc1: all warnings being treated as errors
/root/src/qemu/rules.mak:69: recipe for target 'qobject/block-qdict.o' failed
make: *** [qobject/block-qdict.o] Error 1
make: *** Waiting for unfinished jobs....
----------------

 LANG=C gcc --version
gcc (GCC) 5.5.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

---------------

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] Build error with git commit 8eb29f1bf5a974dc4c11d2d1f5e7c7f7a62be116 on x86_64
  2019-02-23  0:35 [Qemu-devel] Build error with git commit 8eb29f1bf5a974dc4c11d2d1f5e7c7f7a62be116 on x86_64 Andrew Randrianasulu
@ 2019-02-25 14:13 ` Eric Blake
  2019-02-25 16:19 ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 12+ messages in thread
From: Eric Blake @ 2019-02-25 14:13 UTC (permalink / raw)
  To: Andrew Randrianasulu, qemu-devel, Max Reitz, Kevin Wolf,
	Markus Armbruster, qemu-block

Adding people in cc based on 'scripts/get-maintainer.pl -f
qobject/block-qdict.c'

On 2/22/19 6:35 PM, Andrew Randrianasulu wrote:
> Hello!
> 
> I just pulled latest git
> 
> up to 
> commit 8eb29f1bf5a974dc4c11d2d1f5e7c7f7a62be116 (HEAD -> master, origin/master, 
> origin/HEAD)
> Merge: a05838cb2a 2b6326c0bf
> Author: Peter Maydell <peter.maydell@linaro.org>
> Date:   Fri Feb 22 15:48:04 2019 +0000

> and default build with simple ./configure on slackware 14.2 x86-64 box failed 
> like this:
> 

> qobject/block-qdict.c: In function 'qdict_array_split':
> qobject/block-qdict.c:259:9: error: 'subqdict' may be used uninitialized in this 
> function [-Werror=maybe-uninitialized]
>          qlist_append_obj(*dst, subqobj ?: QOBJECT(subqdict));
>          ^

Appears to be a false positive, but one that the compiler can't see
through (that is, subqdict is only used if subqobj is NULL, but proving
that all code paths either set subqobj or subqdict is not trivial for
the compiler).  I suspect this would fix it.

diff --git i/qobject/block-qdict.c w/qobject/block-qdict.c
index 1487cc5dd8b..b26524429c0 100644
--- i/qobject/block-qdict.c
+++ w/qobject/block-qdict.c
@@ -224,7 +224,7 @@ void qdict_array_split(QDict *src, QList **dst)
     for (i = 0; i < UINT_MAX; i++) {
         QObject *subqobj;
         bool is_subqdict;
-        QDict *subqdict;
+        QDict *subqdict = NULL;
         char indexstr[32], prefix[32];
         size_t snprintf_ret;

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] Build error with git commit 8eb29f1bf5a974dc4c11d2d1f5e7c7f7a62be116 on x86_64
  2019-02-23  0:35 [Qemu-devel] Build error with git commit 8eb29f1bf5a974dc4c11d2d1f5e7c7f7a62be116 on x86_64 Andrew Randrianasulu
  2019-02-25 14:13 ` Eric Blake
@ 2019-02-25 16:19 ` Philippe Mathieu-Daudé
  2019-02-25 17:29   ` Andrew Randrianasulu
  1 sibling, 1 reply; 12+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-02-25 16:19 UTC (permalink / raw)
  To: Andrew Randrianasulu, qemu-devel

Hi Andrew,

On 2/23/19 1:35 AM, Andrew Randrianasulu wrote:
> Hello!
> 
> I just pulled latest git
> 
[...]
> 
> and default build with simple ./configure on slackware 14.2 x86-64 box failed 
> like this:
> 
> root@slax:~/src/qemu# LANG=C make -j 5
>         CHK version_gen.h
>   CC      qobject/block-qdict.o
>   CC      util/thread-pool.o
>   CC      util/main-loop.o
>   CC      util/qemu-timer.o
>   CC      util/iohandler.o
>   CC      util/aio-posix.o
> qobject/block-qdict.c: In function 'qdict_array_split':
> qobject/block-qdict.c:259:9: error: 'subqdict' may be used uninitialized in this 
> function [-Werror=maybe-uninitialized]
>          qlist_append_obj(*dst, subqobj ?: QOBJECT(subqdict));
>          ^

That's odd, I can not reproduce with a simple ./configure:

$ cat /etc/slackware-version
Slackware 14.2

$ gcc --version
gcc (GCC) 5.5.0

>  LANG=C gcc --version
> gcc (GCC) 5.5.0
> Copyright (C) 2015 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] Build error with git commit 8eb29f1bf5a974dc4c11d2d1f5e7c7f7a62be116 on x86_64
  2019-02-25 16:19 ` Philippe Mathieu-Daudé
@ 2019-02-25 17:29   ` Andrew Randrianasulu
  2019-02-26  8:54     ` Thomas Huth
  0 siblings, 1 reply; 12+ messages in thread
From: Andrew Randrianasulu @ 2019-02-25 17:29 UTC (permalink / raw)
  To: Philippe Mathieu-Daudc3a9; +Cc: qemu-devel

В сообщении от Monday 25 February 2019 19:19:01 Philippe Mathieu-Daudc3a9 
написал(а):
> Hi Andrew,
>
> On 2/23/19 1:35 AM, Andrew Randrianasulu wrote:
> > Hello!
> >
> > I just pulled latest git
>
> [...]
>
> > and default build with simple ./configure on slackware 14.2 x86-64 box
> > failed like this:
> >
> > root@slax:~/src/qemu# LANG=C make -j 5
> >         CHK version_gen.h
> >   CC      qobject/block-qdict.o
> >   CC      util/thread-pool.o
> >   CC      util/main-loop.o
> >   CC      util/qemu-timer.o
> >   CC      util/iohandler.o
> >   CC      util/aio-posix.o
> > qobject/block-qdict.c: In function 'qdict_array_split':
> > qobject/block-qdict.c:259:9: error: 'subqdict' may be used uninitialized
> > in this function [-Werror=maybe-uninitialized]
> >          qlist_append_obj(*dst, subqobj ?: QOBJECT(subqdict));
> >          ^
>
> That's odd, I can not reproduce with a simple ./configure:
>
> $ cat /etc/slackware-version
> Slackware 14.2
>
> $ gcc --version
> gcc (GCC) 5.5.0
>

Well, then may be this is false positive, right now another qemu instance is 
busy inside same chroot, will try patch posted in earlier mail (after removing 
CFLAG I added for compiling qemu at all after this error).

Thanks for trying to reproduce.

> >  LANG=C gcc --version
> > gcc (GCC) 5.5.0
> > Copyright (C) 2015 Free Software Foundation, Inc.
> > This is free software; see the source for copying conditions.  There is
> > NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
> > PURPOSE.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] Build error with git commit 8eb29f1bf5a974dc4c11d2d1f5e7c7f7a62be116 on x86_64
  2019-02-25 17:29   ` Andrew Randrianasulu
@ 2019-02-26  8:54     ` Thomas Huth
  2019-02-26  8:58       ` Andrew Randrianasulu
  0 siblings, 1 reply; 12+ messages in thread
From: Thomas Huth @ 2019-02-26  8:54 UTC (permalink / raw)
  To: Andrew Randrianasulu, Philippe Mathieu-Daudc3a9; +Cc: qemu-devel

On 25/02/2019 18.29, Andrew Randrianasulu wrote:
> В сообщении от Monday 25 February 2019 19:19:01 Philippe Mathieu-Daudc3a9 
> написал(а):
>> Hi Andrew,
>>
>> On 2/23/19 1:35 AM, Andrew Randrianasulu wrote:
>>> Hello!
>>>
>>> I just pulled latest git
>>
>> [...]
>>
>>> and default build with simple ./configure on slackware 14.2 x86-64 box
>>> failed like this:
>>>
>>> root@slax:~/src/qemu# LANG=C make -j 5
>>>         CHK version_gen.h
>>>   CC      qobject/block-qdict.o
>>>   CC      util/thread-pool.o
>>>   CC      util/main-loop.o
>>>   CC      util/qemu-timer.o
>>>   CC      util/iohandler.o
>>>   CC      util/aio-posix.o
>>> qobject/block-qdict.c: In function 'qdict_array_split':
>>> qobject/block-qdict.c:259:9: error: 'subqdict' may be used uninitialized
>>> in this function [-Werror=maybe-uninitialized]
>>>          qlist_append_obj(*dst, subqobj ?: QOBJECT(subqdict));
>>>          ^
>>
>> That's odd, I can not reproduce with a simple ./configure:
>>
>> $ cat /etc/slackware-version
>> Slackware 14.2
>>
>> $ gcc --version
>> gcc (GCC) 5.5.0
>>
> 
> Well, then may be this is false positive, right now another qemu instance is 
> busy inside same chroot, will try patch posted in earlier mail (after removing 
> CFLAG I added for compiling qemu at all after this error).
> 
> Thanks for trying to reproduce.

Just to be sure: You don't compile with -O3 or -O1 or -O0 in the CFLAGS
here, do you?

 Thomas

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] Build error with git commit 8eb29f1bf5a974dc4c11d2d1f5e7c7f7a62be116 on x86_64
  2019-02-26  8:54     ` Thomas Huth
@ 2019-02-26  8:58       ` Andrew Randrianasulu
  2019-02-26  9:05         ` Thomas Huth
  0 siblings, 1 reply; 12+ messages in thread
From: Andrew Randrianasulu @ 2019-02-26  8:58 UTC (permalink / raw)
  To: Thomas Huth, qemu-devel

В сообщении от Tuesday 26 February 2019 11:54:12 вы написали:
> On 25/02/2019 18.29, Andrew Randrianasulu wrote:
> > В сообщении от Monday 25 February 2019 19:19:01 Philippe Mathieu-Daudc3a9
> >
> > написал(а):
> >> Hi Andrew,
> >>
> >> On 2/23/19 1:35 AM, Andrew Randrianasulu wrote:
> >>> Hello!
> >>>
> >>> I just pulled latest git
> >>
> >> [...]
> >>
> >>> and default build with simple ./configure on slackware 14.2 x86-64 box
> >>> failed like this:
> >>>
> >>> root@slax:~/src/qemu# LANG=C make -j 5
> >>>         CHK version_gen.h
> >>>   CC      qobject/block-qdict.o
> >>>   CC      util/thread-pool.o
> >>>   CC      util/main-loop.o
> >>>   CC      util/qemu-timer.o
> >>>   CC      util/iohandler.o
> >>>   CC      util/aio-posix.o
> >>> qobject/block-qdict.c: In function 'qdict_array_split':
> >>> qobject/block-qdict.c:259:9: error: 'subqdict' may be used
> >>> uninitialized in this function [-Werror=maybe-uninitialized]
> >>>          qlist_append_obj(*dst, subqobj ?: QOBJECT(subqdict));
> >>>          ^
> >>
> >> That's odd, I can not reproduce with a simple ./configure:
> >>
> >> $ cat /etc/slackware-version
> >> Slackware 14.2
> >>
> >> $ gcc --version
> >> gcc (GCC) 5.5.0
> >
> > Well, then may be this is false positive, right now another qemu instance
> > is busy inside same chroot, will try patch posted in earlier mail (after
> > removing CFLAG I added for compiling qemu at all after this error).
> >
> > Thanks for trying to reproduce.
>
> Just to be sure: You don't compile with -O3 or -O1 or -O0 in the CFLAGS
> here, do you?

This time  it was -O3, but I got some corruption in ppc64le guest's X, so I plan 
to revert this -O3 back to default ....

another qemu still busy compiling kernel (modified Alpine linux ppc64le config), 
and also Cinelerra-GG (video editor I'm hacking on), so I hope whole thing will 
be finished ..in day or so.

>
>  Thomas

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] Build error with git commit 8eb29f1bf5a974dc4c11d2d1f5e7c7f7a62be116 on x86_64
  2019-02-26  8:58       ` Andrew Randrianasulu
@ 2019-02-26  9:05         ` Thomas Huth
  2019-02-26  9:46           ` Andrew Randrianasulu
  2019-02-26 11:05           ` Peter Maydell
  0 siblings, 2 replies; 12+ messages in thread
From: Thomas Huth @ 2019-02-26  9:05 UTC (permalink / raw)
  To: Andrew Randrianasulu, qemu-devel

On 26/02/2019 09.58, Andrew Randrianasulu wrote:
> В сообщении от Tuesday 26 February 2019 11:54:12 вы написали:
>> On 25/02/2019 18.29, Andrew Randrianasulu wrote:
>>> В сообщении от Monday 25 February 2019 19:19:01 Philippe Mathieu-Daudc3a9
>>>
>>> написал(а):
>>>> Hi Andrew,
>>>>
>>>> On 2/23/19 1:35 AM, Andrew Randrianasulu wrote:
>>>>> Hello!
>>>>>
>>>>> I just pulled latest git
>>>>
>>>> [...]
>>>>
>>>>> and default build with simple ./configure on slackware 14.2 x86-64 box
>>>>> failed like this:
>>>>>
>>>>> root@slax:~/src/qemu# LANG=C make -j 5
>>>>>         CHK version_gen.h
>>>>>   CC      qobject/block-qdict.o
>>>>>   CC      util/thread-pool.o
>>>>>   CC      util/main-loop.o
>>>>>   CC      util/qemu-timer.o
>>>>>   CC      util/iohandler.o
>>>>>   CC      util/aio-posix.o
>>>>> qobject/block-qdict.c: In function 'qdict_array_split':
>>>>> qobject/block-qdict.c:259:9: error: 'subqdict' may be used
>>>>> uninitialized in this function [-Werror=maybe-uninitialized]
>>>>>          qlist_append_obj(*dst, subqobj ?: QOBJECT(subqdict));
>>>>>          ^
>>>>
>>>> That's odd, I can not reproduce with a simple ./configure:
>>>>
>>>> $ cat /etc/slackware-version
>>>> Slackware 14.2
>>>>
>>>> $ gcc --version
>>>> gcc (GCC) 5.5.0
>>>
>>> Well, then may be this is false positive, right now another qemu instance
>>> is busy inside same chroot, will try patch posted in earlier mail (after
>>> removing CFLAG I added for compiling qemu at all after this error).
>>>
>>> Thanks for trying to reproduce.
>>
>> Just to be sure: You don't compile with -O3 or -O1 or -O0 in the CFLAGS
>> here, do you?
> 
> This time  it was -O3, but I got some corruption in ppc64le guest's X, so I plan 
> to revert this -O3 back to default ....

Ok, then that's the problem here: GCC often produces some additional
"may be unused" warnings with -O3, and we normally only guarantee that
QEMU compiles without warnings when using the standard -O2 optimization
level.
So if you want to compile with -O3, you also have to specify
--disable-werror (or add -Wno-error=maybe-unitialized to the CFLAGS).
But unless you have really an urgent need for O3, I'd rather recommend
to compile with the well-tested O2 optimization level instead.

 Thomas

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] Build error with git commit 8eb29f1bf5a974dc4c11d2d1f5e7c7f7a62be116 on x86_64
  2019-02-26  9:05         ` Thomas Huth
@ 2019-02-26  9:46           ` Andrew Randrianasulu
  2019-02-26  9:58             ` Thomas Huth
  2019-02-26 11:05           ` Peter Maydell
  1 sibling, 1 reply; 12+ messages in thread
From: Andrew Randrianasulu @ 2019-02-26  9:46 UTC (permalink / raw)
  To: Thomas Huth; +Cc: qemu-devel

В сообщении от Tuesday 26 February 2019 12:05:02 Thomas Huth написал(а):
> On 26/02/2019 09.58, Andrew Randrianasulu wrote:
> > В сообщении от Tuesday 26 February 2019 11:54:12 вы написали:
> >> On 25/02/2019 18.29, Andrew Randrianasulu wrote:
> >>> В сообщении от Monday 25 February 2019 19:19:01 Philippe
> >>> Mathieu-Daudc3a9
> >>>
> >>> написал(а):
> >>>> Hi Andrew,
> >>>>
> >>>> On 2/23/19 1:35 AM, Andrew Randrianasulu wrote:
> >>>>> Hello!
> >>>>>
> >>>>> I just pulled latest git
> >>>>
> >>>> [...]
> >>>>
> >>>>> and default build with simple ./configure on slackware 14.2 x86-64
> >>>>> box failed like this:
> >>>>>
> >>>>> root@slax:~/src/qemu# LANG=C make -j 5
> >>>>>         CHK version_gen.h
> >>>>>   CC      qobject/block-qdict.o
> >>>>>   CC      util/thread-pool.o
> >>>>>   CC      util/main-loop.o
> >>>>>   CC      util/qemu-timer.o
> >>>>>   CC      util/iohandler.o
> >>>>>   CC      util/aio-posix.o
> >>>>> qobject/block-qdict.c: In function 'qdict_array_split':
> >>>>> qobject/block-qdict.c:259:9: error: 'subqdict' may be used
> >>>>> uninitialized in this function [-Werror=maybe-uninitialized]
> >>>>>          qlist_append_obj(*dst, subqobj ?: QOBJECT(subqdict));
> >>>>>          ^
> >>>>
> >>>> That's odd, I can not reproduce with a simple ./configure:
> >>>>
> >>>> $ cat /etc/slackware-version
> >>>> Slackware 14.2
> >>>>
> >>>> $ gcc --version
> >>>> gcc (GCC) 5.5.0
> >>>
> >>> Well, then may be this is false positive, right now another qemu
> >>> instance is busy inside same chroot, will try patch posted in earlier
> >>> mail (after removing CFLAG I added for compiling qemu at all after this
> >>> error).
> >>>
> >>> Thanks for trying to reproduce.
> >>
> >> Just to be sure: You don't compile with -O3 or -O1 or -O0 in the CFLAGS
> >> here, do you?
> >
> > This time  it was -O3, but I got some corruption in ppc64le guest's X, so
> > I plan to revert this -O3 back to default ....
>
> Ok, then that's the problem here: GCC often produces some additional
> "may be unused" warnings with -O3, and we normally only guarantee that
> QEMU compiles without warnings when using the standard -O2 optimization
> level.
> So if you want to compile with -O3, you also have to specify
> --disable-werror (or add -Wno-error=maybe-unitialized to the CFLAGS).
> But unless you have really an urgent need for O3, I'd rather recommend
> to compile with the well-tested O2 optimization level instead.

Ok, will do ....

I was hoping for some speed-up in (mt)tcg based machines, because compiling big 
programs inside qemu obviously not ultrafast.

3916 root      20   0 5442m 2.8g 3396 R  213 24.0   2758:40 qemu-system-ppc

from 'top' on host.

But then, soon-to-be 4.0 qemu should be faster in general due to all those tcg 
optimizations, so -O3 really will be dropped on my side.

Still, I have more funny observations, like this blue screen with qemu's -vga 
virtio/cirrus was present even on 2.12+, but this probably offb bug (assumes BE 
when compiled for power?) .

And 
root@slax:~/src/qemu# qemu-system-ppc64 -m 2G -display sdl,gl=on -smp 
3  -hda /mnt/alpine_disk.img -g 1120x832x24

somewhat resulted in 8-bit X display (xf86-video-fbdev over offb, i think. due 
to 'nomodeset' default in alpine kernel - another reason to recompile {first 
reason was es1370 audio device support} and alter some parameters..) 

:)

In some sense this is cool, because I can see same problem with not loading png 
images into Cinelerra-GG itself, even on 8-bit display (without GLX and 
composite), but may be it was not intended.

will look into offb's sources ...

also, -g 1186x864x32 resulted in funnuy diagonal corruption even at firmware 
screen level, and probably same happening with x86-64/kvm guest if I select 
some less comon, but exposed via xrandr mode. (this bit for -vga std, default)

>
>  Thomas

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] Build error with git commit 8eb29f1bf5a974dc4c11d2d1f5e7c7f7a62be116 on x86_64
  2019-02-26  9:46           ` Andrew Randrianasulu
@ 2019-02-26  9:58             ` Thomas Huth
  2019-02-26 10:44               ` Andrew Randrianasulu
  0 siblings, 1 reply; 12+ messages in thread
From: Thomas Huth @ 2019-02-26  9:58 UTC (permalink / raw)
  To: Andrew Randrianasulu; +Cc: qemu-devel

On 26/02/2019 10.46, Andrew Randrianasulu wrote:
[...]
> also, -g 1186x864x32 resulted in funnuy diagonal corruption even at firmware 
> screen level, and probably same happening with x86-64/kvm guest if I select 
> some less comon, but exposed via xrandr mode. (this bit for -vga std, default)

1186 is not dividable by 16 ... you likely meant 1184 instead?

 Thomas

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] Build error with git commit 8eb29f1bf5a974dc4c11d2d1f5e7c7f7a62be116 on x86_64
  2019-02-26  9:58             ` Thomas Huth
@ 2019-02-26 10:44               ` Andrew Randrianasulu
  0 siblings, 0 replies; 12+ messages in thread
From: Andrew Randrianasulu @ 2019-02-26 10:44 UTC (permalink / raw)
  To: Thomas Huth, qemu-devel

В сообщении от Tuesday 26 February 2019 12:58:11 вы написали:
> On 26/02/2019 10.46, Andrew Randrianasulu wrote:
> [...]
>
> > also, -g 1186x864x32 resulted in funnuy diagonal corruption even at
> > firmware screen level, and probably same happening with x86-64/kvm guest
> > if I select some less comon, but exposed via xrandr mode. (this bit for
> > -vga std, default)
>
> 1186 is not dividable by 16 ... you likely meant 1184 instead?
>
>  Thomas

yeah, just forgot exact number ..
not sure if it really bug or feature. Should qemu check (and enforce? or just 
warn about?) those parameters, if specific video driver can't cope with 
specific resolutions? 

I also looked at offb sources:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/video/fbdev/offb.c?h=v5.0-rc8

hm, because by default stdvga initialized by openfrmware to truecolor mode (32 
bpp), then I assume cmap hacks not really applicable in this case? I'll try to 
play with switch at line 446 and specifically 'case 32' at line 480 ...

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] Build error with git commit 8eb29f1bf5a974dc4c11d2d1f5e7c7f7a62be116 on x86_64
  2019-02-26  9:05         ` Thomas Huth
  2019-02-26  9:46           ` Andrew Randrianasulu
@ 2019-02-26 11:05           ` Peter Maydell
  2019-02-26 12:16             ` Thomas Huth
  1 sibling, 1 reply; 12+ messages in thread
From: Peter Maydell @ 2019-02-26 11:05 UTC (permalink / raw)
  To: Thomas Huth; +Cc: Andrew Randrianasulu, QEMU Developers

On Tue, 26 Feb 2019 at 09:06, Thomas Huth <thuth@redhat.com> wrote:
> Ok, then that's the problem here: GCC often produces some additional
> "may be unused" warnings with -O3, and we normally only guarantee that
> QEMU compiles without warnings when using the standard -O2 optimization
> level.
> So if you want to compile with -O3, you also have to specify
> --disable-werror (or add -Wno-error=maybe-unitialized to the CFLAGS).
> But unless you have really an urgent need for O3, I'd rather recommend
> to compile with the well-tested O2 optimization level instead.

I think in general we should probably look at fixing warnings
that occur at -O3 when they're reported to us, even if we don't
habitually build that way. But, like using bleeding-edge versions of
gcc or clang, if you use an odd set of optimization flags you might
find you run into warnings we haven't seen yet and need to make them
non-fatal with --disable-werror. (--disable-werror is the default for
releases, so you'll only get compile failures if building from git.)

Actual "QEMU is broken when built with -O3" issues are definitely
worth investigating since they imply either a QEMU bug or a
compiler bug.

PS: in general -O3 is not necessarily going to generate better code
than -O2 if used as a blanket optimization setting -- it can
end up generating larger code that increases icache pressure.
Probably best used carefully and when benchmarking shows that
it's actually an improvement.

thanks
-- PMM

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] Build error with git commit 8eb29f1bf5a974dc4c11d2d1f5e7c7f7a62be116 on x86_64
  2019-02-26 11:05           ` Peter Maydell
@ 2019-02-26 12:16             ` Thomas Huth
  0 siblings, 0 replies; 12+ messages in thread
From: Thomas Huth @ 2019-02-26 12:16 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Andrew Randrianasulu, QEMU Developers

On 26/02/2019 12.05, Peter Maydell wrote:
> On Tue, 26 Feb 2019 at 09:06, Thomas Huth <thuth@redhat.com> wrote:
>> Ok, then that's the problem here: GCC often produces some additional
>> "may be unused" warnings with -O3, and we normally only guarantee that
>> QEMU compiles without warnings when using the standard -O2 optimization
>> level.
>> So if you want to compile with -O3, you also have to specify
>> --disable-werror (or add -Wno-error=maybe-unitialized to the CFLAGS).
>> But unless you have really an urgent need for O3, I'd rather recommend
>> to compile with the well-tested O2 optimization level instead.
> 
> I think in general we should probably look at fixing warnings
> that occur at -O3 when they're reported to us, even if we don't
> habitually build that way.

Have you ever tried building QEMU with -O3 (and --enable-werror)? That
list ist looong, e.g. here are just the warnings when compiling aarch64:

qemu/block/vmdk.c: In function ‘vmdk_open_vmdk4’:
qemu/block/vmdk.c:741:9: warning: ‘extent’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     ret = vmdk_init_tables(bs, extent, errp);
         ^
qemu/block/vmdk.c: In function ‘vmdk_open_sparse’:
qemu/block/vmdk.c:550:9: warning: ‘extent’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     ret = vmdk_init_tables(bs, extent, errp);
         ^
qemu/block/vmdk.c:529:17: note: ‘extent’ was declared here
     VmdkExtent *extent;
                 ^
qemu/block/vmdk.c: In function ‘vmdk_open_desc_file.isra.15’:
qemu/block/vmdk.c:893:39: warning: ‘extent’ may be used uninitialized in this function [-Wmaybe-uninitialized]
             extent->flat_start_offset = flat_offset << 9;
                                       ^
qemu/block/vmdk.c:823:17: note: ‘extent’ was declared here
     VmdkExtent *extent;
                 ^
qemu/block/nbd-client.c: In function ‘nbd_co_request’:
qemu/block/nbd-client.c:608:8: warning: ‘local_reply.type’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     if (chunk->type == NBD_REPLY_TYPE_NONE) {
        ^
qemu/block/nbd-client.c:573:14: note: ‘local_reply.type’ was declared here
     NBDReply local_reply;
              ^
qemu/block/nbd-client.c:614:22: warning: ‘local_reply.flags’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     if (chunk->flags & NBD_REPLY_FLAG_DONE) {
                      ^
qemu/block/nbd-client.c:573:14: note: ‘local_reply.flags’ was declared here
     NBDReply local_reply;
              ^
qemu/block/nbd-client.c:601:8: warning: ‘local_reply.<U3390>.magic’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     if (nbd_reply_is_simple(reply) || s->quit) {
        ^
qemu/block/nbd-client.c:573:14: note: ‘local_reply.<U3390>.magic’ was declared here
     NBDReply local_reply;
              ^
qemu/block/nbd-client.c: In function ‘nbd_client_co_preadv’:
qemu/block/nbd-client.c:209:8: warning: ‘reply.length’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     if (chunk->length != sizeof(offset) + sizeof(hole_size)) {
        ^
qemu/block/nbd-client.c:652:14: note: ‘reply.length’ was declared here
     NBDReply reply;
              ^
qemu/block/nbd-client.c:664:9: warning: ‘reply.type’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         switch (chunk->type) {
         ^
qemu/block/nbd-client.c:652:14: note: ‘reply.type’ was declared here
     NBDReply reply;
              ^
qemu/block/nbd-client.c:614:22: warning: ‘reply.flags’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     if (chunk->flags & NBD_REPLY_FLAG_DONE) {
                      ^
qemu/block/nbd-client.c:652:14: note: ‘reply.flags’ was declared here
     NBDReply reply;
              ^
qemu/block/nbd-client.c: In function ‘nbd_client_co_block_status’:
qemu/block/nbd-client.c:241:8: warning: ‘reply.length’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     if (chunk->length != sizeof(context_id) + sizeof(*extent)) {
        ^
qemu/block/nbd-client.c:703:14: note: ‘reply.length’ was declared here
     NBDReply reply;
              ^
qemu/block/nbd-client.c:717:9: warning: ‘reply.type’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         switch (chunk->type) {
         ^
qemu/block/nbd-client.c:703:14: note: ‘reply.type’ was declared here
     NBDReply reply;
              ^
qemu/block/nbd-client.c:614:22: warning: ‘reply.flags’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     if (chunk->flags & NBD_REPLY_FLAG_DONE) {
                      ^
qemu/block/nbd-client.c:703:14: note: ‘reply.flags’ was declared here
     NBDReply reply;
              ^
qemu/qobject/block-qdict.c: In function ‘qdict_array_split’:
qemu/qobject/block-qdict.c:259:25: warning: ‘subqdict’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         qlist_append_obj(*dst, subqobj ?: QOBJECT(subqdict));
                         ^
qemu/hw/intc/i8259.c: In function ‘pic_read_irq’:
qemu/hw/intc/i8259.c:200:13: warning: ‘irq2’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         irq = irq2 + 8;
             ^
qemu/migration/qemu-file.c: In function ‘qemu_get_buffer_in_place’:
qemu/migration/qemu-file.c:537:18: warning: ‘src’ may be used uninitialized in this function [-Wmaybe-uninitialized]
             *buf = src;
                  ^
qemu/slirp/socket.c: In function ‘soread’:
qemu/slirp/socket.c:232:5: warning: ‘n’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  if (n == 2 && nn == iov[0].iov_len) {
     ^
In file included from /usr/lib64/glib-2.0/include/glibconfig.h:9:0,
                 from /usr/include/glib-2.0/glib/gtypes.h:32,
                 from /usr/include/glib-2.0/glib/galloca.h:32,
                 from /usr/include/glib-2.0/glib.h:30,
                 from qemu/slirp/ip.h:36,
                 from qemu/slirp/slirp.h:50,
                 from qemu/slirp/socket.c:8:
qemu/slirp/socket.c: In function ‘soreadbuf’:
/usr/include/glib-2.0/glib/gmacros.h:300:39: warning: ‘iov.iov_len’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 #define MIN(a, b)  (((a) < (b)) ? (a) : (b))
                                       ^
qemu/slirp/socket.c:253:15: note: ‘iov.iov_len’ was declared here
  struct iovec iov[2];
               ^
qemu/slirp/socket.c: In function ‘sorecvoob’:
qemu/slirp/socket.c:232:5: warning: ‘n’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  if (n == 2 && nn == iov[0].iov_len) {
     ^
qemu/slirp/socket.c:175:6: note: ‘n’ was declared here
  int n, nn;
      ^
qemu/gdbstub.c: In function ‘gdb_handle_packet’:
qemu/gdbstub.c:1655:17: warning: ‘tid’ may be used uninitialized in this function [-Wmaybe-uninitialized]
             cpu = gdb_get_cpu(s, pid, tid);
                 ^
qemu/gdbstub.c:1655:17: warning: ‘pid’ may be used uninitialized in this function [-Wmaybe-uninitialized]
qemu/target/arm/translate-a64.c: In function ‘disas_simd_two_reg_misc_fp16’:
qemu/target/arm/translate-a64.c:12529:34: warning: ‘rmode’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         tcg_rmode = tcg_const_i32(arm_rmode_to_sf(rmode));
                                  ^

IIRC, most of the time, GCC is just wrong, so I really
doubt that it is worth the effort to fix all of them ...

 Thomas

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2019-02-26 12:23 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-23  0:35 [Qemu-devel] Build error with git commit 8eb29f1bf5a974dc4c11d2d1f5e7c7f7a62be116 on x86_64 Andrew Randrianasulu
2019-02-25 14:13 ` Eric Blake
2019-02-25 16:19 ` Philippe Mathieu-Daudé
2019-02-25 17:29   ` Andrew Randrianasulu
2019-02-26  8:54     ` Thomas Huth
2019-02-26  8:58       ` Andrew Randrianasulu
2019-02-26  9:05         ` Thomas Huth
2019-02-26  9:46           ` Andrew Randrianasulu
2019-02-26  9:58             ` Thomas Huth
2019-02-26 10:44               ` Andrew Randrianasulu
2019-02-26 11:05           ` Peter Maydell
2019-02-26 12:16             ` Thomas Huth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.