[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 17/18] i386: Fix pkg_id offset for epyc mode
From: |
Babu Moger |
Subject: |
[PATCH v3 17/18] i386: Fix pkg_id offset for epyc mode |
Date: |
Tue, 03 Dec 2019 18:38:53 -0600 |
User-agent: |
StGit/unknown-version |
Signed-off-by: Babu Moger <address@hidden>
---
target/i386/cpu.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index e87487bae3..0eaedeb848 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -4456,7 +4456,7 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index,
uint32_t count,
{
X86CPU *cpu = env_archcpu(env);
CPUState *cs = env_cpu(env);
- uint32_t die_offset;
+ uint32_t die_offset, pkg_offset;
uint32_t limit;
uint32_t signature[3];
X86CPUTopoInfo topo_info;
@@ -4466,6 +4466,11 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index,
uint32_t count,
topo_info.cores_per_die = cs->nr_cores;
topo_info.threads_per_core = cs->nr_threads;
+ if (env->family_type == CPUX86FAMILY_EPYC)
+ pkg_offset = apicid_pkg_offset_epyc(&topo_info);
+ else
+ pkg_offset = apicid_pkg_offset(&topo_info);
+
/* Calculate & apply limits for different index ranges */
if (index >= 0xC0000000) {
limit = env->cpuid_xlevel2;
@@ -4647,7 +4652,7 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index,
uint32_t count,
*ecx |= CPUID_TOPOLOGY_LEVEL_SMT;
break;
case 1:
- *eax = apicid_pkg_offset(&topo_info);
+ *eax = pkg_offset;
*ebx = cs->nr_cores * cs->nr_threads;
*ecx |= CPUID_TOPOLOGY_LEVEL_CORE;
break;
@@ -4681,7 +4686,7 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index,
uint32_t count,
*ecx |= CPUID_TOPOLOGY_LEVEL_CORE;
break;
case 2:
- *eax = apicid_pkg_offset(&topo_info);
+ *eax = pkg_offset;
*ebx = env->nr_dies * cs->nr_cores * cs->nr_threads;
*ecx |= CPUID_TOPOLOGY_LEVEL_DIE;
break;
- [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 <=
- [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, 2019/12/03
- [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