[PULL 00/32] virtio,pc: features, cleanups, fixes

Michael S. Tsirkin posted 32 patches 4 years ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20220205014149.1189026-1-mst@redhat.com
Maintainers: Raphael Norwitz <raphael.norwitz@nutanix.com>, Markus Armbruster <armbru@redhat.com>, David Hildenbrand <david@redhat.com>, "Dr. David Alan Gilbert" <dgilbert@redhat.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Stefan Hajnoczi <stefanha@redhat.com>, Jason Wang <jasowang@redhat.com>, Eric Blake <eblake@redhat.com>, Mathieu Poirier <mathieu.poirier@linaro.org>, Greg Kurz <groug@kaod.org>, Hanna Reitz <hreitz@redhat.com>, Fam Zheng <fam@euphon.net>, Eduardo Habkost <eduardo@habkost.net>, "Gonglei (Arei)" <arei.gonglei@huawei.com>, Michael Roth <michael.roth@amd.com>, Amit Shah <amit@kernel.org>, Laurent Vivier <lvivier@redhat.com>, Igor Mammedov <imammedo@redhat.com>, Thomas Huth <thuth@redhat.com>, Eric Auger <eric.auger@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Gerd Hoffmann <kraxel@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Ani Sinha <ani@anisinha.ca>, Kevin Wolf <kwolf@redhat.com>, Christian Schoenebeck <qemu_oss@crudebyte.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>
There is a newer version of this series
configure                                 |    2 +-
qapi/qapi-schema.json                     |    1 +
qapi/virtio.json                          |  841 +++++++++++++++++++++++
include/hw/acpi/erst.h                    |   24 +
include/hw/pci/pci.h                      |    1 +
include/hw/virtio/vhost-vsock-common.h    |    2 +-
include/hw/virtio/vhost.h                 |    3 +
include/hw/virtio/virtio-gpu.h            |    3 +-
include/hw/virtio/virtio.h                |   26 +-
include/monitor/hmp.h                     |    5 +
subprojects/libvhost-user/libvhost-user.h |    2 +
hw/9pfs/virtio-9p-device.c                |    2 +-
hw/acpi/aml-build.c                       |    4 +-
hw/acpi/erst.c                            | 1055 +++++++++++++++++++++++++++++
hw/block/vhost-user-blk.c                 |    9 +-
hw/block/virtio-blk.c                     |   31 +-
hw/char/virtio-serial-bus.c               |   14 +-
hw/display/vhost-user-gpu.c               |    7 +
hw/display/virtio-gpu-base.c              |   20 +-
hw/i386/acpi-build.c                      |   15 +
hw/i386/acpi-microvm.c                    |   15 +
hw/i386/pc_piix.c                         |    5 +-
hw/input/vhost-user-input.c               |    7 +
hw/input/virtio-input.c                   |   13 +-
hw/net/virtio-net.c                       |   58 +-
hw/scsi/vhost-scsi.c                      |    8 +
hw/scsi/virtio-scsi.c                     |   20 +-
hw/virtio/vhost-user-fs.c                 |   20 +-
hw/virtio/vhost-user-i2c.c                |    7 +-
hw/virtio/vhost-user-rng.c                |    9 +-
hw/virtio/vhost-user-vsock.c              |    2 +-
hw/virtio/vhost-vsock-common.c            |   22 +-
hw/virtio/vhost-vsock.c                   |    2 +-
hw/virtio/vhost.c                         |    4 +-
hw/virtio/virtio-balloon.c                |   17 +-
hw/virtio/virtio-crypto.c                 |   22 +-
hw/virtio/virtio-iommu.c                  |   17 +-
hw/virtio/virtio-mem.c                    |   14 +-
hw/virtio/virtio-pmem.c                   |    3 +-
hw/virtio/virtio-rng.c                    |    2 +-
hw/virtio/virtio-stub.c                   |   42 ++
hw/virtio/virtio.c                        |  742 +++++++++++++++++++-
monitor/hmp-cmds.c                        |  311 +++++++++
subprojects/libvhost-user/libvhost-user.c |   86 ++-
tests/qtest/bios-tables-test.c            |   65 +-
tests/qtest/cdrom-test.c                  |    2 +-
tests/qtest/erst-test.c                   |  172 +++++
tests/qtest/qmp-cmd-test.c                |    1 +
util/bufferiszero.c                       |    2 +-
util/oslib-posix.c                        |    1 +
hmp-commands-info.hx                      |   70 ++
hw/acpi/Kconfig                           |    6 +
hw/acpi/meson.build                       |    1 +
hw/acpi/trace-events                      |   15 +
hw/virtio/meson.build                     |    2 +
qapi/meson.build                          |    1 +
tcg/i386/tcg-target.c.inc                 |    2 +-
tests/data/acpi/microvm/ERST.pcie         |  Bin 0 -> 912 bytes
tests/data/acpi/pc/DSDT.acpierst          |  Bin 0 -> 5969 bytes
tests/data/acpi/pc/ERST.acpierst          |  Bin 0 -> 912 bytes
tests/data/acpi/pc/SSDT.dimmpxm           |  Bin 734 -> 734 bytes
tests/data/acpi/q35/DSDT.acpierst         |  Bin 0 -> 8306 bytes
tests/data/acpi/q35/ERST.acpierst         |  Bin 0 -> 912 bytes
tests/data/acpi/q35/FACP.slic             |  Bin 244 -> 244 bytes
tests/data/acpi/q35/SSDT.dimmpxm          |  Bin 734 -> 734 bytes
tests/data/acpi/virt/SSDT.memhp           |  Bin 736 -> 736 bytes
tests/qtest/meson.build                   |    2 +
67 files changed, 3776 insertions(+), 81 deletions(-)
create mode 100644 qapi/virtio.json
create mode 100644 include/hw/acpi/erst.h
create mode 100644 hw/acpi/erst.c
create mode 100644 hw/virtio/virtio-stub.c
create mode 100644 tests/qtest/erst-test.c
create mode 100644 tests/data/acpi/microvm/ERST.pcie
create mode 100644 tests/data/acpi/pc/DSDT.acpierst
create mode 100644 tests/data/acpi/pc/ERST.acpierst
create mode 100644 tests/data/acpi/q35/DSDT.acpierst
create mode 100644 tests/data/acpi/q35/ERST.acpierst
[PULL 00/32] virtio,pc: features, cleanups, fixes
Posted by Michael S. Tsirkin 4 years ago
The following changes since commit 8f3e5ce773c62bb5c4a847f3a9a5c98bbb3b359f:

  Merge remote-tracking branch 'remotes/hdeller/tags/hppa-updates-pull-request' into staging (2022-02-02 19:54:30 +0000)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream

