From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55432) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXmwz-0006Lw-VE for qemu-devel@nongnu.org; Mon, 22 Feb 2016 04:38:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aXmwy-0002nq-UF for qemu-devel@nongnu.org; Mon, 22 Feb 2016 04:38:41 -0500 Received: from ozlabs.org ([2401:3900:2:1::2]:58785) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXmwy-0002lD-Dx for qemu-devel@nongnu.org; Mon, 22 Feb 2016 04:38:40 -0500 Date: Mon, 22 Feb 2016 19:04:37 +1100 From: David Gibson Message-ID: <20160222080437.GL2808@voom.fritz.box> References: <1456117285-22273-1-git-send-email-bharata@linux.vnet.ibm.com> <1456117285-22273-2-git-send-email-bharata@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="DN8g+DOX2TxGxleI" Content-Disposition: inline In-Reply-To: <1456117285-22273-2-git-send-email-bharata@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [RFC PATCH v0 1/8] cpu: Store CPU typename in MachineState List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bharata B Rao Cc: ehabkost@redhat.com, aik@ozlabs.ru, armbru@redhat.com, qemu-devel@nongnu.org, agraf@suse.de, pbonzini@redhat.com, imammedo@redhat.com, afaerber@suse.de --DN8g+DOX2TxGxleI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 22, 2016 at 10:31:18AM +0530, Bharata B Rao wrote: > Storing CPU typename in MachineState lets us to create CPU threads > for all architectures in uniform manner from arch-neutral code. >=20 > TODO: Touching only sPAPR target for now >=20 > Signed-off-by: Bharata B Rao As noted elsewhere, I hope we can do away with the need for this, but I haven't yet figured out enough about the QOM model to see how. > --- > hw/ppc/spapr.c | 2 ++ > include/hw/boards.h | 1 + > 2 files changed, 3 insertions(+) >=20 > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c > index 5bd8fd3..3892a99 100644 > --- a/hw/ppc/spapr.c > +++ b/hw/ppc/spapr.c > @@ -1823,6 +1823,8 @@ static void ppc_spapr_init(MachineState *machine) > if (machine->cpu_model =3D=3D NULL) { > machine->cpu_model =3D kvm_enabled() ? "host" : "POWER7"; > } > + machine->cpu_type =3D TYPE_POWERPC_CPU; > + > for (i =3D 0; i < smp_cpus; i++) { > cpu =3D cpu_ppc_init(machine->cpu_model); > if (cpu =3D=3D NULL) { > diff --git a/include/hw/boards.h b/include/hw/boards.h > index 0f30959..cf95d10 100644 > --- a/include/hw/boards.h > +++ b/include/hw/boards.h > @@ -137,6 +137,7 @@ struct MachineState { > char *kernel_cmdline; > char *initrd_filename; > const char *cpu_model; > + const char *cpu_type; > AccelState *accelerator; > }; > =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 --DN8g+DOX2TxGxleI Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWysEVAAoJEGw4ysog2bOSZ/4QALxbgmRdqKLiFjLQB52VVkzR a+JOFI747B8pCTNE9CgQh+dfeyzQeRETOXR/Gw4a6QlvP4CWPhDjXXYRodJhVh10 5MVzsSaFlhe89et1EmXTmToT1FbEM3HKpChU/OQbhsgRkE+39iJSQKW4N3wx1ZSi 3+h2TITYnqP5ouDPY7Uy8AZGVPCIbh/ncBilXY1fVenPGlEBKyJ6VA7PNIqTDQA7 hSgcLB3sMtSMq7doGZgAW5SF5e8bZJw/kpP+5dlriZZzVp8gBmQDhtA9910eHf8F IYjUXITBxGYtx4WCe55ImiRV9b8c9ysIB+WJu6+u+YHifItGN3ZOJi5uw/J+48Ax CkyQmmcWMBln/kZOX5yjFFdGDv0pc0pueypBVWCZg76qaVQLRu85N2xLkNHSe2Ho 7n3X2UcncR6kTH9prMyP2cP73vo0S8tBk3cDzp9bq+kDNcRLyh1S8E/OOoMA0pt+ WmVVzu7KV1Xl596dUaY5vo5gU2Pek8/gXZrZukPmnAUfWUz20gGMdYicgJTX30O4 fdhcobk6q3Ro8dxHHPryeDicT6jvUkMihIk/CrFtR2bPPNLRJGUukS1UVGmLvN56 +D0+91rGEy9ERaOA6V9WqArF81/IxuqEAPlsThPMB8vXRfuQiWnkvT9DjKM9L73U IvHM22v6rtEJ+6v/jNjM =lOrv -----END PGP SIGNATURE----- --DN8g+DOX2TxGxleI--