qemu/hw/cxl
Zhao Liu 8bfe0f8dda hw/cxl/cxl-host: Fix segmentation fault when getting cxl-fmw property
QEMU crashes (Segmentation fault) when getting cxl-fmw property via
qmp:

(QEMU) qom-get path=machine property=cxl-fmw

This issue is caused by accessing wrong callback (opaque) type in
machine_get_cfmw().

cxl_machine_init() sets the callback as `CXLState *` type but
machine_get_cfmw() treats the callback as
`CXLFixedMemoryWindowOptionsList **`.

Fix this error by casting opaque to `CXLState *` type in
machine_get_cfmw().

Fixes: 03b39fcf64 ("hw/cxl: Make the CXL fixed memory window setup a machine parameter.")
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Li Zhijian <lizhijian@fujitsu.com>
Reviewed-by: Xingtao Yao <yaoxt.fnst@fujitsu.com>
Link: https://lore.kernel.org/r/20240704093404.1848132-1-zhao1.liu@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Message-Id: <20240705113956.941732-2-Jonathan.Cameron@huawei.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit a207d5f87d)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2024-07-24 07:31:14 +03:00
..
cxl-cdat.c cxl/cdat: Fix header sum value in CDAT checksum 2024-02-14 21:40:14 +03:00
cxl-component-utils.c hw/cxl: Pass CXLComponentState to cache_mem_ops 2024-02-14 21:42:08 +03:00
cxl-device-utils.c hw/cxl: Add stub write function for RO MemoryRegionOps entries. 2022-08-17 13:08:11 -04:00
cxl-host-stubs.c pci/pci_expander_bridge: For CXL HB delay the HB register memory region setup. 2022-06-09 19:32:49 -04:00
cxl-host.c hw/cxl/cxl-host: Fix segmentation fault when getting cxl-fmw property 2024-07-24 07:31:14 +03:00
cxl-mailbox-utils.c hw/cxl: Correctly handle variable sized mailbox input payloads. 2022-08-17 13:08:11 -04:00
Kconfig hw/cxl/component: Introduce CXL components (8.1.x, 8.2.5) 2022-05-13 06:13:35 -04:00
meson.build hw/cxl/cdat: CXL CDAT Data Object Exchange implementation 2022-11-07 13:12:19 -05:00