mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
hw/arm/virt: Consolidate GIC finalize logic
Up to now, the finalize_gic_version() code open coded what is essentially a support bitmap match between host/emulation environment and desired target GIC type. This open coding leads to undesirable side effects. For example, a VM with KVM and -smp 10 will automatically choose GICv3 while the same command line with TCG will stay on GICv2 and fail the launch. This patch combines the TCG and KVM matching code paths by making everything a 2 pass process. First, we determine which GIC versions the current environment is able to support, then we go through a single state machine to determine which target GIC mode that means for us. After this patch, the only user noticable changes should be consolidated error messages as well as TCG -M virt supporting -smp > 8 automatically. Signed-off-by: Alexander Graf <agraf@csgraf.de> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Reviewed-by: Zenghui Yu <yuzenghui@huawei.com> Message-id: 20221223090107.98888-2-agraf@csgraf.de Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
a2260983c6
commit
a3495d11c4
2 changed files with 112 additions and 101 deletions
|
@ -109,14 +109,19 @@ typedef enum VirtMSIControllerType {
|
|||
} VirtMSIControllerType;
|
||||
|
||||
typedef enum VirtGICType {
|
||||
VIRT_GIC_VERSION_MAX,
|
||||
VIRT_GIC_VERSION_HOST,
|
||||
VIRT_GIC_VERSION_2,
|
||||
VIRT_GIC_VERSION_3,
|
||||
VIRT_GIC_VERSION_4,
|
||||
VIRT_GIC_VERSION_MAX = 0,
|
||||
VIRT_GIC_VERSION_HOST = 1,
|
||||
/* The concrete GIC values have to match the GIC version number */
|
||||
VIRT_GIC_VERSION_2 = 2,
|
||||
VIRT_GIC_VERSION_3 = 3,
|
||||
VIRT_GIC_VERSION_4 = 4,
|
||||
VIRT_GIC_VERSION_NOSEL,
|
||||
} VirtGICType;
|
||||
|
||||
#define VIRT_GIC_VERSION_2_MASK BIT(VIRT_GIC_VERSION_2)
|
||||
#define VIRT_GIC_VERSION_3_MASK BIT(VIRT_GIC_VERSION_3)
|
||||
#define VIRT_GIC_VERSION_4_MASK BIT(VIRT_GIC_VERSION_4)
|
||||
|
||||
struct VirtMachineClass {
|
||||
MachineClass parent;
|
||||
bool disallow_affinity_adjustment;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue