From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37908) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKyMi-0006To-84 for qemu-devel@nongnu.org; Wed, 06 Jul 2016 21:44:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bKyMf-0006g7-3Q for qemu-devel@nongnu.org; Wed, 06 Jul 2016 21:44:32 -0400 Date: Thu, 7 Jul 2016 10:57:28 +1000 From: David Gibson Message-ID: <20160707005728.GE14675@voom.fritz.box> 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> <20160706142101.GG25522@in.ibm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="OZkY3AIuv2LYvjdk" Content-Disposition: inline In-Reply-To: <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: Bharata B Rao Cc: Igor Mammedov , qemu-devel@nongnu.org, qemu-ppc@nongnu.org, groug@kaod.org, nikunj@linux.vnet.ibm.com, pbonzini@redhat.com --OZkY3AIuv2LYvjdk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 wrote: > >=20 > > > cpu_index is used as migration_id by default. For machine type > > > versions that set use-migration-id property, cpu_dt_it is returned. > > >=20 > > > Signed-off-by: Bharata B Rao > > > --- > > > target-ppc/translate_init.c | 12 ++++++++++++ > > > 1 file changed, 12 insertions(+) > > >=20 > > > 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 > > > } > > > =20 > > > +static int ppc_cpu_get_migration_id(CPUState *cs) > > > +{ > > > + PowerPCCPU *cpu =3D 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). >=20 > 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... > 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 :( >=20 > Regards, > Bharata. >=20 --=20 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 --OZkY3AIuv2LYvjdk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXfaj4AAoJEGw4ysog2bOSoKgQAKB5Yx2Z4e+nSLmj9nPXyRjb C1TknazOhCiHC+zTMUZLk4S3CNYE3lKChjbhsElVSFleNssDz06tcDjFMTLm9SOq QoYBpdqJOW+34X1f6mde94iOlU+C+356yg53rAio31TjNsbNGxannc15tL1sNve8 4vxBUWSJDaDWy+u5JqQNPSjOb7u55Xzs0WPiOdtsh2RbOrbIgDOwhyYLOFChN4XR o+PjpQ47/uhUmNOHNDh4a4JqWDsIpgtnWfDUVzcFVjazrTmObBNmtycyGjMmLBCm jUyO675lKDmvGRz9Y/DczIT/bLXq60myHhBSRjAN0mwVutldZJAMz6Q6nIRHLf+W x2jROekLX+YYk2+LJNrpCshPlAVF63IIlOoDUlNTnAdbzTe7KPEUtr0kqz1xXvgF AWn94UrL+rncX9CzrJrqltRTPXebNmRkxLK96hnq1C96ZZmj7xJKQ861A5/iBOak McnRqe3CCgvuXEBJy5fRtNO8iGunO6EAeToSJR/9yeiI3cvN0iAR/KCIWew3gRBL 19xXhGfSs7s0druoFksBB/N7l0JvM05Jhn1M78EN6cfdx0fD4YWv+KrnqbJHDQaT rXreAIr8gepSyILGCQh8juhRhyjkOfO5M5oeiP1wcfEEeLvcthM6ghgOvdCoOuoc iAYLwp8YBMFNewndzdIu =U5ns -----END PGP SIGNATURE----- --OZkY3AIuv2LYvjdk--