qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [RFC QEMU PATCH v4 0/2] cxl: Support creation of a new CXL Host Bridge
@ 2025-08-07 10:59 wangyuquan
  2025-08-07 10:59 ` [RFC QEMU PATCH v4 1/2] hw/pxb-cxl: Rename the pxb cxl host bridge wangyuquan
  2025-08-07 10:59 ` [RFC QEMU PATCH v4 2/2] pci-host/cxl: Support creation of a new CXL Host Bridge wangyuquan
  0 siblings, 2 replies; 6+ messages in thread
From: wangyuquan @ 2025-08-07 10:59 UTC (permalink / raw)
  To: jonathan.cameron, fan.ni, mst, marcel.apfelbaum, rad,
	peter.maydell, leif.lindholm, graf, claudio.fontana, philmd,
	richard.henderson
  Cc: chenbaozi, qemu-devel, linux-cxl, Yuquan Wang

From: Yuquan Wang <wangyuquan1236@phytium.com.cn>

v3 -> v4:
- Simplify variable definitions (Jonathan)
- Fix some alignment and space problems (Jonathan)
- Include the header file for MemoryRegion (Jonathan)
- Rebased on 'Make the CXL fixed memory windows devices'
- Keep cxl_fixed_memory_window_config() static and remove its declaration in the header file
v2 -> v3:
- Update the commit message
- Fix some alignment and space problems
- Add a SPDX header for the new file
- Remove unnecessary comments
- Add CXL_HOST_BRIDGE config
v1 -> v2:
- Move the code of new bridge to hw/pci-host/cxl.c
- Fix and simplify some logic on handling the different bridge types

Background
==========
Currently the base CXL support for arm platforms is only on Jonathan's
patches[1]. Some platform like SBSA-REF can be more like a real machine,
thus the support of CXL could be meaningful. However, the pxb-cxl-host
realization on this platform seems not satisfying their requirements[2].

New CXL HOST design
===================
Defines a new CXL host bridge type (TYPE_CXL_HOST). This is an
independent CXL host bridge which combined GPEX features (ECAM, MMIO
windows and irq) and CXL Host Bridge Component Registers (CHBCR).

The root bus path of CXL_HOST is "0001:00", that would not affect the
original pcie host topology. In the previous, the pxb-cxl-host with
any CXL root ports and CXL endpoint devices would occupy the BDF
number of the original pcie domain. This new type provide a solution
to resolve the problem.

Remaining problems
==================
I tried to use 'object_resolve_path' but it could not work in
'cxl_fmws_link', so I used 'TYPE_DEVICE' to match that.

Reviewing
=========
Welcome more PCI folks to review this patch, thanks a lot!

Link:
[1]: https://lore.kernel.org/linux-cxl/20220616141950.23374-1-Jonathan.Cameron@huawei.com/
[2]: https://lists.nongnu.org/archive/html/qemu-arm/2024-11/msg00522.html

Yuquan Wang (2):
  pci-host/cxl: Support creation of a new CXL Host Bridge
  hw/pxb-cxl: Rename the pxb cxl host bridge

 hw/cxl/cxl-host.c                     |  56 +++++++---
 hw/pci-bridge/pci_expander_bridge.c   |   8 +-
 hw/pci-host/Kconfig                   |   4 +
 hw/pci-host/cxl.c                     | 146 ++++++++++++++++++++++++++
 hw/pci-host/meson.build               |   1 +
 include/hw/cxl/cxl.h                  |   7 +-
 include/hw/pci-host/cxl_host_bridge.h |  24 +++++
 7 files changed, 229 insertions(+), 17 deletions(-)
 create mode 100644 hw/pci-host/cxl.c
 create mode 100644 include/hw/pci-host/cxl_host_bridge.h

-- 
2.34.1



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

* [RFC QEMU PATCH v4 1/2] hw/pxb-cxl: Rename the pxb cxl host bridge
  2025-08-07 10:59 [RFC QEMU PATCH v4 0/2] cxl: Support creation of a new CXL Host Bridge wangyuquan
