From: "Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>, qemu-devel@nongnu.org
Cc: linux-cxl@vger.kernel.org, "Michael S. Tsirkin" <mst@redhat.com>,
qemu-arm@nongnu.org, Junjie Cao <junjie.cao@intel.com>,
Peter Maydell <peter.maydell@linaro.org>,
Anisa Su <anisa.su@samsung.com>,
Jonathan Cameron <jic23@kernel.org>
Subject: Re: [PATCH v2 2/2] hw/pci-bridge: split CXL PXB into separate file
Date: Mon, 28 Sep 2026 12:03:34 +0200 [thread overview]
Message-ID: <a28df37c-b0cf-45f8-9aca-d4cf9877b6ae@oss.qualcomm.com> (raw)
In-Reply-To: <20260928095646.3555447-3-berrange@redhat.com>
On 28/9/26 11:56, Daniel P. Berrangé wrote:
> If CONFIG_CXL=n is added to the Kconfig, the build fails to link
> the PXB device:
>
> /usr/bin/ld.bfd: libsystem.a.p/hw_pci-bridge_pci_expander_bridge.c.o: in function `pxb_cxl_realize':
> /home/berrange/src/virt/qemu/build/../hw/pci-bridge/pci_expander_bridge.c:202:(.text+0x330): undefined reference to `cxl_component_register_block_init'
> /usr/bin/ld.bfd: libsystem.a.p/hw_pci-bridge_pci_expander_bridge.c.o: in function `pxb_cxl_dev_reset':
> /home/berrange/src/virt/qemu/build/../hw/pci-bridge/pci_expander_bridge.c:309:(.text+0x768): undefined reference to `cxl_component_register_init_common'
>
> We cannot use CONFIG_CXL in pci_expander_bridge.c because the
> identifier is poisoned. Instead the CXL pieces must be split
> off into a separate source file which can be conditionally
> built.
>
> With this change, the stubs file is no longer required, since
> the code referencing the stub was already protected by CONFIG_CXL.
>
> Fixes: 6e4e3ae936 (hw/cxl/component: Implement host bridge MMIO (8.2.5, table 142))
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
> hw/cxl/cxl-host.c | 2 +-
> hw/pci-bridge/meson.build | 4 +-
> hw/pci-bridge/pci_expander_bridge.c | 194 +----------------
> hw/pci-bridge/pci_expander_bridge_common.h | 29 +++
> hw/pci-bridge/pci_expander_bridge_cxl.c | 201 ++++++++++++++++++
> hw/pci-bridge/pci_expander_bridge_stubs.c | 14 --
> ...der_bridge.h => pci_expander_bridge_cxl.h} | 0
> 7 files changed, 242 insertions(+), 202 deletions(-)
> create mode 100644 hw/pci-bridge/pci_expander_bridge_common.h
> create mode 100644 hw/pci-bridge/pci_expander_bridge_cxl.c
> delete mode 100644 hw/pci-bridge/pci_expander_bridge_stubs.c
> rename include/hw/pci-bridge/{pci_expander_bridge.h => pci_expander_bridge_cxl.h} (100%)
> diff --git a/hw/pci-bridge/pci_expander_bridge_common.h b/hw/pci-bridge/pci_expander_bridge_common.h
> new file mode 100644
> index 00000000000..fc5d1ac8691
> --- /dev/null
> +++ b/hw/pci-bridge/pci_expander_bridge_common.h
> @@ -0,0 +1,29 @@
> +/*
> + * PCI Expander Bridge Device Emulation Common Code
> + *
> + * Copyright (C) 2015 Red Hat Inc
> + *
> + * Authors:
> + * Marcel Apfelbaum <marcel@redhat.com>
> + *
> + * This work is licensed under the terms of the GNU GPL, version 2 or later.
> + * See the COPYING file in the top-level directory.
> + */
> +
> +enum BusType { PCI, PCIE, CXL };
> +
> +typedef struct PXBBus PXBBus;
> +
> +struct PXBBus {
> + /*< private >*/
> + PCIBus parent_obj;
> + /*< public >*/
We updated our coding style to not use these private/public comments
anymore. I can remove them if MST is OK to merge via hw-misc tree.
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> +
> + char bus_path[8];
> +};
prev parent reply other threads:[~2026-09-28 10:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-28 9:56 [PATCH v2 0/2] hw/pci-bridge: fix build with CONFIG_CXL disabled Daniel P. Berrangé
2026-09-28 9:56 ` [PATCH v2 1/2] hw/arm: remove pci-bridge/pci_expander_bridge.h from virt.c Daniel P. Berrangé
2026-09-28 10:01 ` Philippe Mathieu-Daudé
2026-09-28 9:56 ` [PATCH v2 2/2] hw/pci-bridge: split CXL PXB into separate file Daniel P. Berrangé
2026-09-28 10:03 ` Philippe Mathieu-Daudé [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=a28df37c-b0cf-45f8-9aca-d4cf9877b6ae@oss.qualcomm.com \
--to=philmd@oss.qualcomm.com \
--cc=anisa.su@samsung.com \
--cc=berrange@redhat.com \
--cc=jic23@kernel.org \
--cc=junjie.cao@intel.com \
--cc=linux-cxl@vger.kernel.org \
--cc=mst@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.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 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.