hw/riscv/virt: Restrict ACLINT to TCG
The Advanced Core Local Interruptor (ACLINT) device can only be used with TCG. Check for TCG enabled instead of KVM being not. Only add the property when TCG is used. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-Id: <20230629121103.87733-3-philmd@linaro.org> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
parent
b227f6a8a7
commit
c0716c81b2
@ -93,6 +93,7 @@ The following machine-specific options are supported:
|
|||||||
|
|
||||||
When this option is "on", ACLINT devices will be emulated instead of
|
When this option is "on", ACLINT devices will be emulated instead of
|
||||||
SiFive CLINT. When not specified, this option is assumed to be "off".
|
SiFive CLINT. When not specified, this option is assumed to be "off".
|
||||||
|
This option is restricted to the TCG accelerator.
|
||||||
|
|
||||||
- aia=[none|aplic|aplic-imsic]
|
- aia=[none|aplic|aplic-imsic]
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@
|
|||||||
#include "chardev/char.h"
|
#include "chardev/char.h"
|
||||||
#include "sysemu/device_tree.h"
|
#include "sysemu/device_tree.h"
|
||||||
#include "sysemu/sysemu.h"
|
#include "sysemu/sysemu.h"
|
||||||
|
#include "sysemu/tcg.h"
|
||||||
#include "sysemu/kvm.h"
|
#include "sysemu/kvm.h"
|
||||||
#include "sysemu/tpm.h"
|
#include "sysemu/tpm.h"
|
||||||
#include "hw/pci/pci.h"
|
#include "hw/pci/pci.h"
|
||||||
@ -776,7 +777,7 @@ static void create_fdt_sockets(RISCVVirtState *s, const MemMapEntry *memmap,
|
|||||||
|
|
||||||
g_free(clust_name);
|
g_free(clust_name);
|
||||||
|
|
||||||
if (!kvm_enabled()) {
|
if (tcg_enabled()) {
|
||||||
if (s->have_aclint) {
|
if (s->have_aclint) {
|
||||||
create_fdt_socket_aclint(s, memmap, socket,
|
create_fdt_socket_aclint(s, memmap, socket,
|
||||||
&intc_phandles[phandle_pos]);
|
&intc_phandles[phandle_pos]);
|
||||||
@ -1370,7 +1371,7 @@ static void virt_machine_init(MachineState *machine)
|
|||||||
hart_count, &error_abort);
|
hart_count, &error_abort);
|
||||||
sysbus_realize(SYS_BUS_DEVICE(&s->soc[i]), &error_fatal);
|
sysbus_realize(SYS_BUS_DEVICE(&s->soc[i]), &error_fatal);
|
||||||
|
|
||||||
if (!kvm_enabled()) {
|
if (tcg_enabled()) {
|
||||||
if (s->have_aclint) {
|
if (s->have_aclint) {
|
||||||
if (s->aia_type == VIRT_AIA_TYPE_APLIC_IMSIC) {
|
if (s->aia_type == VIRT_AIA_TYPE_APLIC_IMSIC) {
|
||||||
/* Per-socket ACLINT MTIMER */
|
/* Per-socket ACLINT MTIMER */
|
||||||
@ -1682,12 +1683,13 @@ static void virt_machine_class_init(ObjectClass *oc, void *data)
|
|||||||
machine_class_allow_dynamic_sysbus_dev(mc, TYPE_TPM_TIS_SYSBUS);
|
machine_class_allow_dynamic_sysbus_dev(mc, TYPE_TPM_TIS_SYSBUS);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
object_class_property_add_bool(oc, "aclint", virt_get_aclint,
|
if (tcg_enabled()) {
|
||||||
virt_set_aclint);
|
object_class_property_add_bool(oc, "aclint", virt_get_aclint,
|
||||||
object_class_property_set_description(oc, "aclint",
|
virt_set_aclint);
|
||||||
"Set on/off to enable/disable "
|
object_class_property_set_description(oc, "aclint",
|
||||||
"emulating ACLINT devices");
|
"Set on/off to enable/disable "
|
||||||
|
"emulating ACLINT devices");
|
||||||
|
}
|
||||||
object_class_property_add_str(oc, "aia", virt_get_aia,
|
object_class_property_add_str(oc, "aia", virt_get_aia,
|
||||||
virt_set_aia);
|
virt_set_aia);
|
||||||
object_class_property_set_description(oc, "aia",
|
object_class_property_set_description(oc, "aia",
|
||||||
|
Loading…
Reference in New Issue
Block a user