From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37113) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKnhV-0002zs-S1 for qemu-devel@nongnu.org; Wed, 06 Jul 2016 10:21:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bKnhQ-0000Bf-M8 for qemu-devel@nongnu.org; Wed, 06 Jul 2016 10:21:16 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:40027) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKnhQ-0000BP-D0 for qemu-devel@nongnu.org; Wed, 06 Jul 2016 10:21:12 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u66EEKdK138101 for ; Wed, 6 Jul 2016 10:21:11 -0400 Received: from e23smtp09.au.ibm.com (e23smtp09.au.ibm.com [202.81.31.142]) by mx0a-001b2d01.pphosted.com with ESMTP id 240mw0uapt-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 06 Jul 2016 10:21:11 -0400 Received: from localhost by e23smtp09.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 7 Jul 2016 00:21:09 +1000 Date: Wed, 6 Jul 2016 19:51:01 +0530 From: Bharata B Rao Reply-To: bharata@linux.vnet.ibm.com References: <1467795561-1007-1-git-send-email-bharata@linux.vnet.ibm.com> <1467795561-1007-4-git-send-email-bharata@linux.vnet.ibm.com> <20160706140114.2ff04caf@172-15-179-184.lightspeed.austtx.sbcglobal.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160706140114.2ff04caf@172-15-179-184.lightspeed.austtx.sbcglobal.net> Message-Id: <20160706142101.GG25522@in.ibm.com> Subject: Re: [Qemu-devel] [RFC PATCH v1 3/5] spapr: Implement CPUClass::get_migration_id() for PowerPC CPUs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, david@gibson.dropbear.id.au, groug@kaod.org, nikunj@linux.vnet.ibm.com, pbonzini@redhat.com 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 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 > > --- > > 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 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.