@ 2025-08-07 10:59 ` wangyuquan
  2025-09-17 16:32   ` Jonathan Cameron via
  2025-08-07 10:59 ` [RFC QEMU PATCH v4 2/2] pci-host/cxl: Support creation of a new CXL Host Bridge wangyuquan
  1 sibling, 1 reply; 6+ messages in thread
From: wangyuquan @ 2025-08-07 10:59 UTC (permalink / raw)
  To: jonathan.cameron, fan.ni, mst, marcel.apfelbaum, rad,
	peter.maydell, leif.lindholm, graf, claudio.fontana, philmd,
	richard.henderson
  Cc: chenbaozi, qemu-devel, linux-cxl, wangyuquan

This renames some descriptions and definitions of pxb cxl host
bridge, since the original names can be confusing.

Signed-off-by: Yuquan Wang <wangyuquan1236@phytium.com.cn>
---
 hw/pci-bridge/pci_expander_bridge.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expander_bridge.c
index 3a29dfefc2..bd637786d0 100644
--- a/hw/pci-bridge/pci_expander_bridge.c
+++ b/hw/pci-bridge/pci_expander_bridge.c
@@ -201,7 +201,7 @@ static void pxb_cxl_realize(DeviceState *dev, Error **errp)
 }
 
 /*
- * Host bridge realization has no means of knowning state associated
+ * PXB Host bridge realization has no means of knowning state associated
  * with a particular machine. As such, it is nececssary to delay
  * final setup of the host bridge register space until later in the
  * machine bring up.
@@ -240,7 +240,7 @@ static void pxb_cxl_host_class_init(ObjectClass *class, const void *data)
  * This is a device to handle the MMIO for a CXL host bridge. It does nothing
  * else.
  */
-static const TypeInfo cxl_host_info = {
+static const TypeInfo pxb_cxl_host_info = {
     .name          = TYPE_PXB_CXL_HOST,
     .parent        = TYPE_PCI_HOST_BRIDGE,
     .instance_size = sizeof(CXLHost),
@@ -522,7 +522,7 @@ static void pxb_cxl_dev_class_init(ObjectClass *klass, const void *data)
      * vendor, device, class, etc. ids are intentionally left out.
      */
 
-    dc->desc = "CXL Host Bridge";
+    dc->desc = "PXB CXL Host Bridge";
     device_class_set_props(dc, pxb_cxl_dev_properties);
     set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
 
@@ -549,7 +549,7 @@ static void pxb_register_types(void)
     type_register_static(&pxb_pcie_bus_info);
     type_register_static(&pxb_cxl_bus_info);
     type_register_static(&pxb_host_info);
-    type_register_static(&cxl_host_info);
+    type_register_static(&pxb_cxl_host_info);
     type_register_static(&pxb_dev_info);
     type_register_static(&pxb_pcie_dev_info);
     type_register_static(&pxb_cxl_dev_info);
-- 
2.34.1



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

* [RFC QEMU PATCH v4 2/2] pci-host/cxl: Support creation of a new CXL Host Bridge
  2025-08-07 10:59 [RFC QEMU PATCH v4 0/2] cxl: Support creation of a new CXL Host Bridge wangyuquan
  2025-08-07 10:59 ` [RFC QEMU PATCH v4 1/2] hw/pxb-cxl: Rename the pxb cxl host bridge wangyuquan
@ 2025-08-07 10:59 ` wangyuquan
  2025-09-17 16:37   ` Jonathan Cameron via
  1 sibling, 1 reply; 6+ messages in thread
From: wangyuquan @ 2025-08-07 10:59 UTC (permalink / raw)
  To: jonathan.cameron, fan.ni, mst, marcel.apfelbaum, rad,
	peter.maydell, leif.lindholm, graf, claudio.fontana, philmd,
	richard.henderson
  Cc: chenbaozi, qemu-devel, linux-cxl, Yuquan Wang

From: Yuquan Wang <wangyuquan1236@phytium.com.cn>

