diff mbox series

[RFC,v3,1/9] hw/arm/virt: Disable cpu topology support on older machine types

Message ID 20210516102900.28036-2-wangyanan55@huawei.com
State New
Headers show
Series hw/arm/virt: Introduce cpu topology support | expand

Commit Message

wangyanan (Y) May 16, 2021, 10:28 a.m. UTC
Add a compat variable "no_cpu_topology" used to determine if
a machine type has enabled support of generating cpu topology
description for the guest. Also, for compatibility we disable
this support on older machine types.

On existing older machine types, without cpu topology description
in ACPI or DT, the guest will populate a cpu topology by default.
With the topology description exposed to the guest, it will read
the information and set up its topology as instructed, but that
may not be the same as what was getting used by default without
the topology description. It's possible that a user application
has a dependency on the default topology and if the default one
gets changed under its feat it will behave differently.

So in summary, we only enable support of this feature on the
latest machine type and disable it on the older ones (< 6.1)
to avoid possible problems.

Co-developed-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Yanan Wang <wangyanan55@huawei.com>
---
 hw/arm/virt.c         | 5 +++++
 include/hw/arm/virt.h | 2 ++
 2 files changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 0a78532018..c07841e3a4 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -2761,6 +2761,11 @@  DEFINE_VIRT_MACHINE_AS_LATEST(6, 1)
 
 static void virt_machine_6_0_options(MachineClass *mc)
 {
+    VirtMachineClass *vmc = VIRT_MACHINE_CLASS(OBJECT_CLASS(mc));
+
+    virt_machine_6_1_options(mc);
+    compat_props_add(mc->compat_props, hw_compat_6_0, hw_compat_6_0_len);
+    vmc->no_cpu_topology = true;
 }
 DEFINE_VIRT_MACHINE(6, 0)
 
diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h
index 921416f918..f546dd2023 100644
--- a/include/hw/arm/virt.h
+++ b/include/hw/arm/virt.h
@@ -129,6 +129,8 @@  struct VirtMachineClass {
     bool no_kvm_steal_time;
     bool acpi_expose_flash;
     bool no_secure_gpio;
+    /* Machines < 6.1 has no support of cpu topology description for guest */
+    bool no_cpu_topology;
 };
 
 struct VirtMachineState {