[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 09/18] i386: Add CPUX86Family type in CPUX86State
From: |
Babu Moger |
Subject: |
[PATCH v3 09/18] i386: Add CPUX86Family type in CPUX86State |
Date: |
Tue, 03 Dec 2019 18:37:58 -0600 |
User-agent: |
StGit/unknown-version |
Add CPUX86Family type in CPUX86State. This will be used to differentiate
generic x86 and x86 EPYC based cpu models.
Signed-off-by: Babu Moger <address@hidden>
---
hw/i386/pc.c | 4 ++++
target/i386/cpu.c | 1 +
target/i386/cpu.h | 7 +++++++
3 files changed, 12 insertions(+)
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 5dc11df922..7f30104a6b 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1398,6 +1398,8 @@ static void pc_new_cpu(PCMachineState *pcms, int64_t
apic_id, Error **errp)
env = &X86_CPU(cpu)->env;
env->nr_dies = pcms->smp_dies;
env->nr_nodes = ms->numa_state->num_nodes / ms->smp.sockets;
+ env->family_type = strncmp(ms->cpu_type, "EPYC", 4) ? CPUX86FAMILY_DEFAULT
:
+ CPUX86FAMILY_EPYC;
object_property_set_uint(cpu, apic_id, "apic-id", &local_err);
object_property_set_bool(cpu, true, "realized", &local_err);
@@ -2246,6 +2248,8 @@ static void pc_cpu_pre_plug(HotplugHandler *hotplug_dev,
env->nr_dies = pcms->smp_dies;
env->nr_nodes = ms->numa_state->num_nodes / ms->smp.sockets;
+ env->family_type = strncmp(ms->cpu_type, "EPYC", 4) ? CPUX86FAMILY_DEFAULT
:
+ CPUX86FAMILY_EPYC;
/*
* If APIC ID is not set,
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 9b2608a4c8..5629c6d4c1 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -5997,6 +5997,7 @@ static void x86_cpu_initfn(Object *obj)
env->nr_dies = 1;
env->nr_nodes = 1;
+ env->family_type = CPUX86FAMILY_DEFAULT;
cpu_set_cpustate_pointers(cpu);
object_property_add(obj, "family", "int",
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index 0ef4fdb55f..105744430b 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -1284,6 +1284,11 @@ typedef enum TPRAccess {
TPR_ACCESS_WRITE,
} TPRAccess;
+typedef enum CPUX86Family {
+ CPUX86FAMILY_DEFAULT = 0,
+ CPUX86FAMILY_EPYC,
+} CPUX86Family;
+
/* Cache information data structures: */
enum CacheType {
@@ -1590,6 +1595,8 @@ typedef struct CPUX86State {
TPRAccess tpr_access_type;
+ CPUX86Family family_type;
+
unsigned nr_dies;
unsigned nr_nodes;
} CPUX86State;
- [PATCH v3 00/18] APIC ID fixes for AMD EPYC CPU models, Babu Moger, 2019/12/03
- [PATCH v3 10/18] hw/386: Add EPYC mode topology decoding functions, Babu Moger, 2019/12/03
- [PATCH v3 17/18] i386: Fix pkg_id offset for epyc mode, Babu Moger, 2019/12/03
- [PATCH v3 18/18] tests: Update the Unit tests, Babu Moger, 2019/12/03
- [PATCH v3 14/18] hw/i386: Introduce topo_ids_from_apicid handler PCMachineState, Babu Moger, 2019/12/03
- [PATCH v3 09/18] i386: Add CPUX86Family type in CPUX86State,
Babu Moger <=
- [PATCH v3 15/18] hw/i386: Introduce apic_id_from_topo_ids handler in PCMachineState, Babu Moger, 2019/12/03
- [PATCH v3 11/18] i386: Cleanup and use the EPYC mode topology functions, Babu Moger, 2019/12/03
- [PATCH v3 04/18] hw/i386: Introduce initialize_topo_info to initialize X86CPUTopoInfo, Babu Moger, 2019/12/03
- [PATCH v3 02/18] hw/i386: Introduce X86CPUTopoInfo to contain topology info, Babu Moger, 2019/12/03
- [PATCH v3 16/18] hw/i386: Introduce EPYC mode function handlers, Babu Moger, 2019/12/03
- [PATCH v3 12/18] numa: Split the numa initialization, Babu Moger, 2019/12/03
- [PATCH v3 13/18] hw/i386: Introduce apicid_from_cpu_idx in PCMachineState, Babu Moger, 2019/12/03
- [PATCH v3 07/18] machine: Add a new function init_apicid_fn in MachineClass, Babu Moger, 2019/12/03
- [PATCH v3 08/18] hw/i386: Update structures for nodes_per_pkg, Babu Moger, 2019/12/03
- [PATCH v3 06/18] hw/core: Add core complex id in X86CPU topology, Babu Moger, 2019/12/03