Received: from eggs.gnu.org ([2001:4830:134:3::10]:55372) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1boykJ-0003Zf-50 for qemu-devel@nongnu.org; Tue, 27 Sep 2016 16:12:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1boykH-00071K-Sa for qemu-devel@nongnu.org; Tue, 27 Sep 2016 16:12:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59764) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1boykH-00070t-LU for qemu-devel@nongnu.org; Tue, 27 Sep 2016 16:12:53 -0400 From: Eduardo Habkost Date: Tue, 27 Sep 2016 17:12:17 -0300 Message-Id: <1475007150-14665-8-git-send-email-ehabkost@redhat.com> In-Reply-To: <1475007150-14665-1-git-send-email-ehabkost@redhat.com> References: <1475007150-14665-1-git-send-email-ehabkost@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 07/20] linux-user: remove #define smp_{cores, threads} List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Paolo Bonzini , Richard Henderson , qemu-devel@nongnu.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= From: Marc-Andr=C3=A9 Lureau Those are unneeded now that CPUState nr_{cores,threads} is always initialized. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Eduardo Habkost Acked-by: David Gibson Signed-off-by: Eduardo Habkost --- include/sysemu/cpus.h | 5 +---- target-i386/cpu.c | 8 ++++---- target-ppc/translate_init.c | 3 ++- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/include/sysemu/cpus.h b/include/sysemu/cpus.h index fe992a8..3728a1e 100644 --- a/include/sysemu/cpus.h +++ b/include/sysemu/cpus.h @@ -29,12 +29,9 @@ void qtest_clock_warp(int64_t dest); =20 #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 =20 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 7a5da99..a5d3b1a 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -2498,13 +2498,13 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t ind= ex, uint32_t count, =20 switch (count) { case 0: - *eax =3D apicid_core_offset(smp_cores, smp_threads); - *ebx =3D smp_threads; + *eax =3D apicid_core_offset(cs->nr_cores, cs->nr_threads); + *ebx =3D cs->nr_threads; *ecx |=3D CPUID_TOPOLOGY_LEVEL_SMT; break; case 1: - *eax =3D apicid_pkg_offset(smp_cores, smp_threads); - *ebx =3D smp_cores * smp_threads; + *eax =3D apicid_pkg_offset(cs->nr_cores, cs->nr_threads); + *ebx =3D cs->nr_cores * cs->nr_threads; *ecx |=3D CPUID_TOPOLOGY_LEVEL_CORE; break; default: diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c index 407ccb9..b66b40b 100644 --- a/target-ppc/translate_init.c +++ b/target-ppc/translate_init.c @@ -9943,7 +9943,8 @@ static void ppc_cpu_unrealizefn(DeviceState *dev, E= rror **errp) =20 int ppc_get_compat_smt_threads(PowerPCCPU *cpu) { - int ret =3D MIN(smp_threads, kvmppc_smt_threads()); + CPUState *cs =3D CPU(cpu); + int ret =3D MIN(cs->nr_threads, kvmppc_smt_threads()); =20 switch (cpu->cpu_version) { case CPU_POWERPC_LOGICAL_2_05: --=20 2.7.4