]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
linux-user: remove #define smp_{cores, threads}
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Fri, 16 Sep 2016 15:50:24 +0000 (19:50 +0400)
committerEduardo Habkost <ehabkost@redhat.com>
Tue, 27 Sep 2016 19:17:17 +0000 (16:17 -0300)
Those are unneeded now that CPUState nr_{cores,threads} is always
initialized.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
include/sysemu/cpus.h
target-i386/cpu.c
target-ppc/translate_init.c

index fe992a8946ed599b7163721851aae3e62eeabf12..3728a1ea7e4f396830d7c387ca3d581c0ef941d5 100644 (file)
@@ -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);
index 7a5da99222e6c815d836222218816b168061a187..a5d3b1af7579e2ce979adc9dbe92615400a88afc 100644 (file)
@@ -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:
index 407ccb93a3ee75d102c1dd83d2041612ae4d95bf..b66b40b82f08bd17bc507e3822773157aa610d2b 100644 (file)
@@ -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: