From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37894) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKyMg-0006Tk-VZ for qemu-devel@nongnu.org; Wed, 06 Jul 2016 21:44:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bKyMf-0006gV-Ru for qemu-devel@nongnu.org; Wed, 06 Jul 2016 21:44:30 -0400 Date: Thu, 7 Jul 2016 10:55:58 +1000 From: David Gibson Message-ID: <20160707005558.GD14675@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> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/unnNtmY43mpUSKx" Content-Disposition: inline In-Reply-To: <20160706140114.2ff04caf@172-15-179-184.lightspeed.austtx.sbcglobal.net> 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: Bharata B Rao , qemu-devel@nongnu.org, qemu-ppc@nongnu.org, groug@kaod.org, nikunj@linux.vnet.ibm.com, pbonzini@redhat.com --/unnNtmY43mpUSKx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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). No, I'm pretty sure the DT id fits in a 32-bit field in the device tree itself, so it should be safe. >=20 > > + } else { > > + return cs->cpu_index; > > + } > > +} > > + > > static void ppc_cpu_class_init(ObjectClass *oc, void *data) > > { > > PowerPCCPUClass *pcc =3D 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 =3D ppc_cpu_is_big_endian; > > #endif > > + cc->get_migration_id =3D ppc_cpu_get_migration_id; > > =20 > > dc->fw_name =3D "PowerPC,UNKNOWN"; > > } >=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 --/unnNtmY43mpUSKx Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXfaieAAoJEGw4ysog2bOSZDUQAK82HiAkhWcYhXskgxztfYfy 9Dm/NGvy99Gv7RHlPWG4iBPHFNBr8vUFWzdC4tuPT0RZD0cGgeK1bk7bC99fiFqv IzVfmXRIJhOx295R1+qzy1hmT5mdPF4ZXHs4AVM/dM8aC0wpp7WH17ynhqhPoq03 p2d4KXWGybiwD3LCUbFmQCYPdaHXyVkoxWofvkmuoadIXfW8hUL1DgU4fMS5aG/B sz+1fBXGz7aKLoyXZMdnWns6xi3hOj+8TldxQ0r7QgYzmD1P4XxiGv45Z3E7vxnQ XEgWT+Hlz/rWCEPtmRSGcAzvNwBi/kXHunlg5HCkGaKM1iAoWpyEr20Wpc0E7uZq 3MbVu8lTZapUQREVlIJabtwq4oP0E1MjzseoGsPXARbZMs8Kbs/3yutDSHX4Th0s IY09T8k5fuJWo1CQB6OPjEgyY7sL1QiPoNsgOOKuT6BJtQGejvxYlWPy8Y9EwQqS 9gxZ1SPNcJeQKugZwxv0NEYaRKAt0W4ioW4kbrow6Don1i9/OgszmWly9cOoD7V0 Gien1u4u38ML7kjNmYEedQN8j+KHaX0R5aRvHklNZjiy161BJY4iwlZ0yOVM+5s2 yihdvyerCKclaPsOMYwUQSDufKxDof1/rz1A4ojszyjcz4upThmm0DnkLnMGMG3p IA/7p6e8Ht+GbFQL54Fz =gtQJ -----END PGP SIGNATURE----- --/unnNtmY43mpUSKx--