From: Anthony PERARD <anthony.perard@cloud.com>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>
Cc: "David Woodhouse" <dwmw@amazon.co.uk>,
qemu-devel@nongnu.org, "Alex Bennée" <alex.bennee@linaro.org>,
"Paul Durrant" <paul@xen.org>,
qemu-arm@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
"David Woodhouse" <dwmw2@infradead.org>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Richard Henderson" <richard.henderson@linaro.org>,
xen-devel@lists.xenproject.org, qemu-block@nongnu.org,
kvm@vger.kernel.org, "Thomas Huth" <thuth@redhat.com>,
"Stefan Hajnoczi" <stefanha@redhat.com>,
"Kevin Wolf" <kwolf@redhat.com>,
"Hanna Reitz" <hreitz@redhat.com>
Subject: Re: [PATCH-for-9.0 v2 19/19] hw/xen: Have most of Xen files become target-agnostic
Date: Thu, 28 Mar 2024 15:13:51 +0000 [thread overview]
Message-ID: <83ff9fec-2ac1-418f-ac76-2256d03e676e@perard> (raw)
In-Reply-To: <20231114143816.71079-20-philmd@linaro.org>
On Tue, Nov 14, 2023 at 03:38:15PM +0100, Philippe Mathieu-Daudé wrote:
> Previous commits re-organized the target-specific bits
> from Xen files. We can now build the common files once
> instead of per-target.
>
> Only 4 files call libxen API (thus its CPPFLAGS):
> - xen-hvm-common.c,
> - xen_pt.c, xen_pt_graphics.c, xen_pt_msi.c
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> Reworked since v1 so dropping David's R-b tag.
> ---
> accel/xen/meson.build | 2 +-
> hw/block/dataplane/meson.build | 2 +-
> hw/xen/meson.build | 21 ++++++++++-----------
> 3 files changed, 12 insertions(+), 13 deletions(-)
>
> diff --git a/accel/xen/meson.build b/accel/xen/meson.build
> index 002bdb03c6..455ad5d6be 100644
> --- a/accel/xen/meson.build
> +++ b/accel/xen/meson.build
> @@ -1 +1 @@
> -specific_ss.add(when: 'CONFIG_XEN', if_true: files('xen-all.c'))
> +system_ss.add(when: 'CONFIG_XEN', if_true: files('xen-all.c'))
> diff --git a/hw/block/dataplane/meson.build b/hw/block/dataplane/meson.build
> index 025b3b061b..4d8bcb0bb9 100644
> --- a/hw/block/dataplane/meson.build
> +++ b/hw/block/dataplane/meson.build
> @@ -1,2 +1,2 @@
> system_ss.add(when: 'CONFIG_VIRTIO_BLK', if_true: files('virtio-blk.c'))
> -specific_ss.add(when: 'CONFIG_XEN_BUS', if_true: files('xen-block.c'))
> +system_ss.add(when: 'CONFIG_XEN_BUS', if_true: files('xen-block.c'))
> diff --git a/hw/xen/meson.build b/hw/xen/meson.build
> index d887fa9ba4..403cab49cf 100644
> --- a/hw/xen/meson.build
> +++ b/hw/xen/meson.build
> @@ -7,26 +7,25 @@ system_ss.add(when: ['CONFIG_XEN_BUS'], if_true: files(
> 'xen_pvdev.c',
> ))
>
> -system_ss.add(when: ['CONFIG_XEN', xen], if_true: files(
> +system_ss.add(when: ['CONFIG_XEN'], if_true: files(
> 'xen-operations.c',
> -))
> -
> -xen_specific_ss = ss.source_set()
> -xen_specific_ss.add(files(
> 'xen-mapcache.c',
> +))
> +system_ss.add(when: ['CONFIG_XEN', xen], if_true: files(
> 'xen-hvm-common.c',
> ))
> +
> if have_xen_pci_passthrough
> - xen_specific_ss.add(files(
> + system_ss.add(when: ['CONFIG_XEN'], if_true: files(
> 'xen-host-pci-device.c',
> - 'xen_pt.c',
> 'xen_pt_config_init.c',
> - 'xen_pt_graphics.c',
> 'xen_pt_load_rom.c',
> + ))
> + system_ss.add(when: ['CONFIG_XEN', xen], if_true: files(
> + 'xen_pt.c',
> + 'xen_pt_graphics.c',
How is it useful to separate those source files? In the commit
description, there's a talk about "CPPFLAGS", but having `when: [xen]`
doesn't change the flags used to build those objects, so the talk about
"CPPFLAGS" is confusing.
Second, if for some reason the dependency `xen` is false, but
`CONFIG_XEN` is true, then we wouldn't be able to build QEMU. Try
linking a binary with "xen_pt_config_init.o" but without "xen_pt.o",
that's not going to work. So even if that first source file doesn't
directly depend on the Xen libraries, it depends on "xen_pt.o" which
depends on the Xen libraries. So ultimately, I think all those source
files should have the same condition: ['CONFIG_XEN', xen].
I've only checked the xen_pt* source files, I don't know if the same
applies to "xen-operations.c" or "xen-mapcache.c".
Beside this, QEMU built with Xen support still seems to works fine, so
adding the objects to `system_ss` instead of `specific_ss` seems
alright.
Thanks,
--
Anthony PERARD
prev parent reply other threads:[~2024-03-28 15:14 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-14 14:37 [PATCH-for-9.0 v2 00/19] hw/xen: Have most of Xen files become target-agnostic Philippe Mathieu-Daudé
2023-11-14 14:37 ` [PATCH-for-9.0 v2 01/19] tests/avocado: Add 'guest:xen' tag to tests running Xen guest Philippe Mathieu-Daudé
2023-11-14 14:50 ` David Woodhouse
2023-11-14 15:00 ` Philippe Mathieu-Daudé
2023-11-14 15:08 ` David Woodhouse
2023-11-14 15:13 ` Philippe Mathieu-Daudé
2023-11-14 15:19 ` David Woodhouse
2023-11-14 15:42 ` Philippe Mathieu-Daudé
2023-11-14 14:37 ` [PATCH-for-9.0 v2 02/19] sysemu/xen: Forbid using Xen headers in user emulation Philippe Mathieu-Daudé
2023-11-14 14:37 ` [PATCH-for-9.0 v2 03/19] sysemu/xen-mapcache: Check Xen availability with CONFIG_XEN_IS_POSSIBLE Philippe Mathieu-Daudé
2023-11-14 14:38 ` [PATCH-for-9.0 v2 04/19] system/physmem: Do not include 'hw/xen/xen.h' but 'sysemu/xen.h' Philippe Mathieu-Daudé
2023-11-14 14:59 ` David Woodhouse
2023-11-14 15:14 ` David Hildenbrand
2023-11-14 14:38 ` [PATCH-for-9.0 v2 05/19] hw/display: Restrict xen_register_framebuffer() call to Xen Philippe Mathieu-Daudé
2024-03-27 11:50 ` Anthony PERARD
2023-11-14 14:38 ` [PATCH-for-9.0 v2 06/19] hw/pci/msi: Restrict xen_is_pirq_msi() " Philippe Mathieu-Daudé
2023-11-14 15:13 ` David Woodhouse
2023-11-14 15:22 ` Philippe Mathieu-Daudé
2023-11-14 15:44 ` David Woodhouse
2023-11-14 21:18 ` David Woodhouse
2023-11-14 16:17 ` David Woodhouse
2023-11-14 14:38 ` [PATCH-for-9.0 v2 07/19] hw/xen: Remove unnecessary xen_hvm_inject_msi() stub Philippe Mathieu-Daudé
2023-11-14 15:27 ` David Woodhouse
2023-11-14 14:38 ` [PATCH-for-9.0 v2 08/19] hw/xen: Remove unused Xen stubs Philippe Mathieu-Daudé
2024-03-27 11:54 ` Anthony PERARD
2023-11-14 14:38 ` [RFC PATCH-for-9.0 v2 09/19] hw/block/xen_blkif: Align structs with QEMU_ALIGNED() instead of #pragma Philippe Mathieu-Daudé
2023-11-14 15:30 ` David Woodhouse
2024-03-27 13:31 ` Anthony PERARD
2024-03-27 13:34 ` David Woodhouse
2023-11-14 14:38 ` [PATCH-for-9.0 v2 10/19] hw/xen: Rename 'ram_memory' global variable as 'xen_memory' Philippe Mathieu-Daudé
2023-11-14 15:49 ` David Woodhouse
2024-03-06 17:14 ` Philippe Mathieu-Daudé
2023-11-14 14:38 ` [PATCH-for-9.0 v2 11/19] hw/xen/xen_arch_hvm: Rename prototypes using 'xen_arch_' prefix Philippe Mathieu-Daudé
2024-03-27 13:37 ` Anthony PERARD
2023-11-14 14:38 ` [PATCH-for-9.0 v2 12/19] hw/xen: Merge 'hw/xen/arch_hvm.h' in 'hw/xen/xen-hvm-common.h' Philippe Mathieu-Daudé
2024-03-27 14:27 ` Anthony PERARD
2023-11-14 14:38 ` [RFC PATCH-for-9.0 v2 13/19] hw/xen: Remove use of 'target_ulong' in handle_ioreq() Philippe Mathieu-Daudé
2024-03-06 17:16 ` Philippe Mathieu-Daudé
2024-03-27 16:45 ` Anthony PERARD
2023-11-14 14:38 ` [PATCH-for-9.0 v2 14/19] hw/xen: Use target-agnostic qemu_target_page_bits() Philippe Mathieu-Daudé
2023-11-14 14:38 ` [PATCH-for-9.0 v2 15/19] hw/xen: Reduce inclusion of 'cpu.h' to target-specific sources Philippe Mathieu-Daudé
2024-03-27 17:13 ` Anthony PERARD
2023-11-14 14:38 ` [PATCH-for-9.0 v2 16/19] hw/xen/xen_pt: Add missing license Philippe Mathieu-Daudé
2023-11-14 15:54 ` David Woodhouse
2024-03-27 17:27 ` Anthony PERARD
2023-11-14 14:38 ` [PATCH-for-9.0 v2 17/19] hw/xen: Extract 'xen_igd.h' from 'xen_pt.h' Philippe Mathieu-Daudé
2023-11-14 14:38 ` [PATCH-for-9.0 v2 18/19] hw/i386/xen: Compile 'xen-hvm.c' with Xen CPPFLAGS Philippe Mathieu-Daudé
2023-11-14 15:56 ` David Woodhouse
2023-11-14 14:38 ` [PATCH-for-9.0 v2 19/19] hw/xen: Have most of Xen files become target-agnostic Philippe Mathieu-Daudé
2024-03-28 15:13 ` Anthony PERARD [this message]
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=83ff9fec-2ac1-418f-ac76-2256d03e676e@perard \
--to=anthony.perard@cloud.com \
--cc=alex.bennee@linaro.org \
--cc=dwmw2@infradead.org \
--cc=dwmw@amazon.co.uk \
--cc=hreitz@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=kwolf@redhat.com \
--cc=paul@xen.org \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=sstabellini@kernel.org \
--cc=stefanha@redhat.com \
--cc=thuth@redhat.com \
--cc=xen-devel@lists.xenproject.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).