[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 05/11] hw/mips: Restrict KVM to the malta & virt machines
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v2 05/11] hw/mips: Restrict KVM to the malta & virt machines |
Date: |
Fri, 19 Feb 2021 18:38:41 +0100 |
Restrit KVM to the following MIPS machines:
- malta
- loongson3-virt
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
hw/mips/loongson3_virt.c | 5 +++++
hw/mips/malta.c | 5 +++++
2 files changed, 10 insertions(+)
diff --git a/hw/mips/loongson3_virt.c b/hw/mips/loongson3_virt.c
index d4a82fa5367..c3679dff043 100644
--- a/hw/mips/loongson3_virt.c
+++ b/hw/mips/loongson3_virt.c
@@ -612,6 +612,10 @@ static void mips_loongson3_virt_init(MachineState *machine)
loongson3_virt_devices_init(machine, liointc);
}
+static const char *const valid_accels[] = {
+ "tcg", "kvm", NULL
+};
+
static void loongson3v_machine_class_init(ObjectClass *oc, void *data)
{
MachineClass *mc = MACHINE_CLASS(oc);
@@ -622,6 +626,7 @@ static void loongson3v_machine_class_init(ObjectClass *oc,
void *data)
mc->max_cpus = LOONGSON_MAX_VCPUS;
mc->default_ram_id = "loongson3.highram";
mc->default_ram_size = 1600 * MiB;
+ mc->valid_accelerators = valid_accels;
mc->kvm_type = mips_kvm_type;
mc->minimum_page_bits = 14;
}
diff --git a/hw/mips/malta.c b/hw/mips/malta.c
index 9afc0b427bf..0212048dc63 100644
--- a/hw/mips/malta.c
+++ b/hw/mips/malta.c
@@ -1443,6 +1443,10 @@ static const TypeInfo mips_malta_device = {
.instance_init = mips_malta_instance_init,
};
+static const char *const valid_accels[] = {
+ "tcg", "kvm", NULL
+};
+
static void mips_malta_machine_init(MachineClass *mc)
{
mc->desc = "MIPS Malta Core LV";
@@ -1456,6 +1460,7 @@ static void mips_malta_machine_init(MachineClass *mc)
mc->default_cpu_type = MIPS_CPU_TYPE_NAME("24Kf");
#endif
mc->default_ram_id = "mips_malta.ram";
+ mc->valid_accelerators = valid_accels;
}
DEFINE_MACHINE("malta", mips_malta_machine_init)
--
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é, 2021/02/19
[PATCH v2 05/11] hw/mips: Restrict KVM to the malta & virt machines,
Philippe Mathieu-Daudé <=
[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
[PATCH v2 09/11] hw/xenpv: Restrict Xen Para-virtualized machine to Xen accelerator, Philippe Mathieu-Daudé, 2021/02/19