The create_gic() function also creates the MSI controller; however
there isn't really a strong linkage here, and for the GICv5 it will
be more convenient to separate it out. Move it to a new
create_msi_controller() function.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id:
20260327111700.795099-58-peter.maydell@linaro.org
}
fdt_add_gic_node(vms);
+}
- if (vms->msi_controller == VIRT_MSI_CTRL_ITS) {
+static void create_msi_controller(VirtMachineState *vms)
+{
+ switch (vms->msi_controller) {
+ case VIRT_MSI_CTRL_ITS:
create_its(vms);
- } else if (vms->msi_controller == VIRT_MSI_CTRL_GICV2M) {
+ break;
+ case VIRT_MSI_CTRL_GICV2M:
create_v2m(vms);
+ break;
+ case VIRT_MSI_CTRL_NONE:
+ break;
+ default:
+ g_assert_not_reached();
}
}
virt_flash_fdt(vms, sysmem, secure_sysmem ?: sysmem);
create_gic(vms, sysmem);
+ create_msi_controller(vms);
virt_post_cpus_gic_realized(vms, sysmem);