Define a new CXL host bridge type (TYPE_CXL_HOST). This is an
independent CXL host bridge which combined GPEX features (ECAM, MMIO
windows and irq) and CXL Host Bridge Component Registers (CHBCR).

The root bus path of CXL_HOST is "0001:00", that would not affect the
original PCIe host topology on some platforms. In the previous, the
pxb-cxl-host with any CXL root ports and CXL endpoint devices would
share the resources (like BDF, MMIO space) of the original pcie
domain, but it would cause some platforms like sbsa-ref are unable to
support the original number of PCIe devices. The new type provides a
solution to resolve the problem.

Signed-off-by: Yuquan Wang <wangyuquan1236@phytium.com.cn>
---
 hw/cxl/cxl-host.c                     |  56 +++++++---
 hw/pci-host/Kconfig                   |   4 +
 hw/pci-host/cxl.c                     | 146 ++++++++++++++++++++++++++
 hw/pci-host/meson.build               |   1 +
 include/hw/cxl/cxl.h                  |   7 +-
 include/hw/pci-host/cxl_host_bridge.h |  24 +++++
 6 files changed, 225 insertions(+), 13 deletions(-)
 create mode 100644 hw/pci-host/cxl.c
 create mode 100644 include/hw/pci-host/cxl_host_bridge.h

diff --git a/hw/cxl/cxl-host.c b/hw/cxl/cxl-host.c
index 5c2ce25a19..cedc11459d 100644
--- a/hw/cxl/cxl-host.c
+++ b/hw/cxl/cxl-host.c
@@ -16,11 +16,13 @@
 #include "qapi/qapi-visit-machine.h"
 #include "hw/cxl/cxl.h"
 #include "hw/cxl/cxl_host.h"
+#include "hw/irq.h"
 #include "hw/pci/pci_bus.h"
 #include "hw/pci/pci_bridge.h"
 #include "hw/pci/pci_host.h"
 #include "hw/pci/pcie_port.h"
 #include "hw/pci-bridge/pci_expander_bridge.h"
+#include "hw/pci-host/cxl_host_bridge.h"
 
 static void cxl_fixed_memory_window_config(CXLFixedMemoryWindowOptions *object,
                                            int index, Error **errp)
@@ -84,14 +86,16 @@ static int cxl_fmws_link(Object *obj, void *opaque)
         Object *o;
         bool ambig;
 
-        o = object_resolve_path_type(fw->targets[i], TYPE_PXB_CXL_DEV,
+        o = object_resolve_path_type(fw->targets[i], TYPE_DEVICE,
                                      &ambig);
-        if (!o) {
+        if (object_dynamic_cast(o, TYPE_PXB_CXL_DEV) ||
+            object_dynamic_cast(o, TYPE_CXL_HOST)) {
+            fw->target_hbs[i] = o;
+        } else {
             error_setg(&error_fatal, "Could not resolve CXLFM target %s",
                        fw->targets[i]);
             return 1;
         }
-        fw->target_hbs[i] = PXB_CXL_DEV(o);
     }
     return 0;
 }
