[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC 38/52] i386: Introduce hybrid_core_type to CPUX86State
From: |
Zhao Liu |
Subject: |
[RFC 38/52] i386: Introduce hybrid_core_type to CPUX86State |
Date: |
Mon, 13 Feb 2023 17:50:21 +0800 |
From: Zhao Liu <zhao1.liu@intel.com>
Currently, x86 only supports two hybrid core types: Intel Core and Intel
Atom [1], so add the core type definations for Intel Core and Intel
Atom, and add hybrid_core_type in CPUX86State.
[1]: SDM, vol.2, ch.3, 3.3 Instructions (A-L), CPUID, CPUID.1AH:EAX[bits
31-24].
Co-Developed-by: Zhuocheng Ding <zhuocheng.ding@intel.com>
Signed-off-by: Zhuocheng Ding <zhuocheng.ding@intel.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
---
hw/i386/x86.c | 4 ++++
target/i386/cpu.c | 1 +
target/i386/cpu.h | 8 ++++++++
3 files changed, 13 insertions(+)
diff --git a/hw/i386/x86.c b/hw/i386/x86.c
index a09df6d33fff..f381fdc43180 100644
--- a/hw/i386/x86.c
+++ b/hw/i386/x86.c
@@ -383,6 +383,7 @@ void x86_cpu_pre_plug(HotplugHandler *hotplug_dev,
CPUArchId *cpu_slot;
X86CPUTopoIDs topo_ids;
X86CPU *cpu = X86_CPU(dev);
+ CPUX86State *env = &cpu->env;
MachineState *ms = MACHINE(hotplug_dev);
X86MachineState *x86ms = X86_MACHINE(hotplug_dev);
X86ApicidTopoInfo apicid_topo;
@@ -564,6 +565,9 @@ void x86_cpu_pre_plug(HotplugHandler *hotplug_dev,
return;
}
+ env->hybrid_core_type =
+ machine_topo_get_hybrid_core_type(ms, cpu->cluster_id, cpu->core_id);
+
cs = CPU(cpu);
cs->cpu_index = idx;
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 7d6722ab3292..266e981b79e2 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -6845,6 +6845,7 @@ static void x86_cpu_initfn(Object *obj)
X86CPUClass *xcc = X86_CPU_GET_CLASS(obj);
CPUX86State *env = &cpu->env;
+ env->hybrid_core_type = INVALID_HYBRID_TYPE;
cpu_set_cpustate_pointers(cpu);
object_property_add(obj, "feature-words", "X86CPUFeatureWordInfo",
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index 30b2aa6ab10d..bb4e370f9768 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -1543,6 +1543,12 @@ typedef struct CPUCaches {
CPUCacheInfo *l3_cache;
} CPUCaches;
+typedef enum {
+ INVALID_HYBRID_TYPE = 0,
+ INTEL_ATOM_TYPE,
+ INTEL_CORE_TYPE,
+} X86HybridCoreType;
+
typedef struct HVFX86LazyFlags {
target_ulong result;
target_ulong auxbits;
@@ -1825,6 +1831,8 @@ typedef struct CPUArchState {
uint32_t umwait;
TPRAccess tpr_access_type;
+
+ X86HybridCoreType hybrid_core_type;
} CPUX86State;
struct kvm_msrs;
--
2.34.1
- [RFC 32/52] i386: Rename X86CPUTopoInfo and its members to reflect relationship with APIC ID, (continued)
- [RFC 32/52] i386: Rename X86CPUTopoInfo and its members to reflect relationship with APIC ID, Zhao Liu, 2023/02/13
- [RFC 35/52] i386: Support APIC ID topology for hybrid CPU topology, Zhao Liu, 2023/02/13
- [RFC 33/52] i386: Rename init_topo_info() to init_apic_topo_info(), Zhao Liu, 2023/02/13
- [RFC 34/52] i386: Rename variable topo_info to apicid_topo, Zhao Liu, 2023/02/13
- [RFC 36/52] i386: Use init_apicid_topo_info() to initialize APIC ID topology for system emulator, Zhao Liu, 2023/02/13
- [RFC 38/52] i386: Introduce hybrid_core_type to CPUX86State,
Zhao Liu <=
- [RFC 37/52] i386: Update X86CPUTopoIDs generating rule for hybrid topology, Zhao Liu, 2023/02/13
- [RFC 41/52] machine: Introduce core_type() hook, Zhao Liu, 2023/02/13
- [RFC 42/52] hw/machine: Add hybrid_supported in generic topo properties, Zhao Liu, 2023/02/13