qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kurz <groug@kaod.org>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>
Cc: "Elena Ufimtseva" <elena.ufimtseva@oracle.com>,
	"Fam Zheng" <fam@euphon.net>, "Thomas Huth" <thuth@redhat.com>,
	"Jagannathan Raman" <jag.raman@oracle.com>,
	qemu-block@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>,
	"Stefan Hajnoczi" <stefanha@gmail.com>,
	"Jason Wang" <jasowang@redhat.com>,
	"Cornelia Huck" <cohuck@redhat.com>,
	"Christian Schoenebeck" <qemu_oss@crudebyte.com>,
	qemu-devel@nongnu.org,
	"Wainer dos Santos Moschetta" <wainersm@redhat.com>,
	"Max Reitz" <mreitz@redhat.com>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Kevin Wolf" <kwolf@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>
Subject: Re: [PATCH-for-6.0 2/3] hw/virtio: Build most of virtio devices as arch-independent objects
Date: Thu, 5 Nov 2020 15:33:46 +0100	[thread overview]
Message-ID: <20201105153346.11586e80@bahia.lan> (raw)
In-Reply-To: <20201105124353.3680057-3-philmd@redhat.com>

On Thu,  5 Nov 2020 13:43:52 +0100
Philippe Mathieu-Daudé <philmd@redhat.com> wrote:

> VirtIO devices shouldn't be arch-specific. Some device have to
> use PAGE_SIZE definition or access to CPUState. Keep building
> them as arch-specific objects. Move all we can to libcommon.fa.
> 

This patch breaks build:

$ ./configure && make
...

[890/2578] Compiling C object libcommon.fa.p/hw_virtio_virtio-mem.c.o
FAILED: libcommon.fa.p/hw_virtio_virtio-mem.c.o 
cc -Ilibcommon.fa.p -I. -I.. -I../slirp -I../slirp/src -Iqapi -Itrace -Iui -Iui/shader -I/usr/include/SDL2 -I/usr/include/pixman-1 -I/usr/include/libpng16 -I/usr/include/capstone -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -fdiagnostics-color=auto -pipe -Wall -Winvalid-pch -Werror -std=gnu99 -O2 -g -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -m64 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -Wold-style-declaration -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-psabi -fstack-protector-strong -isystem /var/tmp/qemu/linux-headers -isystem linux-headers -iquote /var/tmp/qemu/tcg/i386 -iquote . -iquote /var/tmp/qemu -iquote /var/tmp/qemu/accel/tcg -iquote /var/tmp/qemu/include -iquote /var/tmp/qemu/disas/libvixl -pthread -fPIC -D_REENTRANT -Wno-undef -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -DNCURSES_WIDECHAR -MD -MQ libcommon.fa.p/hw_virtio_virtio-mem.c.o -MF libcommon.fa.p/hw_virtio_virtio-mem.c.o.d -o libcommon.fa.p/hw_virtio_virtio-mem.c.o -c ../hw/virtio/virtio-mem.c
In file included from ../hw/virtio/virtio-mem.c:28:
/var/tmp/qemu/include/exec/ram_addr.h:23:10: fatal error: cpu.h: No such file or directory
   23 | #include "cpu.h"
      |          ^~~~~~~
compilation terminated.

Unless I'm missing something legacy devices require to be built according
to the target because of the endianess.

