hw/arm/virt: Link SMMUv3 CMDQV resources to platform bus
SMMUv3 devices with acceleration may enable CMDQV extensions after device realize. In that case, additional MMIO regions and IRQ lines may be registered but not yet mapped to the platform bus. Ensure SMMUv3 device resources are linked to the platform bus during machine_done(). This is safe to do unconditionally since the platform bus helpers skip resources that are already mapped. Reviewed-by: Eric Auger <eric.auger@redhat.com> Reviewed-by: Nicolin Chen <nicolinc@nvidia.com> Tested-by: Nicolin Chen <nicolinc@nvidia.com> Signed-off-by: Shameer Kolothum <skolothumtho@nvidia.com> Tested-by: Eric Auger <eric.auger@redhat.com> Message-id: 20260609112552.378999-13-skolothumtho@nvidia.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Shameer Kolothum committed
Jun 9, 2026 at 12:25 UTC
dc5726da05a4595338de0e9c3947beaf2e766552
1 file changed
+22
hw/arm/virt.c
+22
@@ -2361,6 +2361,25 @@ static void virt_build_smbios(VirtMachineState *vms)
2361
}
2362
}
2363
2364
+/*
2365
+ * SMMUv3 devices with acceleration may enable CMDQV extensions
2366
+ * after device realize. In that case, additional MMIO regions and
2367
+ * IRQ lines may be registered but not yet mapped to the platform bus.
2368
+ *
2369
+ * Ensure all resources are linked to the platform bus before final
2370
+ * machine setup.
2371
+ */
2372
+
2373
+static void virt_smmuv3_dev_link_cmdqv(VirtMachineState *vms)
2374
+{
2375
+ for (int i = 0; i < vms->smmuv3_devices->len; i++) {
2376
+ DeviceState *dev = g_ptr_array_index(vms->smmuv3_devices, i);
2377
+
2378
+ platform_bus_link_device(PLATFORM_BUS_DEVICE(vms->platform_bus_dev),
2379
+ SYS_BUS_DEVICE(dev));
2380
+ }
2381
+}
2382
+
2383
static
2384
void virt_machine_done(Notifier *notifier, void *data)
2385
{
@@ -2377,6 +2396,9 @@ void virt_machine_done(Notifier *notifier, void *data)
2396
if (vms->cxl_devices_state.is_enabled) {
2397
cxl_fmws_link_targets(&error_fatal);
2398
}
2399
+
2400
+ virt_smmuv3_dev_link_cmdqv(vms);
2401
+
2402
/*
2403
* If the user provided a dtb, we assume the dynamic sysbus nodes
2404
* already are integrated there. This corresponds to a use case where