qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC 09/52] hw/machine: Introduce core type for hybrid topology


From: Philippe Mathieu-Daudé
Subject: Re: [RFC 09/52] hw/machine: Introduce core type for hybrid topology
Date: Mon, 13 Feb 2023 14:13:40 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.7.2

On 13/2/23 10:49, Zhao Liu wrote:
From: Zhao Liu <zhao1.liu@intel.com>

Under the hybrid cpu topology, some CPUs care about the core type.
For example, Intel's Alder Lake series CPU contains two types of cores:
Intel Core and Intel Atom. The type information of these two types is
exposed in 1A leaf of CPUID.

Core type should also be part of the hybrid topology, and
MachineState.cpu_type cannot provide different type information for
different cpus in the same machine, so add a type field for the core
level in the hybrid cpu topology.

Additionally, add a helper to get core type information from
MachineState. Though core_type is only used in hybrid case, don't
use assert since it may be used to initialize some generic fields.

Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
---
  hw/core/machine-topo.c        | 12 ++++++++++++
  include/hw/boards.h           |  3 +++
  include/hw/cpu/cpu-topology.h |  2 ++
  3 files changed, 17 insertions(+)

diff --git a/hw/core/machine-topo.c b/hw/core/machine-topo.c
index b20160479629..e0ec07b53d42 100644
--- a/hw/core/machine-topo.c
+++ b/hw/core/machine-topo.c
@@ -51,6 +51,18 @@ unsigned int machine_topo_get_smp_threads(const MachineState 
*ms)
      return ms->topo.smp.threads;
  }
+unsigned int machine_topo_get_hybrid_core_type(const MachineState *ms,
+                                               unsigned int cluster_id,
+                                               unsigned int core_id)
+{
+    if (!machine_topo_is_smp(ms)) {
+        return ms->topo.hybrid.cluster_list[cluster_id]
+                       .core_list[core_id].core_type;
+    } else {
+        return 0;

Is '0' an invalid type?

+    }
+}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]