Skip to contentSkip to conversation

fix broken pxb-cxl realization

PATCH In review Daniel P. Berrangé 3 participants 6 messages Apr 21, 2023

lore
Share & tools
lore
#1 lore raw

PATCH 1/2 hw/pci-bridge: fix cast for pxb-cxl dev realization

In reply to Daniel P. Berrangé

Build QEMU --enable-qom-cast-debug and run a VM creating a pxb-cxl device:

 $ qemu-system-x86_64 -machine q35,cxl=on -device pxb-cxl,bus=pcie.0
 hw/pci-bridge/pci_expander_bridge.c:54:PXB_DEV: Object 0x555558313760 is not an instance of type pxb

This is seen when running 'tests/qtest/cxl-test'

---
 hw/pci-bridge/pci_expander_bridge.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/pci-bridge/pci_expander_bridge.c +1 -1
index ead33f0c05..a78327b5f2 100644
@@ -311,7 +311,7 @@ static void pxb_cxl_dev_reset(DeviceState *dev)
      * The CXL specification allows for host bridges with no HDM decoders
      * if they only have a single root port.
      */
-    if (!PXB_DEV(dev)->hdm_for_passthrough) {
+    if (!PXB_CXL_DEV(dev)->hdm_for_passthrough) {
         dsp_count = pcie_count_ds_ports(hb->bus);
     }
     /* Initial reset will have 0 dsp so wait until > 0 */
Signature · 1 line
2.39.1
#3 lore raw

PATCH 2/2 gitlab: run all jobs with QOM debugging enabled

In reply to Daniel P. Berrangé

The QMO cast debugging is designed to catch developer mistakes and as such should always be enabled during CI runs.

---
 .gitlab-ci.d/buildtest-template.yml | 1 +
 1 file changed, 1 insertion(+)
.gitlab-ci.d/buildtest-template.yml +1 -0
index a6cfe9be97..9151dece6f 100644
@@ -12,6 +12,7 @@
     - mkdir build
     - cd build
     - ../configure --enable-werror --disable-docs --enable-fdt=system
+          --enable-qom-cast-debug
           ${LD_JOBS:+--meson=git} ${TARGETS:+--target-list="$TARGETS"}
           $CONFIGURE_ARGS ||
       { cat config.log meson-logs/meson-log.txt && exit 1; }
Signature · 1 line
2.39.1
#0 lore raw

cover fix broken pxb-cxl realization

This flaw was discovered in Fedora builds which have --enable-qom-cast-debug enabled

Daniel P. Berrangé (2):
hw/pci-bridge: fix cast for pxb-cxl dev realization
gitlab: run all jobs with QOM debugging enabled

 .gitlab-ci.d/buildtest-template.yml | 1 +
 hw/pci-bridge/pci_expander_bridge.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
Signature · 1 line
2.39.1
#2 lore raw

Re: [PATCH 1/2] hw/pci-bridge: fix cast for pxb-cxl dev realization

In reply to Daniel P. Berrangé
Quoted 18 lines · Daniel P. Berrangé

Build QEMU --enable-qom-cast-debug and run a VM creating a pxb-cxl device:

  $ qemu-system-x86_64 -machine q35,cxl=on -device pxb-cxl,bus=pcie.0
  hw/pci-bridge/pci_expander_bridge.c:54:PXB_DEV: Object 0x555558313760 is not an instance of type pxb

This is seen when running 'tests/qtest/cxl-test'

---
  hw/pci-bridge/pci_expander_bridge.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
hw/pci-bridge/pci_expander_bridge.c +0 -0
index ead33f0c05..a78327b5f2 100644

hw/pci-bridge/pci_expander_bridge.c static void pxb_cxl_dev_reset(DeviceState *dev) · line 317

Quoted 8 lines
hw/pci-bridge/pci_expander_bridge.c +1 -1
@@ -311,7 +311,7 @@ static void pxb_cxl_dev_reset(DeviceState *dev)
       * The CXL specification allows for host bridges with no HDM decoders
       * if they only have a single root port.
       */
-    if (!PXB_DEV(dev)->hdm_for_passthrough) {
+    if (!PXB_CXL_DEV(dev)->hdm_for_passthrough) {
          dsp_count = pcie_count_ds_ports(hb->bus);
      }
      /* Initial reset will have 0 dsp so wait until > 0 */

The patch is already available here:

https://lore.kernel.org/qemu-devel/[email protected]/

Thomas

#4 lore raw

Re: [PATCH 2/2] gitlab: run all jobs with QOM debugging enabled

In reply to Daniel P. Berrangé
Quoted 13 lines · Daniel P. Berrangé

The QMO cast debugging is designed to catch developer mistakes and as such should always be enabled during CI runs.

---
  .gitlab-ci.d/buildtest-template.yml | 1 +
  1 file changed, 1 insertion(+)
.gitlab-ci.d/buildtest-template.yml +0 -0
index a6cfe9be97..9151dece6f 100644

.gitlab-ci.d/buildtest-template.yml line 18

Quoted 7 lines
.gitlab-ci.d/buildtest-template.yml +1 -0
@@ -12,6 +12,7 @@
      - mkdir build
      - cd build
      - ../configure --enable-werror --disable-docs --enable-fdt=system
+          --enable-qom-cast-debug
            ${LD_JOBS:+--meson=git} ${TARGETS:+--target-list="$TARGETS"}
            $CONFIGURE_ARGS ||
        { cat config.log meson-logs/meson-log.txt && exit 1; }

No, it's better to always enable it again, since it was just switched off by accident in the past:

https://lore.kernel.org/qemu-devel/[email protected]/

Thomas

#5 lore raw
In reply to Daniel P. Berrangé
Quoted 7 lines · Daniel P. Berrangé

This flaw was discovered in Fedora builds which have --enable-qom-cast-debug enabled

Daniel P. Berrangé (2):
hw/pci-bridge: fix cast for pxb-cxl dev realization
gitlab: run all jobs with QOM debugging enabled

How does this compare with

hw/pci-bridge: pci_expander_bridge: Fix wrong type and rework inheritance

posted yesterday to fix the same issue?

thanks
-- PMM