From: Greg Kurz <groug@kaod.org>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: Bharata B Rao <bharata@linux.vnet.ibm.com>,
Igor Mammedov <imammedo@redhat.com>,
qemu-devel@nongnu.org, qemu-ppc@nongnu.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 14:32:18 +0200 [thread overview]
Message-ID: <20160707143218.1937a548@bahia.lan> (raw)
In-Reply-To: <20160707005728.GE14675@voom.fritz.box>
[-- Attachment #1: Type: text/plain, Size: 2467 bytes --]
On Thu, 7 Jul 2016 10:57:28 +1000
David Gibson <david@gibson.dropbear.id.au> wrote:
> On Wed, Jul 06, 2016 at 07:51:01PM +0530, Bharata B Rao wrote:
> > 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).
> >
> > For the existing max_cpus limit, 32 bit should be fine, but obviously
> > that is not good and future safe.
>
> I think we should be OK. The hardware IDs these are modelled on are
> 32-bit - I'm pretty sure #address-cells in /cpus is 1, not 2.
>
> And even with a lot of wastage for alignment gaps of various sorts,
> we're a *long* way off from supporting 4 billion cpus...
>
Indeed ! Even in the "worst" case, which is running a guest with 1 thread
per core on a POWER8 host with full cores (8 HW threads), the current maximum
value for cpu_dt_id is 254 * 8 == 2032 :)
> > I had a brief look at the implementation around possible_cpus in
> > x86, let me see if I can do something similar for generating stable
> > ids for PowerPC. I thought device tree ID would be our stable id, but
> > that being 64 bit and migration code requiring 32 bit value isn't
> > helping :(
> >
> > Regards,
> > Bharata.
> >
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
next prev parent reply other threads:[~2016-07-07 12:32 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 [this message]
2016-07-07 0:55 ` David Gibson
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=20160707143218.1937a548@bahia.lan \
--to=groug@kaod.org \
--cc=bharata@linux.vnet.ibm.com \
--cc=david@gibson.dropbear.id.au \
--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 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.