diff mbox series

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

Message ID 20230421124142.2640825-2-berrange@redhat.com (mailing list archive)
State New, archived
Headers show
Series fix broken pxb-cxl realization | expand

Commit Message

Daniel P. Berrangé April 21, 2023, 12:41 p.m. UTC
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'

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 hw/pci-bridge/pci_expander_bridge.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Thomas Huth April 21, 2023, 12:47 p.m. UTC | #1
On 21/04/2023 14.41, Daniel P. Berrangé wrote:
> 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'
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>   hw/pci-bridge/pci_expander_bridge.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expander_bridge.c
> index ead33f0c05..a78327b5f2 100644
> --- a/hw/pci-bridge/pci_expander_bridge.c
> +++ b/hw/pci-bridge/pci_expander_bridge.c
> @@ -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/20230420142750.6950-2-Jonathan.Cameron@huawei.com/

  Thomas
diff mbox series

Patch

diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expander_bridge.c
index ead33f0c05..a78327b5f2 100644
--- a/hw/pci-bridge/pci_expander_bridge.c
+++ b/hw/pci-bridge/pci_expander_bridge.c
@@ -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 */