qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Greg Kurz <groug@kaod.org>
Cc: Sam Bobroff <sam.bobroff@au1.ibm.com>,
	qemu-ppc@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH 2/4] e500: Use cpu_index instead of vcpu_dt_id
Date: Fri, 4 Aug 2017 12:21:51 +1000	[thread overview]
Message-ID: <20170804022151.GD6553@umbus.fritz.box> (raw)
In-Reply-To: <20170803151504.6d5cacac@bahia.lan>

[-- Attachment #1: Type: text/plain, Size: 2838 bytes --]

On Thu, Aug 03, 2017 at 03:15:04PM +0200, Greg Kurz wrote:
> On Thu, 3 Aug 2017 16:28:36 +1000
> Sam Bobroff <sam.bobroff@au1.ibm.com> wrote:
> 
> > The e500 platform code uses the function ppc_get_vcpu_dt_id() but that
> > function is actually specific to SPAPR machines, not PPC CPUs, and
> > will always return the cpu_index in this context.
> > 
> 
> ie, e500 compatible CPUs don't support SMT ? Then maybe the e500 machine
> should ensure smp_threads == 1, but this can done in a followup patch.

Uh.. sort of, it's really more about the host than guest restrictions.

I've rewritten the commit message to give a bit more context.

> > Simply use the cpu_index instead (which is 'i' in this context
> > because qemu_get_cpu(i) returns the cpu with cpu_index == i).
> > 
> > Signed-off-by: Sam Bobroff <sam.bobroff@au1.ibm.com>
> 
> Reviewed-by: Greg Kurz <groug@kaod.org>

Applied to ppc-for-2.11

> 
> > ---
> >  hw/ppc/e500.c | 8 ++------
> >  1 file changed, 2 insertions(+), 6 deletions(-)
> > 
> > diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
> > index 62f1857206..2a6d34ceb1 100644
> > --- a/hw/ppc/e500.c
> > +++ b/hw/ppc/e500.c
> > @@ -382,7 +382,6 @@ static int ppce500_load_device_tree(MachineState *machine,
> >         the first node as boot node and be happy */
> >      for (i = smp_cpus - 1; i >= 0; i--) {
> >          CPUState *cpu;
> > -        PowerPCCPU *pcpu;
> >          char cpu_name[128];
> >          uint64_t cpu_release_addr = params->spin_base + (i * 0x20);
> >  
> > @@ -391,16 +390,13 @@ static int ppce500_load_device_tree(MachineState *machine,
> >              continue;
> >          }
> >          env = cpu->env_ptr;
> > -        pcpu = POWERPC_CPU(cpu);
> >  
> > -        snprintf(cpu_name, sizeof(cpu_name), "/cpus/PowerPC,8544@%x",
> > -                 ppc_get_vcpu_dt_id(pcpu));
> > +        snprintf(cpu_name, sizeof(cpu_name), "/cpus/PowerPC,8544@%x", i);
> >          qemu_fdt_add_subnode(fdt, cpu_name);
> >          qemu_fdt_setprop_cell(fdt, cpu_name, "clock-frequency", clock_freq);
> >          qemu_fdt_setprop_cell(fdt, cpu_name, "timebase-frequency", tb_freq);
> >          qemu_fdt_setprop_string(fdt, cpu_name, "device_type", "cpu");
> > -        qemu_fdt_setprop_cell(fdt, cpu_name, "reg",
> > -                              ppc_get_vcpu_dt_id(pcpu));
> > +        qemu_fdt_setprop_cell(fdt, cpu_name, "reg", i);
> >          qemu_fdt_setprop_cell(fdt, cpu_name, "d-cache-line-size",
> >                                env->dcache_line_size);
> >          qemu_fdt_setprop_cell(fdt, cpu_name, "i-cache-line-size",
> 



-- 
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: 833 bytes --]

  reply	other threads:[~2017-08-04  2:28 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-03  6:28 [Qemu-devel] [PATCH 0/4] Cleanup cpu_dt_id Sam Bobroff
2017-08-03  6:28 ` [Qemu-devel] [PATCH 1/4] spapr: Fix bug in h_signal_sys_reset() Sam Bobroff
2017-08-03 12:37   ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2017-08-04  2:18     ` David Gibson
2017-08-03  6:28 ` [Qemu-devel] [PATCH 2/4] e500: Use cpu_index instead of vcpu_dt_id Sam Bobroff
2017-08-03 13:15   ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2017-08-04  2:21     ` David Gibson [this message]
2017-08-03  6:28 ` [Qemu-devel] [PATCH 3/4] ppc: spapr: Rename cpu_dt_id to vcpu_id Sam Bobroff
2017-08-03 13:19   ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2017-08-04  2:25     ` David Gibson
2017-08-03  6:28 ` [Qemu-devel] [PATCH 4/4] ppc: spapr: Make VCPU ID handling private to SPAPR Sam Bobroff
2017-08-03 13:23   ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2017-08-04  3:10   ` [Qemu-devel] " David Gibson
2017-08-07  6:07     ` Sam Bobroff

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=20170804022151.GD6553@umbus.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=groug@kaod.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=sam.bobroff@au1.ibm.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).