On 20/1/26 19:03, Peter Maydell wrote:
The virt board might have multiple different ways to handle MSI
interrupts: via an ITS, via the GICv2M device, or not at all. The
logic to select which of these we use is confusing because it is
controlled by a mix of versioned-board compatibility flags, board
option flags, and open-coded logic inside the create_gic() and
create_its() functions.
Currently we set VirtMachineState::msi_controller as the very last
part of this, inside create_its() or create_gicv2m(). This field is
then used only in the hotplug pre-plug callback function.
As a first step in making this clearer to understand, move the logic
into a single finalize_msi_controller() function, which sets
VirtMachineState::msi_controller. The actual machine creation code
can then look only at that field. (This is a parallel to what we do
with the GIC, where finalize_gic_version() sets the
VirtMachineState::gic_version field.)
Signed-off-by: Peter Maydell <[email protected]>
---
hw/arm/virt.c | 38 +++++++++++++++++++++++++++-----------
1 file changed, 27 insertions(+), 11 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>