for you to fetch changes up to 593a84174b09f0c8ae4d35ad014f93d1fb7cac00:

  util/oslib-posix: Fix missing unlock in the error path of os_mem_prealloc() (2022-02-04 20:16:59 -0500)

----------------------------------------------------------------
virtio,pc: features, cleanups, fixes

virtio introspection commands
Part of ACPI ERST support
fixes, cleanups

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

----------------------------------------------------------------
David Hildenbrand (4):
      libvhost-user: Simplify VHOST_USER_REM_MEM_REG
      libvhost-user: fix VHOST_USER_REM_MEM_REG not closing the fd
      libvhost-user: Map shared RAM with MAP_NORESERVE to support virtio-mem with hugetlb
      util/oslib-posix: Fix missing unlock in the error path of os_mem_prealloc()

Eric DeVolder (9):
      ACPI ERST: bios-tables-test.c steps 1 and 2
      ACPI ERST: PCI device_id for ERST
      ACPI ERST: header file for ERST
      ACPI ERST: support for ACPI ERST feature
      ACPI ERST: build the ACPI ERST table
      ACPI ERST: create ACPI ERST table for pc/x86 machines
      ACPI ERST: qtest for ERST
      ACPI ERST: bios-tables-test testcase
      ACPI ERST: step 6 of bios-tables-test.c