@@ -159,6 +163,7 @@ static bool cxl_hdm_find_target(uint32_t *cache_mem, hwaddr addr,
 static PCIDevice *cxl_cfmws_find_device(CXLFixedWindow *fw, hwaddr addr)
 {
     CXLComponentState *hb_cstate, *usp_cstate;
+    CXLHostBridge *cxlhost;
     PCIHostState *hb;
     CXLUpstreamPort *usp;
     int rb_index;
@@ -166,23 +171,50 @@ static PCIDevice *cxl_cfmws_find_device(CXLFixedWindow *fw, hwaddr addr)
     uint8_t target;
     bool target_found;
     PCIDevice *rp, *d;
+    Object *o;
 
     /* Address is relative to memory region. Convert to HPA */
     addr += fw->base;
 
     rb_index = (addr / cxl_decode_ig(fw->enc_int_gran)) % fw->num_targets;
-    hb = PCI_HOST_BRIDGE(fw->target_hbs[rb_index]->cxl_host_bridge);
-    if (!hb || !hb->bus || !pci_bus_is_cxl(hb->bus)) {
-        return NULL;
-    }
-
-    if (cxl_get_hb_passthrough(hb)) {
-        rp = pcie_find_port_first(hb->bus);
-        if (!rp) {
+    o = fw->target_hbs[rb_index];
+    if (object_dynamic_cast(o, TYPE_PXB_CXL_DEV)) {
+        hb = PCI_HOST_BRIDGE(PXB_CXL_DEV(o)->cxl_host_bridge);
+        if (!hb || !hb->bus || !pci_bus_is_cxl(hb->bus)) {
             return NULL;
         }
+
+        if (cxl_get_hb_passthrough(hb)) {
+            rp = pcie_find_port_first(hb->bus);
+            if (!rp) {
+                return NULL;
+            }
+        } else {
+            hb_cstate = cxl_get_hb_cstate(hb);
+            if (!hb_cstate) {
+                return NULL;
+            }
+
+            cache_mem = hb_cstate->crb.cache_mem_registers;
+
+            target_found = cxl_hdm_find_target(cache_mem, addr, &target);
+            if (!target_found) {
+                return NULL;
+            }
+
+            rp = pcie_find_port_by_pn(hb->bus, target);
+            if (!rp) {
+                return NULL;
+            }
+        }
     } else {
-        hb_cstate = cxl_get_hb_cstate(hb);
+        hb = PCI_HOST_BRIDGE(o);
+        if (!hb || !hb->bus || !pci_bus_is_cxl(hb->bus)) {
+            return NULL;
+        }
+
+        cxlhost = CXL_HOST(hb);
+        hb_cstate = &cxlhost->cxl_cstate;
         if (!hb_cstate) {
             return NULL;
         }
diff --git a/hw/pci-host/Kconfig b/hw/pci-host/Kconfig
index 9824fa188d..33ab945d38 100644
--- a/hw/pci-host/Kconfig
+++ b/hw/pci-host/Kconfig
@@ -75,6 +75,10 @@ config PCI_POWERNV
     select MSI_NONBROKEN
     select PCIE_PORT
 
+config CXL_HOST_BRIDGE
+    bool
+    select PCI_EXPRESS
+
 config REMOTE_PCIHOST
     bool
 
diff --git a/hw/pci-host/cxl.c b/hw/pci-host/cxl.c
new file mode 100644
index 0000000000..cffe392fbf
--- /dev/null
+++ b/hw/pci-host/cxl.c
@@ -0,0 +1,146 @@
+/*
+ * QEMU CXL Host Bridge Emulation
+ *
+ * Copyright (C) 2025, Phytium Technology Co, Ltd. All rights reserved.
+ *
+ * Based on gpex.c
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "qemu/osdep.h"
+#include "hw/pci/pci_bus.h"
+#include "hw/pci-host/cxl_host_bridge.h"
+
+static void cxl_host_set_irq(void *opaque, int irq_num, int level)
+{
+    CXLHostBridge *host = opaque;
+
+    qemu_set_irq(host->irq[irq_num], level);
+}
+
+int cxl_host_set_irq_num(CXLHostBridge *host, int index, int gsi)
+{
+    if (index >= PCI_NUM_PINS) {
+        return -EINVAL;
+    }
+
+    host->irq_num[index] = gsi;
+    return 0;
+}
+
+static PCIINTxRoute cxl_host_route_intx_pin_to_irq(void *opaque, int pin)
+{
+    CXLHostBridge *host = opaque;
+    int gsi = host->irq_num[pin];
+    PCIINTxRoute route = {
+       .irq = gsi,
+       .mode = gsi < 0 ? PCI_INTX_DISABLED : PCI_INTX_ENABLED,
+    };
+
+    return route;
+}
+
+static const char *cxl_host_root_bus_path(PCIHostState *host_bridge,
+                                          PCIBus *rootbus)
+{
+    return "0001:00";
+}
+
+void cxl_host_hook_up_registers(CXLState *cxl_state, CXLHostBridge *host)
+{
+    CXLComponentState *cxl_cstate = &host->cxl_cstate;
+    struct MemoryRegion *mr = &cxl_cstate->crb.component_registers;
+
+    memory_region_add_subregion(&cxl_state->host_mr, 0, mr);
+}
+
+static void cxl_host_reset(CXLHostBridge *host)
+{
+    CXLComponentState *cxl_cstate = &host->cxl_cstate;
+    uint32_t *reg_state = cxl_cstate->crb.cache_mem_registers;
+    uint32_t *write_msk = cxl_cstate->crb.cache_mem_regs_write_mask;
+
+    cxl_component_register_init_common(reg_state, write_msk, CXL2_RC);
+
+    ARRAY_FIELD_DP32(reg_state, CXL_HDM_DECODER_CAPABILITY, TARGET_COUNT,
+                     8);
+}
+
+static void cxl_host_realize(DeviceState *dev, Error **errp)
+{
+    SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
+    CXLHostBridge *host = CXL_HOST(dev);
+    CXLComponentState *cxl_cstate = &host->cxl_cstate;
+    struct MemoryRegion *mr = &cxl_cstate->crb.component_registers;
+    PCIHostState *pci = PCI_HOST_BRIDGE(dev);
+    PCIExpressHost *pex = PCIE_HOST_BRIDGE(dev);
+    int i;
+
+    cxl_host_reset(host);
+    cxl_component_register_block_init(OBJECT(dev), cxl_cstate, TYPE_CXL_HOST);
+    sysbus_init_mmio(sbd, mr);
+
+    pcie_host_mmcfg_init(pex, PCIE_MMCFG_SIZE_MAX);
+    sysbus_init_mmio(sbd, &pex->mmio);
+
+    memory_region_init(&host->mmio, OBJECT(host), "cxl_host_mmio",
+                       UINT64_MAX);
+
+    memory_region_init_io(&host->mmio_window, OBJECT(host),
+                          &unassigned_io_ops, OBJECT(host),
+                          "cxl_host_mmio_window", UINT64_MAX);
+
+    memory_region_add_subregion(&host->mmio_window, 0, &host->mmio);
+    sysbus_init_mmio(sbd, &host->mmio_window);
+
+    /* ioport window init, 64K is the legacy size in x86 */
+    memory_region_init(&host->ioport, OBJECT(host), "cxl_host_ioport",
+                       64 * 1024);
+
+    memory_region_init_io(&host->ioport_window, OBJECT(host),
+                          &unassigned_io_ops, OBJECT(host),
+                          "cxl_host_ioport_window", 64 * 1024);
+
+    memory_region_add_subregion(&host->ioport_window, 0, &host->ioport);
+    sysbus_init_mmio(sbd, &host->ioport_window);
+
+    /* PCIe host bridge use 4 legacy IRQ lines */
+    for (i = 0; i < PCI_NUM_PINS; i++) {
+        sysbus_init_irq(sbd, &host->irq[i]);
+        host->irq_num[i] = -1;
+    }
+
+    pci->bus = pci_register_root_bus(dev, "cxlhost.0", cxl_host_set_irq,
+                                     pci_swizzle_map_irq_fn, host, &host->mmio,
+                                     &host->ioport, 0, 4, TYPE_CXL_BUS);
+    pci->bus->flags |= PCI_BUS_CXL;
+
+    pci_bus_set_route_irq_fn(pci->bus, cxl_host_route_intx_pin_to_irq);
+}
+
+static void cxl_host_class_init(ObjectClass *class, const void *data)
+{
+    DeviceClass *dc = DEVICE_CLASS(class);
+    PCIHostBridgeClass *hc = PCI_HOST_BRIDGE_CLASS(class);
+
+    hc->root_bus_path = cxl_host_root_bus_path;
+    dc->realize = cxl_host_realize;
+    dc->desc = "CXL Host Bridge";
+    set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
+    dc->fw_name = "cxl";
+}
+
+static const TypeInfo cxl_host_info = {
+    .name          = TYPE_CXL_HOST,
+    .parent        = TYPE_PCIE_HOST_BRIDGE,
+    .instance_size = sizeof(CXLHostBridge),
+    .class_init    = cxl_host_class_init,
+};
+
+static void cxl_host_register(void)
+{
+    type_register_static(&cxl_host_info);
+}
+
+type_init(cxl_host_register)
diff --git a/hw/pci-host/meson.build b/hw/pci-host/meson.build
index 937a0f72ac..030672373d 100644
--- a/hw/pci-host/meson.build
+++ b/hw/pci-host/meson.build
@@ -4,6 +4,7 @@ pci_ss.add(when: 'CONFIG_PCI_BONITO', if_true: files('bonito.c'))
 pci_ss.add(when: 'CONFIG_GT64120', if_true: files('gt64120.c'))
 pci_ss.add(when: 'CONFIG_PCI_EXPRESS_DESIGNWARE', if_true: files('designware.c'))
 pci_ss.add(when: 'CONFIG_PCI_EXPRESS_GENERIC_BRIDGE', if_true: files('gpex.c'))
+pci_ss.add(when: 'CONFIG_CXL_HOST_BRIDGE', if_true: files('cxl.c'))
 pci_ss.add(when: ['CONFIG_PCI_EXPRESS_GENERIC_BRIDGE', 'CONFIG_ACPI'], if_true: files('gpex-acpi.c'))
 pci_ss.add(when: 'CONFIG_PCI_EXPRESS_Q35', if_true: files('q35.c'))
 pci_ss.add(when: 'CONFIG_PCI_EXPRESS_XILINX', if_true: files('xilinx-pcie.c'))
diff --git a/include/hw/cxl/cxl.h b/include/hw/cxl/cxl.h
index 998f495a98..eaf4b6cc8a 100644
--- a/include/hw/cxl/cxl.h
+++ b/include/hw/cxl/cxl.h
@@ -27,12 +27,14 @@
 
 typedef struct PXBCXLDev PXBCXLDev;
 
+typedef struct CXLHostBridge CXLHostBridge;
+
 typedef struct CXLFixedWindow {
     SysBusDevice parent_obj;
     int index;
     uint64_t size;
     char **targets;
-    PXBCXLDev *target_hbs[16];
+    Object *target_hbs[16];
     uint8_t num_targets;
     uint8_t enc_int_ways;
     uint8_t enc_int_gran;
@@ -60,6 +62,9 @@ struct CXLHost {
 #define TYPE_PXB_CXL_HOST "pxb-cxl-host"
 OBJECT_DECLARE_SIMPLE_TYPE(CXLHost, PXB_CXL_HOST)
 
+#define TYPE_CXL_HOST "cxl-host"
+OBJECT_DECLARE_SIMPLE_TYPE(CXLHostBridge, CXL_HOST)
+
 #define TYPE_CXL_USP "cxl-upstream"
 
 typedef struct CXLUpstreamPort CXLUpstreamPort;
diff --git a/include/hw/pci-host/cxl_host_bridge.h b/include/hw/pci-host/cxl_host_bridge.h
new file mode 100644
index 0000000000..db0e4b5390
--- /dev/null
+++ b/include/hw/pci-host/cxl_host_bridge.h
@@ -0,0 +1,24 @@
+/*
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "hw/cxl/cxl.h"
+#include "hw/irq.h"
+#include "hw/pci/pcie_host.h"
+#include "system/memory.h"
+
+typedef struct CXLHostBridge {
+    PCIExpressHost parent_obj;
+
+    CXLComponentState cxl_cstate;
+
+    MemoryRegion ioport;
+    MemoryRegion mmio;
+    MemoryRegion ioport_window;
+    MemoryRegion mmio_window;
+    qemu_irq irq[PCI_NUM_PINS];
+    int irq_num[PCI_NUM_PINS];
+} CXLHostBridge;
+
+int cxl_host_set_irq_num(CXLHostBridge *host, int index, int gsi);
+void cxl_host_hook_up_registers(CXLState *cxl_state, CXLHostBridge *host);
-- 
2.34.1



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

* Re: [RFC QEMU PATCH v4 1/2] hw/pxb-cxl: Rename the pxb cxl host bridge
  2025-08-07 10:59 ` [RFC QEMU PATCH v4 1/2] hw/pxb-cxl: Rename the pxb cxl host bridge wangyuquan
@ 2025-09-17 16:32   ` Jonathan Cameron via
  0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Cameron via @ 2025-09-17 16:32 UTC (permalink / raw)
  To: wangyuquan
  Cc: fan.ni, mst, marcel.apfelbaum, rad, peter.maydell, leif.lindholm,
	graf, claudio.fontana, philmd, richard.henderson, chenbaozi,
	qemu-devel, linux-cxl

On Thu, 7 Aug 2025 18:59:09 +0800
wangyuquan <wangyuquan1236@phytium.com.cn> wrote:

> This renames some descriptions and definitions of pxb cxl host
> bridge, since the original names can be confusing.
> 
> Signed-off-by: Yuquan Wang <wangyuquan1236@phytium.com.cn>

This is fine with me - sorry for my lack of attention on this series.
I'm not set up to test SBSA and for me it's not a focus, but I don't
want to get in your way! 

Acked-by: Jonathan Cameron <jonathan.cameron@huawei.com>

> ---
>  hw/pci-bridge/pci_expander_bridge.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expander_bridge.c
> index 3a29dfefc2..bd637786d0 100644
> --- a/hw/pci-bridge/pci_expander_bridge.c
> +++ b/hw/pci-bridge/pci_expander_bridge.c
> @@ -201,7 +201,7 @@ static void pxb_cxl_realize(DeviceState *dev, Error **errp)
>  }
>  
>  /*
> - * Host bridge realization has no means of knowning state associated
> + * PXB Host bridge realization has no means of knowning state associated
>   * with a particular machine. As such, it is nececssary to delay
>   * final setup of the host bridge register space until later in the
>   * machine bring up.
> @@ -240,7 +240,7 @@ static void pxb_cxl_host_class_init(ObjectClass *class, const void *data)
>   * This is a device to handle the MMIO for a CXL host bridge. It does nothing
>   * else.
>   */
> -static const TypeInfo cxl_host_info = {
> +static const TypeInfo pxb_cxl_host_info = {
>      .name          = TYPE_PXB_CXL_HOST,
>      .parent        = TYPE_PCI_HOST_BRIDGE,
>      .instance_size = sizeof(CXLHost),
> @@ -522,7 +522,7 @@ static void pxb_cxl_dev_class_init(ObjectClass *klass, const void *data)
>       * vendor, device, class, etc. ids are intentionally left out.
>       */
>  
> -    dc->desc = "CXL Host Bridge";
> +    dc->desc = "PXB CXL Host Bridge";
>      device_class_set_props(dc, pxb_cxl_dev_properties);
>      set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
>  
> @@ -549,7 +549,7 @@ static void pxb_register_types(void)
>      type_register_static(&pxb_pcie_bus_info);
>      type_register_static(&pxb_cxl_bus_info);
>      type_register_static(&pxb_host_info);
> -    type_register_static(&cxl_host_info);
> +    type_register_static(&pxb_cxl_host_info);
>      type_register_static(&pxb_dev_info);
>      type_register_static(&pxb_pcie_dev_info);
>      type_register_static(&pxb_cxl_dev_info);



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

* Re: [RFC QEMU PATCH v4 2/2] pci-host/cxl: Support creation of a new CXL Host Bridge
  2025-08-07 10:59 ` [RFC QEMU PATCH v4 2/2] pci-host/cxl: Support creation of a new CXL Host Bridge wangyuquan
@ 2025-09-17 16:37   ` Jonathan Cameron via
  2025-09-18  2:59     ` Yuquan Wang
  0 siblings, 1 reply; 6+ messages in thread
From: Jonathan Cameron via @ 2025-09-17 16:37 UTC (permalink / raw)
  To: wangyuquan
  Cc: fan.ni, mst, marcel.apfelbaum, rad, peter.maydell, leif.lindholm,
	graf, claudio.fontana, philmd, richard.henderson, chenbaozi,
	qemu-devel, linux-cxl

On Thu, 7 Aug 2025 18:59:10 +0800
wangyuquan <wangyuquan1236@phytium.com.cn> wrote:

> From: Yuquan Wang <wangyuquan1236@phytium.com.cn>
> 
> Define a new CXL host bridge type (TYPE_CXL_HOST). This is an
> independent CXL host bridge which combined GPEX features (ECAM, MMIO
> windows and irq) and CXL Host Bridge Component Registers (CHBCR).
> 
> The root bus path of CXL_HOST is "0001:00", that would not affect the
> original PCIe host topology on some platforms. In the previous, the
> pxb-cxl-host with any CXL root ports and CXL endpoint devices would
> share the resources (like BDF, MMIO space) of the original pcie
> domain, but it would cause some platforms like sbsa-ref are unable to
> support the original number of PCIe devices. The new type provides a
> solution to resolve the problem.
> 
> Signed-off-by: Yuquan Wang <wangyuquan1236@phytium.com.cn>

Likewise, this looks fine to me.  If the SBSA maintainers
are happy with the approach and PCI folk think the more generic parts
look fine then would be good to move this forwards.

Acked-by: Jonathan Cameron <jonathan.cameron@huawei.com>



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

* Re: [RFC QEMU PATCH v4 2/2] pci-host/cxl: Support creation of a new CXL Host Bridge
  2025-09-17 16:37   ` Jonathan Cameron via
@ 2025-09-18  2:59     ` Yuquan Wang
  0 siblings, 0 replies; 6+ messages in thread
From: Yuquan Wang @ 2025-09-18  2:59 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: fan.ni, mst, marcel.apfelbaum, rad, peter.maydell, leif.lindholm,
	graf, claudio.fontana, philmd, richard.henderson, chenbaozi,
	qemu-devel, linux-cxl, ligen

Wed, Sep 17, 2025 at 05:37:42PM +0100, Jonathan Cameron wrote:
> On Thu, 7 Aug 2025 18:59:10 +0800
> wangyuquan <wangyuquan1236@phytium.com.cn> wrote:
> 
> > From: Yuquan Wang <wangyuquan1236@phytium.com.cn>
> > 
> > Define a new CXL host bridge type (TYPE_CXL_HOST). This is an
> > independent CXL host bridge which combined GPEX features (ECAM, MMIO
> > windows and irq) and CXL Host Bridge Component Registers (CHBCR).
> > 
> > The root bus path of CXL_HOST is "0001:00", that would not affect the
> > original PCIe host topology on some platforms. In the previous, the
> > pxb-cxl-host with any CXL root ports and CXL endpoint devices would
> > share the resources (like BDF, MMIO space) of the original pcie
> > domain, but it would cause some platforms like sbsa-ref are unable to
> > support the original number of PCIe devices. The new type provides a
> > solution to resolve the problem.
> > 
> > Signed-off-by: Yuquan Wang <wangyuquan1236@phytium.com.cn>
> 
> Likewise, this looks fine to me.  If the SBSA maintainers
> are happy with the approach and PCI folk think the more generic parts
> look fine then would be good to move this forwards.
> 
> Acked-by: Jonathan Cameron <jonathan.cameron@huawei.com>
>

Thanks for reviewing! I am very much looking forward to the maintainer of
PCI continuing to review this patch and providing relevant comments.

Yuquan



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

end of thread, other threads:[~2025-09-18  3:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-07 10:59 [RFC QEMU PATCH v4 0/2] cxl: Support creation of a new CXL Host Bridge wangyuquan
2025-08-07 10:59 ` [RFC QEMU PATCH v4 1/2] hw/pxb-cxl: Rename the pxb cxl host bridge wangyuquan
2025-09-17 16:32   ` Jonathan Cameron via
2025-08-07 10:59 ` [RFC QEMU PATCH v4 2/2] pci-host/cxl: Support creation of a new CXL Host Bridge wangyuquan
2025-09-17 16:37   ` Jonathan Cameron via
2025-09-18  2:59     ` Yuquan Wang

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).