]> www.infradead.org Git - users/dwmw2/qemu.git/commit
hw/riscv/virt.c: make aclint compatible with 'qtest' accel
authorDaniel Henrique Barboza <dbarboza@ventanamicro.com>
Sat, 17 Feb 2024 19:26:06 +0000 (16:26 -0300)
committerAlistair Francis <alistair.francis@wdc.com>
Fri, 8 Mar 2024 06:46:59 +0000 (16:46 +1000)
commitf2d44e9c1e530ee5005e650c91c28107f615c6ae
tree3d3f92ca2c009e9231d0bc3a55ec8a14c5c8e22d
parent7778cddddaeea98920589bb7ba91effd78f0cf04
hw/riscv/virt.c: make aclint compatible with 'qtest' accel

The 'virt' machine makes assumptions on the Advanced Core-Local
Interruptor, or aclint, based on 'tcg_enabled()' conditionals.  This
will impact MSI related tests support when adding a RISC-V 'virt' libqos
machine. The accelerator used in that case, 'qtest', isn't being
accounted for and we'll error out if we try to enable aclint.

Create a new virt_aclint_allowed() helper to gate the aclint code
considering both TCG and 'qtest' accelerators. The error message is
left untouched, mentioning TCG only, because we don't expect the
regular user to be aware of 'qtest'.

We want to add 'qtest' support for aclint only, leaving the TCG specific
bits out of it. This is done by changing the current format we use
today:

if (tcg_enabled()) {
   if (s->have_aclint) { - aclint logic - }
   else { - non-aclint, TCG logic - }
}

into:

if (virt_aclint_allowed() && s->have_aclint) {
 - aclint logic -
} else if (tcg_enabled()) {
 - non-aclint, TCG logic -
}

Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20240217192607.32565-6-dbarboza@ventanamicro.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
hw/riscv/virt.c