From: David Gibson <david@gibson.dropbear.id.au>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>,
qemu-devel@nongnu.org, pbonzini@redhat.com, rth@twiddle.net,
"Alexander Graf" <agraf@suse.de>,
qemu-ppc@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/2] linux-user: remove #define smp_{cores, threads}
Date: Tue, 20 Sep 2016 15:45:10 +1000 [thread overview]
Message-ID: <20160920054510.GS20488@umbus> (raw)
In-Reply-To: <20160916193648.GQ6002@thinpad.lan.raisama.net>
[-- Attachment #1: Type: text/plain, Size: 3277 bytes --]
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é Lureau wrote:
> > 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>
>
> 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 <david@gibson.dropbear.id.au>
>
> > ---
> > target-i386/cpu.c | 8 ++++----
> > target-ppc/translate_init.c | 3 ++-
> > include/sysemu/cpus.h | 5 +----
> > 3 files changed, 7 insertions(+), 9 deletions(-)
> >
> > 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 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 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)
> >
> > 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:
> > 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);
> >
> > #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);
>
--
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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2016-09-20 5:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-16 15:50 [Qemu-devel] [PATCH 1/2] linux-user-i386: fix crash on cpuid Marc-André Lureau
2016-09-16 15:50 ` [Qemu-devel] [PATCH 2/2] linux-user: remove #define smp_{cores, threads} Marc-André Lureau
2016-09-16 19:36 ` Eduardo Habkost
2016-09-20 5:45 ` David Gibson [this message]
2016-09-16 17:28 ` [Qemu-devel] [PATCH 1/2] linux-user-i386: fix crash on cpuid Eduardo Habkost
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160920054510.GS20488@umbus \
--to=david@gibson.dropbear.id.au \
--cc=agraf@suse.de \
--cc=ehabkost@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=rth@twiddle.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.