qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Igor Mammedov <imammedo@redhat.com>
Cc: Bharata B Rao <bharata@linux.vnet.ibm.com>,
	qemu-devel@nongnu.org, qemu-ppc@nongnu.org, groug@kaod.org,
	nikunj@linux.vnet.ibm.com, pbonzini@redhat.com
Subject: Re: [Qemu-devel] [RFC PATCH v1 3/5] spapr: Implement CPUClass::get_migration_id() for PowerPC CPUs
Date: Thu, 7 Jul 2016 10:55:58 +1000	[thread overview]
Message-ID: <20160707005558.GD14675@voom.fritz.box> (raw)
In-Reply-To: <20160706140114.2ff04caf@172-15-179-184.lightspeed.austtx.sbcglobal.net>

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

On Wed, Jul 06, 2016 at 02:01:14PM +0200, Igor Mammedov wrote:
> On Wed,  6 Jul 2016 14:29:19 +0530
> Bharata B Rao <bharata@linux.vnet.ibm.com> wrote:
> 
> > cpu_index is used as migration_id by default. For machine type
> > versions that set use-migration-id property, cpu_dt_it is returned.
> > 
> > Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
> > ---
> >  target-ppc/translate_init.c | 12 ++++++++++++
> >  1 file changed, 12 insertions(+)
> > 
> > diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
> > index efd6b88..9ca2f5e 100644
> > --- a/target-ppc/translate_init.c
> > +++ b/target-ppc/translate_init.c
> > @@ -10359,6 +10359,17 @@ static gchar *ppc_gdb_arch_name(CPUState *cs)
> >  #endif
> >  }
> >  
> > +static int ppc_cpu_get_migration_id(CPUState *cs)
> > +{
> > +    PowerPCCPU *cpu = POWERPC_CPU(cs);
> > +
> > +    if (cs->use_migration_id) {
> > +        return (int) cpu->cpu_dt_id;
> Could cpu_dt_id have value bigger than 32bit int? If yes, it's not safe
> to do so, that's the reason why I'm going to use index in possible_cpus
> on ARM and for the sake of uniformity do the same for x86 (even though
> it's possible to use 32bit APIC ID).

No, I'm pretty sure the DT id fits in a 32-bit field in the device
tree itself, so it should be safe.

> 
> > +    } else {
> > +        return cs->cpu_index;
> > +    }
> > +}
> > +
> >  static void ppc_cpu_class_init(ObjectClass *oc, void *data)
> >  {
> >      PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
> > @@ -10412,6 +10423,7 @@ static void ppc_cpu_class_init(ObjectClass
> > *oc, void *data) #ifndef CONFIG_USER_ONLY
> >      cc->virtio_is_big_endian = ppc_cpu_is_big_endian;
> >  #endif
> > +    cc->get_migration_id = ppc_cpu_get_migration_id;
> >  
> >      dc->fw_name = "PowerPC,UNKNOWN";
> >  }
> 

-- 
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 --]

  parent reply	other threads:[~2016-07-07  1:44 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-06  8:59 [Qemu-devel] [RFC PATCH v1 0/5] sPAPR: Fix migration when CPUs are removed in random order Bharata B Rao
2016-07-06  8:59 ` [Qemu-devel] [RFC PATCH v1 1/5] cpu, target-ppc: Move cpu_vmstate_[un]register calls to cpu_common_[un]realize Bharata B Rao
2016-07-06 10:57   ` Igor Mammedov
2016-07-06 14:16     ` Bharata B Rao
2016-07-06 14:44       ` Igor Mammedov
2016-07-06 16:52         ` Bharata B Rao
2016-07-07  0:47   ` David Gibson
2016-07-06  8:59 ` [Qemu-devel] [RFC PATCH v1 2/5] cpu: Introduce CPUState::migration_id Bharata B Rao
2016-07-06 11:34   ` Igor Mammedov
2016-07-06 14:18     ` Bharata B Rao
2016-07-06 14:47       ` Igor Mammedov
2016-07-07  0:53   ` David Gibson
2016-07-06  8:59 ` [Qemu-devel] [RFC PATCH v1 3/5] spapr: Implement CPUClass::get_migration_id() for PowerPC CPUs Bharata B Rao
2016-07-06 12:01   ` Igor Mammedov
2016-07-06 14:21     ` Bharata B Rao
2016-07-06 14:37       ` Greg Kurz
2016-07-07  0:57       ` David Gibson
2016-07-07 12:32         ` Greg Kurz
2016-07-07  0:55     ` David Gibson [this message]
2016-07-06 14:35   ` Greg Kurz
2016-07-06 16:53     ` Bharata B Rao
2016-07-07  1:00   ` David Gibson
2016-07-07 13:43     ` [Qemu-devel] [Qemu-ppc] " Mark Cave-Ayland
2016-07-06  8:59 ` [Qemu-devel] [RFC PATCH v1 4/5] xics: Use migration_id instead of cpu_index in XICS code Bharata B Rao
2016-07-06  9:08   ` Nikunj A Dadhania
2016-07-06  8:59 ` [Qemu-devel] [RFC PATCH v1 5/5] cpu, spapr: Use migration_id from pseries-2.7 onwards Bharata B Rao
2016-07-06 11:44   ` Igor Mammedov
2016-07-06 11:45   ` Igor Mammedov
2016-07-06 14:24     ` Bharata B Rao

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=20160707005558.GD14675@voom.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=bharata@linux.vnet.ibm.com \
    --cc=groug@kaod.org \
    --cc=imammedo@redhat.com \
    --cc=nikunj@linux.vnet.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /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).