Igor Mammedov (5):
      tests: acpi: manually pad OEM_ID/OEM_TABLE_ID for test_oem_fields() test
      tests: acpi: whitelist nvdimm's SSDT and FACP.slic expected blobs
      acpi: fix OEM ID/OEM Table ID padding
      tests: acpi: update expected blobs
      tests: acpi: test short OEM_ID/OEM_TABLE_ID values in test_oem_fields()

Jonah Palmer (2):
      virtio: drop name parameter for virtio_init()
      virtio: add vhost support for virtio devices

Laurent Vivier (6):
      qmp: add QMP command x-query-virtio
      qmp: add QMP command x-query-virtio-status
      qmp: decode feature & status bits in virtio-status
      qmp: add QMP commands for virtio/vhost queue-status
      qmp: add QMP command x-query-virtio-queue-element
      hmp: add virtio commands

Michael S. Tsirkin (1):
      cpuid: use unsigned for max cpuid

Raphael Norwitz (4):
      libvhost-user: Add vu_rem_mem_reg input validation
      libvhost-user: Add vu_add_mem_reg input validation
      libvhost-user: prevent over-running max RAM slots
      libvhost-user: handle removal of identical regions

Thomas Huth (1):
      hw/i386: Add the possibility to disable the 'isapc' machine

 configure                                 |    2 +-
 qapi/qapi-schema.json                     |    1 +
 qapi/virtio.json                          |  841 +++++++++++++++++++++++
 include/hw/acpi/erst.h                    |   24 +
 include/hw/pci/pci.h                      |    1 +
 include/hw/virtio/vhost-vsock-common.h    |    2 +-
 include/hw/virtio/vhost.h                 |    3 +
 include/hw/virtio/virtio-gpu.h            |    3 +-
 include/hw/virtio/virtio.h                |   26 +-
 include/monitor/hmp.h                     |    5 +
 subprojects/libvhost-user/libvhost-user.h |    2 +
 hw/9pfs/virtio-9p-device.c                |    2 +-
 hw/acpi/aml-build.c                       |    4 +-
 hw/acpi/erst.c                            | 1055 +++++++++++++++++++++++++++++
 hw/block/vhost-user-blk.c                 |    9 +-
 hw/block/virtio-blk.c                     |   31 +-
 hw/char/virtio-serial-bus.c               |   14 +-
 hw/display/vhost-user-gpu.c               |    7 +
 hw/display/virtio-gpu-base.c              |   20 +-
 hw/i386/acpi-build.c                      |   15 +
 hw/i386/acpi-microvm.c                    |   15 +
 hw/i386/pc_piix.c                         |    5 +-
 hw/input/vhost-user-input.c               |    7 +
 hw/input/virtio-input.c                   |   13 +-
 hw/net/virtio-net.c                       |   58 +-
 hw/scsi/vhost-scsi.c                      |    8 +
 hw/scsi/virtio-scsi.c                     |   20 +-
 hw/virtio/vhost-user-fs.c                 |   20 +-
 hw/virtio/vhost-user-i2c.c                |    7 +-
 hw/virtio/vhost-user-rng.c                |    9 +-
 hw/virtio/vhost-user-vsock.c              |    2 +-
 hw/virtio/vhost-vsock-common.c            |   22 +-
 hw/virtio/vhost-vsock.c                   |    2 +-
 hw/virtio/vhost.c                         |    4 +-
 hw/virtio/virtio-balloon.c                |   17 +-
 hw/virtio/virtio-crypto.c                 |   22 +-
 hw/virtio/virtio-iommu.c                  |   17 +-
 hw/virtio/virtio-mem.c                    |   14 +-
 hw/virtio/virtio-pmem.c                   |    3 +-
 hw/virtio/virtio-rng.c                    |    2 +-
 hw/virtio/virtio-stub.c                   |   42 ++
 hw/virtio/virtio.c                        |  742 +++++++++++++++++++-
 monitor/hmp-cmds.c                        |  311 +++++++++
 subprojects/libvhost-user/libvhost-user.c |   86 ++-
 tests/qtest/bios-tables-test.c            |   65 +-
 tests/qtest/cdrom-test.c                  |    2 +-
 tests/qtest/erst-test.c                   |  172 +++++
 tests/qtest/qmp-cmd-test.c                |    1 +
 util/bufferiszero.c                       |    2 +-
 util/oslib-posix.c                        |    1 +
 hmp-commands-info.hx                      |   70 ++
 hw/acpi/Kconfig                           |    6 +
 hw/acpi/meson.build                       |    1 +
 hw/acpi/trace-events                      |   15 +
 hw/virtio/meson.build                     |    2 +
 qapi/meson.build                          |    1 +
 tcg/i386/tcg-target.c.inc                 |    2 +-
 tests/data/acpi/microvm/ERST.pcie         |  Bin 0 -> 912 bytes
 tests/data/acpi/pc/DSDT.acpierst          |  Bin 0 -> 5969 bytes
 tests/data/acpi/pc/ERST.acpierst          |  Bin 0 -> 912 bytes
 tests/data/acpi/pc/SSDT.dimmpxm           |  Bin 734 -> 734 bytes
 tests/data/acpi/q35/DSDT.acpierst         |  Bin 0 -> 8306 bytes
 tests/data/acpi/q35/ERST.acpierst         |  Bin 0 -> 912 bytes
 tests/data/acpi/q35/FACP.slic             |  Bin 244 -> 244 bytes
 tests/data/acpi/q35/SSDT.dimmpxm          |  Bin 734 -> 734 bytes
 tests/data/acpi/virt/SSDT.memhp           |  Bin 736 -> 736 bytes
 tests/qtest/meson.build                   |    2 +
 67 files changed, 3776 insertions(+), 81 deletions(-)
 create mode 100644 qapi/virtio.json
 create mode 100644 include/hw/acpi/erst.h
 create mode 100644 hw/acpi/erst.c
 create mode 100644 hw/virtio/virtio-stub.c
 create mode 100644 tests/qtest/erst-test.c
 create mode 100644 tests/data/acpi/microvm/ERST.pcie
 create mode 100644 tests/data/acpi/pc/DSDT.acpierst
 create mode 100644 tests/data/acpi/pc/ERST.acpierst
 create mode 100644 tests/data/acpi/q35/DSDT.acpierst
 create mode 100644 tests/data/acpi/q35/ERST.acpierst