> Suggested-by: Stefan Hajnoczi <stefanha@gmail.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  hw/9pfs/meson.build            |  2 +-
>  hw/block/dataplane/meson.build |  2 +-
>  hw/block/meson.build           |  2 +-
>  hw/char/meson.build            |  2 +-
>  hw/net/meson.build             |  2 +-
>  hw/scsi/meson.build            |  2 +-
>  hw/virtio/meson.build          | 15 +++++++++------
>  7 files changed, 15 insertions(+), 12 deletions(-)
> 
> diff --git a/hw/9pfs/meson.build b/hw/9pfs/meson.build
> index cc094262122..ac964be15ce 100644
> --- a/hw/9pfs/meson.build
> +++ b/hw/9pfs/meson.build
> @@ -17,4 +17,4 @@
>  fs_ss.add(when: 'CONFIG_XEN', if_true: files('xen-9p-backend.c'))
>  softmmu_ss.add_all(when: 'CONFIG_9PFS', if_true: fs_ss)
>  
> -specific_ss.add(when: 'CONFIG_VIRTIO_9P', if_true: files('virtio-9p-device.c'))
> +softmmu_ss.add(when: 'CONFIG_VIRTIO_9P', if_true: files('virtio-9p-device.c'))
> diff --git a/hw/block/dataplane/meson.build b/hw/block/dataplane/meson.build
> index 12c6a264f10..e2f3721ce24 100644
> --- a/hw/block/dataplane/meson.build
> +++ b/hw/block/dataplane/meson.build
> @@ -1,2 +1,2 @@
> -specific_ss.add(when: 'CONFIG_VIRTIO_BLK', if_true: files('virtio-blk.c'))
> +softmmu_ss.add(when: 'CONFIG_VIRTIO_BLK', if_true: files('virtio-blk.c'))
>  specific_ss.add(when: 'CONFIG_XEN', if_true: files('xen-block.c'))
> diff --git a/hw/block/meson.build b/hw/block/meson.build
> index 602ca6c8541..497592c33ac 100644
> --- a/hw/block/meson.build
> +++ b/hw/block/meson.build
> @@ -15,7 +15,7 @@
>  softmmu_ss.add(when: 'CONFIG_SH4', if_true: files('tc58128.c'))
>  softmmu_ss.add(when: 'CONFIG_NVME_PCI', if_true: files('nvme.c', 'nvme-ns.c'))
>  
> -specific_ss.add(when: 'CONFIG_VIRTIO_BLK', if_true: files('virtio-blk.c'))
> +softmmu_ss.add(when: 'CONFIG_VIRTIO_BLK', if_true: files('virtio-blk.c'))
>  specific_ss.add(when: 'CONFIG_VHOST_USER_BLK', if_true: files('vhost-user-blk.c'))
>  
>  subdir('dataplane')
> diff --git a/hw/char/meson.build b/hw/char/meson.build
> index 196ac91fa29..7496594ea07 100644
> --- a/hw/char/meson.build
> +++ b/hw/char/meson.build
> @@ -37,5 +37,5 @@
>  
>  specific_ss.add(when: 'CONFIG_HTIF', if_true: files('riscv_htif.c'))
>  specific_ss.add(when: 'CONFIG_TERMINAL3270', if_true: files('terminal3270.c'))
> -specific_ss.add(when: 'CONFIG_VIRTIO', if_true: files('virtio-serial-bus.c'))
> +softmmu_ss.add(when: 'CONFIG_VIRTIO', if_true: files('virtio-serial-bus.c'))
>  specific_ss.add(when: 'CONFIG_PSERIES', if_true: files('spapr_vty.c'))
> diff --git a/hw/net/meson.build b/hw/net/meson.build
> index 4a7051b54a0..c795af23eee 100644
> --- a/hw/net/meson.build
> +++ b/hw/net/meson.build
> @@ -43,7 +43,7 @@
>  specific_ss.add(when: 'CONFIG_XILINX_ETHLITE', if_true: files('xilinx_ethlite.c'))
>  
>  softmmu_ss.add(when: 'CONFIG_VIRTIO_NET', if_true: files('net_rx_pkt.c'))
> -specific_ss.add(when: 'CONFIG_VIRTIO_NET', if_true: files('virtio-net.c'))
> +softmmu_ss.add(when: 'CONFIG_VIRTIO_NET', if_true: files('virtio-net.c'))
>  
>  softmmu_ss.add(when: ['CONFIG_VIRTIO_NET', 'CONFIG_VHOST_NET'], if_true: files('vhost_net.c'), if_false: files('vhost_net-stub.c'))
>  softmmu_ss.add(when: 'CONFIG_ALL', if_true: files('vhost_net-stub.c'))
> diff --git a/hw/scsi/meson.build b/hw/scsi/meson.build
> index 923a34f344c..fdf27156f6a 100644
> --- a/hw/scsi/meson.build
> +++ b/hw/scsi/meson.build
> @@ -19,7 +19,7 @@
>  virtio_scsi_ss.add(files('virtio-scsi.c', 'virtio-scsi-dataplane.c'))
>  virtio_scsi_ss.add(when: 'CONFIG_VHOST_SCSI', if_true: files('vhost-scsi-common.c', 'vhost-scsi.c'))
>  virtio_scsi_ss.add(when: 'CONFIG_VHOST_USER_SCSI', if_true: files('vhost-scsi-common.c', 'vhost-user-scsi.c'))
> -specific_scsi_ss.add_all(when: 'CONFIG_VIRTIO_SCSI', if_true: virtio_scsi_ss)
> +softmmu_ss.add_all(when: 'CONFIG_VIRTIO_SCSI', if_true: virtio_scsi_ss)
>  
>  specific_scsi_ss.add(when: 'CONFIG_SPAPR_VSCSI', if_true: files('spapr_vscsi.c'))
>  
> diff --git a/hw/virtio/meson.build b/hw/virtio/meson.build
> index 95415913a9a..40df99f1a48 100644
> --- a/hw/virtio/meson.build
> +++ b/hw/virtio/meson.build
> @@ -9,12 +9,15 @@
>  
>  softmmu_ss.add(when: 'CONFIG_ALL', if_true: files('vhost-stub.c'))
>  
> +virtio_arch_ss = ss.source_set()
> +virtio_arch_ss.add(files('virtio.c'))
> +virtio_arch_ss.add(when: 'CONFIG_VIRTIO_LEGACY', if_true: files('virtio-legacy.c'))
> +virtio_arch_ss.add(when: 'CONFIG_VHOST_USER', if_true: files('vhost-user.c'))
> +virtio_arch_ss.add(when: 'CONFIG_VHOST_VDPA', if_true: files('vhost-vdpa.c'))
> +virtio_arch_ss.add(when: 'CONFIG_VIRTIO_IOMMU', if_true: files('virtio-iommu.c'))
> +
>  virtio_ss = ss.source_set()
> -virtio_ss.add(files('virtio.c'))
> -virtio_ss.add(when: 'CONFIG_VIRTIO_LEGACY', if_true: files('virtio-legacy.c'))
>  virtio_ss.add(when: 'CONFIG_VHOST', if_true: files('vhost.c', 'vhost-backend.c'))
> -virtio_ss.add(when: 'CONFIG_VHOST_USER', if_true: files('vhost-user.c'))
> -virtio_ss.add(when: 'CONFIG_VHOST_VDPA', if_true: files('vhost-vdpa.c'))
>  virtio_ss.add(when: 'CONFIG_VIRTIO_BALLOON', if_true: files('virtio-balloon.c'))
>  virtio_ss.add(when: 'CONFIG_VIRTIO_CRYPTO', if_true: files('virtio-crypto.c'))
>  virtio_ss.add(when: ['CONFIG_VIRTIO_CRYPTO', 'CONFIG_VIRTIO_PCI'], if_true: files('virtio-crypto-pci.c'))
> @@ -24,7 +27,6 @@
>  virtio_ss.add(when: 'CONFIG_VHOST_VSOCK', if_true: files('vhost-vsock.c', 'vhost-vsock-common.c'))
>  virtio_ss.add(when: 'CONFIG_VHOST_USER_VSOCK', if_true: files('vhost-user-vsock.c', 'vhost-vsock-common.c'))
>  virtio_ss.add(when: 'CONFIG_VIRTIO_RNG', if_true: files('virtio-rng.c'))
> -virtio_ss.add(when: 'CONFIG_VIRTIO_IOMMU', if_true: files('virtio-iommu.c'))
>  virtio_ss.add(when: 'CONFIG_VIRTIO_MEM', if_true: files('virtio-mem.c'))
>  
>  virtio_pci_ss = ss.source_set()
> @@ -49,4 +51,5 @@
>  
>  virtio_ss.add_all(when: 'CONFIG_VIRTIO_PCI', if_true: virtio_pci_ss)
>  
> -specific_ss.add_all(when: 'CONFIG_VIRTIO', if_true: virtio_ss)
> +softmmu_ss.add_all(when: 'CONFIG_VIRTIO', if_true: virtio_ss)
> +specific_ss.add_all(when: 'CONFIG_VIRTIO', if_true: virtio_arch_ss)



  parent reply	other threads:[~2020-11-05 14:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-05 12:43 [PATCH-for-6.0 0/3] hw/virtio: Allow to disable legacy VIRTIO Philippe Mathieu-Daudé
2020-11-05 12:43 ` [PATCH-for-6.0 1/3] hw/virtio: Add configure switch " Philippe Mathieu-Daudé
2020-11-05 13:06   ` Cornelia Huck
2020-11-05 13:53     ` Philippe Mathieu-Daudé
2020-11-05 13:08   ` Paolo Bonzini
2020-11-05 12:43 ` [PATCH-for-6.0 2/3] hw/virtio: Build most of virtio devices as arch-independent objects Philippe Mathieu-Daudé
2020-11-05 13:08   ` Paolo Bonzini
2020-11-05 14:33   ` Greg Kurz [this message]
2020-11-05 12:43 ` [PATCH-for-6.0 3/3] gitlab-ci: Test the --disable-virtio-legacy option Philippe Mathieu-Daudé
2020-11-05 13:33   ` Thomas Huth
2020-11-05 14:12 ` [PATCH-for-6.0 0/3] hw/virtio: Allow to disable legacy VIRTIO Philippe Mathieu-Daudé

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=20201105153346.11586e80@bahia.lan \
    --to=groug@kaod.org \
    --cc=alex.bennee@linaro.org \
    --cc=cohuck@redhat.com \
    --cc=elena.ufimtseva@oracle.com \
    --cc=fam@euphon.net \
    --cc=jag.raman@oracle.com \
    --cc=jasowang@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu_oss@crudebyte.com \
    --cc=stefanha@gmail.com \
    --cc=stefanha@redhat.com \
    --cc=thuth@redhat.com \
    --cc=wainersm@redhat.com \
    /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).