[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 04/11] hw/arm: Restrit KVM to the virt & versal machines
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v2 04/11] hw/arm: Restrit KVM to the virt & versal machines |
Date: |
Fri, 19 Feb 2021 18:38:40 +0100 |
Restrit KVM to the following ARM machines:
- virt
- xlnx-versal-virt
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
hw/arm/virt.c | 5 +++++
hw/arm/xlnx-versal-virt.c | 5 +++++
2 files changed, 10 insertions(+)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 371147f3ae9..8e9861b61a9 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -2527,6 +2527,10 @@ static HotplugHandler
*virt_machine_get_hotplug_handler(MachineState *machine,
return NULL;
}
+static const char *const valid_accels[] = {
+ "tcg", "kvm", "hvf", NULL
+};
+
/*
* for arm64 kvm_type [7-0] encodes the requested number of bits
* in the IPA address space
@@ -2582,6 +2586,7 @@ static void virt_machine_class_init(ObjectClass *oc, void
*data)
mc->cpu_index_to_instance_props = virt_cpu_index_to_props;
mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-a15");
mc->get_default_cpu_node_id = virt_get_default_cpu_node_id;
+ mc->valid_accelerators = valid_accels;
mc->kvm_type = virt_kvm_type;
assert(!mc->get_hotplug_handler);
mc->get_hotplug_handler = virt_machine_get_hotplug_handler;
diff --git a/hw/arm/xlnx-versal-virt.c b/hw/arm/xlnx-versal-virt.c
index 8482cd61960..d424813cae1 100644
--- a/hw/arm/xlnx-versal-virt.c
+++ b/hw/arm/xlnx-versal-virt.c
@@ -610,6 +610,10 @@ static void versal_virt_machine_instance_init(Object *obj)
{
}
+static const char *const valid_accels[] = {
+ "tcg", "kvm", NULL
+};
+
static void versal_virt_machine_class_init(ObjectClass *oc, void *data)
{
MachineClass *mc = MACHINE_CLASS(oc);
@@ -621,6 +625,7 @@ static void versal_virt_machine_class_init(ObjectClass *oc,
void *data)
mc->default_cpus = XLNX_VERSAL_NR_ACPUS;
mc->no_cdrom = true;
mc->default_ram_id = "ddr";
+ mc->valid_accelerators = valid_accels;
}
static const TypeInfo versal_virt_machine_init_typeinfo = {
--
2.26.2
- Re: [PATCH v2 01/11] accel/kvm: Check MachineClass kvm_type() return value, (continued)
[PATCH v2 02/11] hw/boards: Introduce machine_class_valid_for_accelerator(), Philippe Mathieu-Daudé, 2021/02/19
[PATCH v2 03/11] hw/core: Restrict 'query-machines' to those supported by current accel, Philippe Mathieu-Daudé, 2021/02/19
[PATCH v2 04/11] hw/arm: Restrit KVM to the virt & versal machines,
Philippe Mathieu-Daudé <=
[PATCH v2 05/11] hw/mips: Restrict KVM to the malta & virt machines, Philippe Mathieu-Daudé, 2021/02/19
[RFC PATCH v2 06/11] hw/ppc: Restrict KVM to various PPC machines, Philippe Mathieu-Daudé, 2021/02/19
[PATCH v2 07/11] hw/s390x: Explicit the s390-ccw-virtio machines support TCG and KVM, Philippe Mathieu-Daudé, 2021/02/19
[RFC PATCH v2 08/11] hw/i386: Explicit x86 machines support all current accelerators, Philippe Mathieu-Daudé, 2021/02/19