Re: [PULL 00/32] virtio,pc: features, cleanups, fixes
Posted by Peter Maydell 4 years ago
On Sat, 5 Feb 2022 at 01:42, Michael S. Tsirkin <mst@redhat.com> wrote:
>
> The following changes since commit 8f3e5ce773c62bb5c4a847f3a9a5c98bbb3b359f:
>
>   Merge remote-tracking branch 'remotes/hdeller/tags/hppa-updates-pull-request' into staging (2022-02-02 19:54:30 +0000)
>
> are available in the Git repository at:
>
>   git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
>
> for you to fetch changes up to 593a84174b09f0c8ae4d35ad014f93d1fb7cac00:
>
>   util/oslib-posix: Fix missing unlock in the error path of os_mem_prealloc() (2022-02-04 20:16:59 -0500)
>
> ----------------------------------------------------------------
> virtio,pc: features, cleanups, fixes
>
> virtio introspection commands
> Part of ACPI ERST support
> fixes, cleanups
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

Fails to compile for 32-bit, Windows and macos because of format
string issues in hmp-cmds.c. Here's a sample job with the errors:

https://gitlab.com/qemu-project/qemu/-/jobs/2058116754

thanks
-- PMM

Re: [PULL 00/32] virtio,pc: features, cleanups, fixes
Posted by Michael S. Tsirkin 4 years ago
On Sat, Feb 05, 2022 at 11:07:33AM +0000, Peter Maydell wrote:
> On Sat, 5 Feb 2022 at 01:42, Michael S. Tsirkin <mst@redhat.com> wrote:
> >
> > The following changes since commit 8f3e5ce773c62bb5c4a847f3a9a5c98bbb3b359f:
> >
> >   Merge remote-tracking branch 'remotes/hdeller/tags/hppa-updates-pull-request' into staging (2022-02-02 19:54:30 +0000)
> >
> > are available in the Git repository at:
> >
> >   git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
> >
> > for you to fetch changes up to 593a84174b09f0c8ae4d35ad014f93d1fb7cac00:
> >
> >   util/oslib-posix: Fix missing unlock in the error path of os_mem_prealloc() (2022-02-04 20:16:59 -0500)
> >
> > ----------------------------------------------------------------
> > virtio,pc: features, cleanups, fixes
> >
> > virtio introspection commands
> > Part of ACPI ERST support
> > fixes, cleanups
> >
> > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> 
> Fails to compile for 32-bit, Windows and macos because of format
> string issues in hmp-cmds.c. Here's a sample job with the errors:
> 
> https://gitlab.com/qemu-project/qemu/-/jobs/2058116754
> 
> thanks
> -- PMM

