mirror of
https://gitlab.com/qemu-project/qemu.git
synced 2026-05-06 04:16:46 -04:00
hvf: arm: enable vGIC by default for virt-11.1 and later
Save states are incompatible between kernel-irqchip=on and off on HVF due to opaque vGIC state. Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr> Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org> Message-id: 20260429190532.26538-16-mohamed@unpredictable.fr Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
committed by
Peter Maydell
parent
6f8f25614d
commit
37863fff59
@@ -25,6 +25,7 @@
|
||||
bool hvf_allowed;
|
||||
bool hvf_kernel_irqchip;
|
||||
bool hvf_nested_virt;
|
||||
bool hvf_kernel_irqchip_override;
|
||||
|
||||
void hvf_nested_virt_enable(bool nested_virt)
|
||||
{
|
||||
@@ -204,6 +205,13 @@ static int hvf_accel_init(AccelState *as, MachineState *ms)
|
||||
}
|
||||
}
|
||||
|
||||
if (mc->get_kernel_irqchip_default) {
|
||||
bool kernel_irqchip_default = mc->get_kernel_irqchip_default(ms);
|
||||
if (!hvf_kernel_irqchip_override) {
|
||||
hvf_kernel_irqchip = kernel_irqchip_default;
|
||||
}
|
||||
}
|
||||
|
||||
ret = hvf_arch_vm_create(ms, (uint32_t)pa_range);
|
||||
if (ret == HV_DENIED) {
|
||||
error_report("Could not access HVF. Is the executable signed"
|
||||
@@ -230,6 +238,8 @@ static void hvf_set_kernel_irqchip(Object *obj, Visitor *v,
|
||||
Error **errp)
|
||||
{
|
||||
OnOffSplit mode;
|
||||
|
||||
hvf_kernel_irqchip_override = true;
|
||||
if (!visit_type_OnOffSplit(v, name, &mode, errp)) {
|
||||
return;
|
||||
}
|
||||
@@ -269,6 +279,7 @@ static void hvf_accel_class_init(ObjectClass *oc, const void *data)
|
||||
ac->init_machine = hvf_accel_init;
|
||||
ac->allowed = &hvf_allowed;
|
||||
ac->gdbstub_supported_sstep_flags = hvf_gdbstub_sstep_flags;
|
||||
hvf_kernel_irqchip_override = false;
|
||||
hvf_kernel_irqchip = false;
|
||||
object_class_property_add(oc, "kernel-irqchip", "on|off|split",
|
||||
NULL, hvf_set_kernel_irqchip,
|
||||
|
||||
@@ -3769,6 +3769,17 @@ static int virt_get_physical_address_range(MachineState *ms,
|
||||
return requested_ipa_size;
|
||||
}
|
||||
|
||||
static bool get_kernel_irqchip_default(const MachineState *ms)
|
||||
{
|
||||
VirtMachineState *vms = VIRT_MACHINE(ms);
|
||||
VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(vms);
|
||||
if (hvf_allowed) {
|
||||
return !vmc->hvf_no_kernel_irqchip_default;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
static const char *virt_get_default_cpu_type(const MachineState *ms)
|
||||
{
|
||||
return tcg_enabled() ? ARM_CPU_TYPE_NAME("cortex-a15")
|
||||
@@ -3835,6 +3846,7 @@ static void virt_machine_class_init(ObjectClass *oc, const void *data)
|
||||
mc->get_default_cpu_node_id = virt_get_default_cpu_node_id;
|
||||
mc->kvm_type = virt_kvm_type;
|
||||
mc->get_physical_address_range = virt_get_physical_address_range;
|
||||
mc->get_kernel_irqchip_default = get_kernel_irqchip_default;
|
||||
assert(!mc->get_hotplug_handler);
|
||||
mc->get_hotplug_handler = virt_machine_get_hotplug_handler;
|
||||
hc->pre_plug = virt_machine_device_pre_plug_cb;
|
||||
@@ -4079,8 +4091,11 @@ DEFINE_VIRT_MACHINE_AS_LATEST(11, 1)
|
||||
|
||||
static void virt_machine_11_0_options(MachineClass *mc)
|
||||
{
|
||||
VirtMachineClass *vmc = VIRT_MACHINE_CLASS(OBJECT_CLASS(mc));
|
||||
|
||||
virt_machine_11_1_options(mc);
|
||||
compat_props_add(mc->compat_props, hw_compat_11_0, hw_compat_11_0_len);
|
||||
vmc->hvf_no_kernel_irqchip_default = true;
|
||||
}
|
||||
DEFINE_VIRT_MACHINE(11, 0)
|
||||
|
||||
|
||||
@@ -138,6 +138,8 @@ struct VirtMachineClass {
|
||||
bool no_tcg_lpa2;
|
||||
bool no_ns_el2_virt_timer_irq;
|
||||
bool no_nested_smmu;
|
||||
/* HVF specific: support for kernel-irqchip=on introduced in QEMU 11.1 */
|
||||
bool hvf_no_kernel_irqchip_default;
|
||||
};
|
||||
|
||||
struct VirtMachineState {
|
||||
|
||||
@@ -280,6 +280,7 @@ struct MachineClass {
|
||||
int (*kvm_type)(MachineState *machine, const char *arg);
|
||||
int (*get_physical_address_range)(MachineState *machine,
|
||||
int default_ipa_size, int max_ipa_size);
|
||||
bool (*get_kernel_irqchip_default) (const MachineState *machine);
|
||||
|
||||
BlockInterfaceType block_default_type;
|
||||
int units_per_default_bus;
|
||||
|
||||
@@ -112,4 +112,5 @@ bool hvf_arch_cpu_realize(CPUState *cpu, Error **errp);
|
||||
uint32_t hvf_arch_get_default_ipa_bit_size(void);
|
||||
uint32_t hvf_arch_get_max_ipa_bit_size(void);
|
||||
|
||||
extern bool hvf_kernel_irqchip_override;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user