From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46916) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmDvi-0007d9-Pv for qemu-devel@nongnu.org; Tue, 20 Sep 2016 01:49:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bmDvc-0001Ko-Ka for qemu-devel@nongnu.org; Tue, 20 Sep 2016 01:49:16 -0400 Date: Tue, 20 Sep 2016 15:45:10 +1000 From: David Gibson Message-ID: <20160920054510.GS20488@umbus> References: <20160916155024.3932-1-marcandre.lureau@redhat.com> <20160916155024.3932-2-marcandre.lureau@redhat.com> <20160916193648.GQ6002@thinpad.lan.raisama.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="XMM+kVNHGkMezEqK" Content-Disposition: inline In-Reply-To: <20160916193648.GQ6002@thinpad.lan.raisama.net> Subject: Re: [Qemu-devel] [PATCH 2/2] linux-user: remove #define smp_{cores, threads} List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: =?iso-8859-1?Q?Marc-Andr=E9?= Lureau , qemu-devel@nongnu.org, pbonzini@redhat.com, rth@twiddle.net, Alexander Graf , qemu-ppc@nongnu.org --XMM+kVNHGkMezEqK Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 16, 2016 at 04:36:48PM -0300, Eduardo Habkost wrote: > On Fri, Sep 16, 2016 at 07:50:24PM +0400, Marc-Andr=E9 Lureau wrote: > > Those are unneeded now that CPUState nr_{cores,threads} is always > > initialized. > >=20 > > Signed-off-by: Marc-Andr=E9 Lureau >=20 > Reviewed-by: Eduardo Habkost >=20 > I will wait for at least an Acked-by from the PPC maintainers > before I merge it, though. As I've said elsewhere, I'm not entirely convinced that the vcpu structure is the place to keep this info. But since it's there, we might as well use it. Acked-by: David Gibson >=20 > > --- > > target-i386/cpu.c | 8 ++++---- > > target-ppc/translate_init.c | 3 ++- > > include/sysemu/cpus.h | 5 +---- > > 3 files changed, 7 insertions(+), 9 deletions(-) > >=20 > > diff --git a/target-i386/cpu.c b/target-i386/cpu.c > > index 5a5299a..e863bea 100644 > > --- a/target-i386/cpu.c > > +++ b/target-i386/cpu.c > > @@ -2490,13 +2490,13 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t i= ndex, 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,= Error **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: > > 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 *opta= rg); >=20 --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --XMM+kVNHGkMezEqK Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJX4MzjAAoJEGw4ysog2bOSpDgQAIuYTlh/EoOMsEjA6v2aWI7k qka8mFjPEA0CtUPxwoLTPog5ixeYqT2l3RbA9L+gvsuKJBF7HdvR3wOUjPwck2lG ySWU+us4/r+of4eUPjb4rPXUgXRMu4GzOJoN/5qTyg7lzzrejYjRWxZ3apeozZ6D 80pKoSjcHH7g1Z+4TZQ2hUZUcLj/XstfRK3FEk/Do4sE9+fwNn0ATkwLPN3/LAsH Hct6H9ct8nHO5anzKDf64sQG4FwrcIcmZ4sBkOHYYzWqrneuW7aq3Lx0wY9/z4g9 0ZbcEUhLqjWKDY95KLvFrQtpm7wtVXUosvfNBPYcJ7wdOPHe9ufES0a6abUvMzKu UMxvd+Y8JZMZYqjM6M+9ZfzyxHv5E0SK7A+0bhllZW4/QJXMkXoILfmhK2XzF66b 1mR0uxgnxicJx9cblGnKn2uuxWmgpLAHbgsNbq+VaLBasR5sNE53q1OjE7qGiG7B 1oCIbIvdXIctFWfzQeM2PZNHBblTCs6V7dxHJXa1/oh7/6F+RCeoYNMSeED3anSl vMcjJ7Waj+xqjcQXGQ3swBJhsmwR5weiTa1+t5PcdI2TEsj+YPj444aRinZgb0Hf XgGi5YM0vcLvQsMZkU/jS3YYvDUS01T1mFkkRavkNJXXzMtOaK3n8XCufFeQ/mB+ jNbj1tYLIG9RdXFyYwTV =JAkK -----END PGP SIGNATURE----- --XMM+kVNHGkMezEqK--