Just re-pushed with a fixup patch. Can you try again pls?

-- 
MST


Re: [PULL 00/32] virtio,pc: features, cleanups, fixes
Posted by Peter Maydell 4 years ago
On Sat, 5 Feb 2022 at 12:25, Michael S. Tsirkin <mst@redhat.com> wrote:
>
> On Sat, Feb 05, 2022 at 11:07:33AM +0000, Peter Maydell wrote:
> > On Sat, 5 Feb 2022 at 01:42, Michael S. Tsirkin <mst@redhat.com> wrote:
> > >
> > > The following changes since commit 8f3e5ce773c62bb5c4a847f3a9a5c98bbb3b359f:
> > >
> > >   Merge remote-tracking branch 'remotes/hdeller/tags/hppa-updates-pull-request' into staging (2022-02-02 19:54:30 +0000)
> > >
> > > are available in the Git repository at:
> > >
> > >   git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
> > >
> > > for you to fetch changes up to 593a84174b09f0c8ae4d35ad014f93d1fb7cac00:
> > >
> > >   util/oslib-posix: Fix missing unlock in the error path of os_mem_prealloc() (2022-02-04 20:16:59 -0500)
> > >
> > > ----------------------------------------------------------------
> > > virtio,pc: features, cleanups, fixes
> > >
> > > virtio introspection commands
> > > Part of ACPI ERST support
> > > fixes, cleanups
> > >
> > > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> >
> > Fails to compile for 32-bit, Windows and macos because of format
> > string issues in hmp-cmds.c. Here's a sample job with the errors:
> >
> > https://gitlab.com/qemu-project/qemu/-/jobs/2058116754593a84174b0

> Just re-pushed with a fixup patch. Can you try again pls?

Tag still seems to be pointing at 593a84174b0 ?

-- PMM

Re: [PULL 00/32] virtio,pc: features, cleanups, fixes
Posted by Michael S. Tsirkin 4 years ago
On Sat, Feb 05, 2022 at 01:31:17PM +0000, Peter Maydell wrote:
> On Sat, 5 Feb 2022 at 12:25, Michael S. Tsirkin <mst@redhat.com> wrote:
> >
> > On Sat, Feb 05, 2022 at 11:07:33AM +0000, Peter Maydell wrote:
> > > On Sat, 5 Feb 2022 at 01:42, Michael S. Tsirkin <mst@redhat.com> wrote:
> > > >
> > > > The following changes since commit 8f3e5ce773c62bb5c4a847f3a9a5c98bbb3b359f:
> > > >
> > > >   Merge remote-tracking branch 'remotes/hdeller/tags/hppa-updates-pull-request' into staging (2022-02-02 19:54:30 +0000)
> > > >
> > > > are available in the Git repository at:
> > > >
> > > >   git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
> > > >
> > > > for you to fetch changes up to 593a84174b09f0c8ae4d35ad014f93d1fb7cac00:
> > > >
> > > >   util/oslib-posix: Fix missing unlock in the error path of os_mem_prealloc() (2022-02-04 20:16:59 -0500)
> > > >
> > > > ----------------------------------------------------------------
> > > > virtio,pc: features, cleanups, fixes
> > > >
> > > > virtio introspection commands
> > > > Part of ACPI ERST support
> > > > fixes, cleanups
> > > >
> > > > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> > >
> > > Fails to compile for 32-bit, Windows and macos because of format
> > > string issues in hmp-cmds.c. Here's a sample job with the errors:
> > >
> > > https://gitlab.com/qemu-project/qemu/-/jobs/2058116754593a84174b0
> 
> > Just re-pushed with a fixup patch. Can you try again pls?
> 
> Tag still seems to be pointing at 593a84174b0 ?
> 
> -- PMM

