aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/sysemu/cpus.h5
-rw-r--r--target-i386/cpu.c8
-rw-r--r--target-ppc/translate_init.c3
3 files changed, 7 insertions, 9 deletions
diff --git a/include/sysemu/cpus.h b/include/sysemu/cpus.h
index fe992a8946..3728a1ea7e 100644
--- a/include/sysemu/cpus.h
+++ b/include/sysemu/cpus.h
@@ -29,12 +29,9 @@ void qtest_clock_warp(int64_t dest);
#ifndef CONFIG_USER_ONLY
/* vl.c */
+/* *-user doesn't have configurable SMP topology */
extern int smp_cores;
extern int smp_threads;
-#else
-/* *-user doesn't have configurable SMP topology */
-#define smp_cores 1
-#define smp_threads 1
#endif
void list_cpus(FILE *f, fprintf_function cpu_fprintf, const char *optarg);
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 7a5da99222..a5d3b1af75 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -2498,13 +2498,13 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
switch (count) {
case 0:
- *eax = apicid_core_offset(smp_cores, smp_threads);
- *ebx = smp_threads;
+ *eax = apicid_core_offset(cs->nr_cores, cs->nr_threads);
+ *ebx = cs->nr_threads;
*ecx |= CPUID_TOPOLOGY_LEVEL_SMT;
break;
case 1:
- *eax = apicid_pkg_offset(smp_cores, smp_threads);
- *ebx = smp_cores * smp_threads;
+ *eax = apicid_pkg_offset(cs->nr_cores, cs->nr_threads);
+ *ebx = cs->nr_cores * cs->nr_threads;
*ecx |= CPUID_TOPOLOGY_LEVEL_CORE;
break;
default:
diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
index 407ccb93a3..b66b40b82f 100644
--- a/target-ppc/translate_init.c
+++ b/target-ppc/translate_init.c
@@ -9943,7 +9943,8 @@ static void ppc_cpu_unrealizefn(DeviceState *dev, Error **errp)
int ppc_get_compat_smt_threads(PowerPCCPU *cpu)
{
- int ret = MIN(smp_threads, kvmppc_smt_threads());
+ CPUState *cs = CPU(cpu);
+ int ret = MIN(cs->nr_threads, kvmppc_smt_threads());
switch (cpu->cpu_version) {
case CPU_POWERPC_LOGICAL_2_05: