From: Greg Kurz <groug@kaod.org>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: Eduardo Habkost <ehabkost@redhat.com>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
qemu-devel@nongnu.org, Alexander Graf <agraf@suse.de>,
qemu-ppc@nongnu.org, Cedric Le Goater <clg@kaod.org>,
Bharata B Rao <bharata@linux.vnet.ibm.com>,
Scott Wood <scottwood@freescale.com>,
Igor Mammedov <imammedo@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v3 2/7] ppc: move smp_threads sanity checks to spapr
Date: Thu, 7 Jul 2016 08:49:15 +0200 [thread overview]
Message-ID: <20160707084915.2117d556@bahia.lan> (raw)
In-Reply-To: <20160707011242.GH14675@voom.fritz.box>
[-- Attachment #1: Type: text/plain, Size: 2869 bytes --]
On Thu, 7 Jul 2016 11:12:42 +1000
David Gibson <david@gibson.dropbear.id.au> wrote:
> On Wed, Jul 06, 2016 at 02:13:30PM +0200, Greg Kurz wrote:
> > Only POWER5 and newer PowerPC cpus from IBM have SMT capabilities.
> > Since they are only supported by pseries, let's move the checks to
> > ppc_spapr_init().
> >
> > Signed-off-by: Greg Kurz <groug@kaod.org>
>
> I'm not comfortable with this. SMT may only be used for pseries at
> the moment, but the SMT possibilities are absolutely a constraint of
> the CPU itself, not the machine type. It seems more logical to me to
> check this in the CPU code.
>
Yes, you're right. Ans since this isn't a prerequisite to compute cpu_dt_id,
it can stay in ppc_cpu_realizefn().
I'll drop this patch in v4.
> > ---
> > hw/ppc/spapr.c | 12 ++++++++++++
> > target-ppc/translate_init.c | 14 --------------
> > 2 files changed, 12 insertions(+), 14 deletions(-)
> >
> > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> > index d134eb2f338e..09600fee19b2 100644
> > --- a/hw/ppc/spapr.c
> > +++ b/hw/ppc/spapr.c
> > @@ -1739,6 +1739,18 @@ static void ppc_spapr_init(MachineState *machine)
> > }
> > }
> >
> > + if (smp_threads > smt) {
> > + error_report("Cannot support more than %d threads on PPC with %s",
> > + smt, kvm_enabled() ? "KVM" : "TCG");
> > + exit(1);
> > + }
> > + if (!is_power_of_2(smp_threads)) {
> > + error_report("Cannot support %d threads on PPC with %s, "
> > + "threads count must be a power of 2.",
> > + smp_threads, kvm_enabled() ? "KVM" : "TCG");
> > + exit(1);
> > + }
> > +
> > msi_nonbroken = true;
> >
> > QLIST_INIT(&spapr->phbs);
> > diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
> > index 31120a5aaf33..775df72cf6c2 100644
> > --- a/target-ppc/translate_init.c
> > +++ b/target-ppc/translate_init.c
> > @@ -9531,20 +9531,6 @@ static void ppc_cpu_realizefn(DeviceState *dev, Error **errp)
> > int max_smt = kvmppc_smt_threads();
> > #endif
> >
> > -#if !defined(CONFIG_USER_ONLY)
> > - if (smp_threads > max_smt) {
> > - error_setg(errp, "Cannot support more than %d threads on PPC with %s",
> > - max_smt, kvm_enabled() ? "KVM" : "TCG");
> > - return;
> > - }
> > - if (!is_power_of_2(smp_threads)) {
> > - error_setg(errp, "Cannot support %d threads on PPC with %s, "
> > - "threads count must be a power of 2.",
> > - smp_threads, kvm_enabled() ? "KVM" : "TCG");
> > - return;
> > - }
> > -#endif
> > -
> > cpu_exec_init(cs, &local_err);
> > if (local_err != NULL) {
> > error_propagate(errp, local_err);
> >
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
next prev parent reply other threads:[~2016-07-07 6:49 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-06 12:12 [Qemu-devel] [PATCH v3 0/7] ppc: compute cpu_dt_id in the machine code Greg Kurz
2016-07-06 12:13 ` [Qemu-devel] [PATCH v3 1/7] ppc: different creation paths for cpus in system and user mode Greg Kurz
2016-07-07 1:11 ` David Gibson
2016-07-06 12:13 ` [Qemu-devel] [PATCH v3 2/7] ppc: move smp_threads sanity checks to spapr Greg Kurz
2016-07-07 1:12 ` David Gibson
2016-07-07 1:57 ` Benjamin Herrenschmidt
2016-07-07 2:05 ` David Gibson
2016-07-07 7:15 ` Greg Kurz
2016-07-07 6:49 ` Greg Kurz [this message]
2016-07-06 12:13 ` [Qemu-devel] [PATCH v3 3/7] ppc: parse cpu features once Greg Kurz
2016-07-06 12:14 ` [Qemu-devel] [PATCH v3 4/7] ppc: open code cpu creation for machine types Greg Kurz
2016-07-06 16:06 ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2016-07-07 1:59 ` David Gibson
2016-07-07 1:54 ` [Qemu-devel] " David Gibson
2016-07-06 12:14 ` [Qemu-devel] [PATCH v3 5/7] ppc: each machine type to provide vcpu_dt_id Greg Kurz
2016-07-07 2:01 ` David Gibson
2016-07-07 8:55 ` Greg Kurz
2016-07-08 1:57 ` David Gibson
2016-07-08 6:41 ` Greg Kurz
2016-07-06 12:14 ` [Qemu-devel] [PATCH v3 6/7] ppc: drop vcpu_idt_id bits from the target code Greg Kurz
2016-07-06 12:14 ` [Qemu-devel] [PATCH v3 7/7] spapr: consolidate the logic of core cpu_dt_id Greg Kurz
2016-07-07 2:05 ` David Gibson
2016-07-07 8:44 ` Greg Kurz
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=20160707084915.2117d556@bahia.lan \
--to=groug@kaod.org \
--cc=agraf@suse.de \
--cc=benh@kernel.crashing.org \
--cc=bharata@linux.vnet.ibm.com \
--cc=clg@kaod.org \
--cc=david@gibson.dropbear.id.au \
--cc=ehabkost@redhat.com \
--cc=imammedo@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=scottwood@freescale.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).