my bad. pushed a the tag now.


Re: [PULL 00/32] virtio,pc: features, cleanups, fixes
Posted by Peter Maydell 4 years ago
On Sat, 5 Feb 2022 at 17:42, Michael S. Tsirkin <mst@redhat.com> wrote:
>
> On Sat, Feb 05, 2022 at 01:31:17PM +0000, Peter Maydell wrote:
> > On Sat, 5 Feb 2022 at 12:25, Michael S. Tsirkin <mst@redhat.com> wrote:
> > >
> > > On Sat, Feb 05, 2022 at 11:07:33AM +0000, Peter Maydell wrote:
> > > > Fails to compile for 32-bit, Windows and macos because of format
> > > > string issues in hmp-cmds.c. Here's a sample job with the errors:
> > > >
> > > > https://gitlab.com/qemu-project/qemu/-/jobs/2058116754593a84174b0
> >
> > > Just re-pushed with a fixup patch. Can you try again pls?
> >
> > Tag still seems to be pointing at 593a84174b0 ?

>
> my bad. pushed a the tag now.

Please can you squash fixes into the offending commits rather than
adding a fixup patch at the end? Otherwise it breaks bisection.

There are also further build failures. On Windows:
https://gitlab.com/qemu-project/qemu/-/jobs/2058536550

In file included from ../hw/acpi/erst.c:16:
/builds/qemu-project/qemu/include/qemu/osdep.h:76: error:
"__USE_MINGW_ANSI_STDIO" redefined [-Werror]
76 | #define __USE_MINGW_ANSI_STDIO 1
|
In file included from /usr/i686-w64-mingw32/sys-root/mingw/include/corecrt.h:10,
from /usr/i686-w64-mingw32/sys-root/mingw/include/crtdefs.h:10,
from /usr/i686-w64-mingw32/sys-root/mingw/include/sys/types.h:13,
from ../hw/acpi/erst.c:12:
/usr/i686-w64-mingw32/sys-root/mingw/include/_mingw.h:435: note: this
is the location of the previous definition
435 | #define __USE_MINGW_ANSI_STDIO 0 /* was not defined so it should be 0 */
|

This is because erst.c is incorrectly including other header files
before osdep.h.

On msys2, some dubious casting:

https://gitlab.com/qemu-project/qemu/-/jobs/2058536622

../hw/virtio/virtio.c: In function 'qmp_x_query_virtio_vhost_queue_status':
../hw/virtio/virtio.c:4358:30: error: cast from pointer to integer of
different size [-Werror=pointer-to-int-cast]
4358 | status->desc = (uint64_t)(unsigned long)hdev->vqs[queue].desc;
| ^
../hw/virtio/virtio.c:4359:31: error: cast from pointer to integer of
different size [-Werror=pointer-to-int-cast]
4359 | status->avail = (uint64_t)(unsigned long)hdev->vqs[queue].avail;
| ^
../hw/virtio/virtio.c:4360:30: error: cast from pointer to integer of
different size [-Werror=pointer-to-int-cast]
4360 | status->used = (uint64_t)(unsigned long)hdev->vqs[queue].used;
| ^
cc1.exe: all warnings being treated as errors

On the build-tsan and build-cfi-x86_64 jobs and also on macos
(this is a "clang is pickier than gcc about unused functions" one):
https://gitlab.com/qemu-project/qemu/-/jobs/2058536617
https://gitlab.com/qemu-project/qemu/-/jobs/2058536571

../tests/qtest/erst-test.c:91:20: error: unused function 'out_reg64'
[-Werror,-Wunused-function]
static inline void out_reg64(ERSTState *s, unsigned reg, uint64_t v)
^

On build-system-centos, a link failure:
https://gitlab.com/qemu-project/qemu/-/jobs/2058536558

