@@ -1409,6 +1409,18 @@ static void virt_machine_init(MachineState *machine)
RISCV_ACLINT_DEFAULT_MTIMECMP, RISCV_ACLINT_DEFAULT_MTIME,
RISCV_ACLINT_DEFAULT_TIMEBASE_FREQ, true);
}
+ } else {
+ /*
+ * With KVM enabled, check if the user wants to use AIA
+ * and we have the proper support for it.
+ */
+ RISCVCPU *cpu = &s->soc[i].harts[0];
+
+ if (s->aia_type != VIRT_AIA_TYPE_NONE && !cpu->cfg.ext_ssaia) {
+ error_report("Unable to set AIA: host does not "
+ "have extension 'ssaia' enabled");
+ exit(1);
+ }
}
/* Per-socket interrupt controller */
KVM AIA relies on ext_ssaia support present in the host. At this moment we're not checking. A KVM guest is doomed to hung if we use any 'aia' option, aside from 'aia=none', and KVM does not support 'ssaia'. Add a check for it. The placement is intentional: we need to check before riscv_imsic_realize(), where the TCG logic can force cpu->cfg.ext_ssaia to be 'true' and overwrite what KVM set before. Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com> --- hw/riscv/virt.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)