libqemu-ppc64-softmmu.fa.p/hw_virtio_virtio.c.o: In function
`qmp_decode_features':
/builds/qemu-project/qemu/build/../hw/virtio/virtio.c:4155: undefined
reference to `gpu_map'
/builds/qemu-project/qemu/build/../hw/virtio/virtio.c:4155: undefined
reference to `gpu_map'
collect2: error: ld returned 1 exit status

thanks
-- PMM

Re: [PULL 00/32] virtio,pc: features, cleanups, fixes
Posted by Michael S. Tsirkin 4 years ago
On Sat, Feb 05, 2022 at 09:05:12PM +0000, Peter Maydell wrote:
> On the build-tsan and build-cfi-x86_64 jobs and also on macos
> (this is a "clang is pickier than gcc about unused functions" one):
> https://gitlab.com/qemu-project/qemu/-/jobs/2058536617
> https://gitlab.com/qemu-project/qemu/-/jobs/2058536571
> 
> ../tests/qtest/erst-test.c:91:20: error: unused function 'out_reg64'
> [-Werror,-Wunused-function]
> static inline void out_reg64(ERSTState *s, unsigned reg, uint64_t v)
> ^


That's a weird one - it's static inline, compiler should not warn I
think. compiler bug? I can drop this for sure but still. Is this
what we should be doing?

-- 
MST


Re: [PULL 00/32] virtio,pc: features, cleanups, fixes
Posted by Peter Maydell 4 years ago
On Sun, 6 Feb 2022 at 09:29, Michael S. Tsirkin <mst@redhat.com> wrote:
>
> On Sat, Feb 05, 2022 at 09:05:12PM +0000, Peter Maydell wrote:
> > On the build-tsan and build-cfi-x86_64 jobs and also on macos
> > (this is a "clang is pickier than gcc about unused functions" one):
> > https://gitlab.com/qemu-project/qemu/-/jobs/2058536617
> > https://gitlab.com/qemu-project/qemu/-/jobs/2058536571
> >
> > ../tests/qtest/erst-test.c:91:20: error: unused function 'out_reg64'
> > [-Werror,-Wunused-function]
> > static inline void out_reg64(ERSTState *s, unsigned reg, uint64_t v)
> > ^
>
>
> That's a weird one - it's static inline, compiler should not warn I
> think. compiler bug? I can drop this for sure but still. Is this
> what we should be doing?

This is a gcc-vs-clang difference. gcc will not warn about any
unused "static inline" function. clang will not warn for them
in .h files but will warn for them in .c files.

In this case clang is entirely correct -- the function is defined
and never used, not even conditionally depending on #ifdefs.

thanks
-- PMM

Re: [PULL 00/32] virtio,pc: features, cleanups, fixes
Posted by Michael S. Tsirkin 4 years ago
On Sun, Feb 06, 2022 at 10:44:47AM +0000, Peter Maydell wrote:
> On Sun, 6 Feb 2022 at 09:29, Michael S. Tsirkin <mst@redhat.com> wrote:
> >
> > On Sat, Feb 05, 2022 at 09:05:12PM +0000, Peter Maydell wrote:
> > > On the build-tsan and build-cfi-x86_64 jobs and also on macos
> > > (this is a "clang is pickier than gcc about unused functions" one):
> > > https://gitlab.com/qemu-project/qemu/-/jobs/2058536617
> > > https://gitlab.com/qemu-project/qemu/-/jobs/2058536571
> > >
> > > ../tests/qtest/erst-test.c:91:20: error: unused function 'out_reg64'
> > > [-Werror,-Wunused-function]
> > > static inline void out_reg64(ERSTState *s, unsigned reg, uint64_t v)
> > > ^
> >
> >
> > That's a weird one - it's static inline, compiler should not warn I
> > think. compiler bug? I can drop this for sure but still. Is this
> > what we should be doing?
> 
> This is a gcc-vs-clang difference. gcc will not warn about any
> unused "static inline" function. clang will not warn for them
> in .h files but will warn for them in .c files.
> 
> In this case clang is entirely correct -- the function is defined
> and never used, not even conditionally depending on #ifdefs.
> 
> thanks
> -- PMM

I fixed it in pull v2, pls let me know.

-- 
MST