Received: from eggs.gnu.org ([2001:4830:134:3::10]:42999) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brymP-0003Ev-DE for qemu-devel@nongnu.org; Wed, 05 Oct 2016 22:51:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1brymM-0006tJ-VV for qemu-devel@nongnu.org; Wed, 05 Oct 2016 22:51:28 -0400 Date: Thu, 6 Oct 2016 11:00:13 +1100 From: David Gibson Message-ID: <20161006000013.GB18733@umbus.fritz.box> References: <1475653491-8611-1-git-send-email-thuth@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="VrqPEDrXMn8OVzN4" Content-Disposition: inline In-Reply-To: <1475653491-8611-1-git-send-email-thuth@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2] hw/ppc/spapr: Use POWER8 by default for the pseries-2.8 machine List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thomas Huth Cc: qemu-ppc@nongnu.org, Alexander Graf , qemu-devel@nongnu.org --VrqPEDrXMn8OVzN4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 05, 2016 at 09:44:51AM +0200, Thomas Huth wrote: > A couple of distributors are compiling their distributions > with "-mcpu=3Dpower8" for ppc64le these days, so the user sooner > or later runs into a crash there when not explicitely specifying > the "-cpu POWER8" option to QEMU (which is currently using POWER7 > for the "pseries" machine by default). Due to this reason, the > linux-user target already switched to POWER8 a while ago (see commit > de3f1b98410e0d5b406a0df3a48547b559d18602). Since the softmmu target > of course has the same problem, we should switch there to POWER8 for > the newer machine types, too. >=20 > Signed-off-by: Thomas Huth > --- > v2: > - Initialize tcg_default_cpu =3D "POWER8" in spapr_machine_class_init() >=20 > Note: This patch should be applied on top of David's ppc-for-2.8 > tree, since the pseries-2.8 machine has just been added there > recently. >=20 > hw/ppc/spapr.c | 6 +++++- > include/hw/ppc/spapr.h | 1 + > 2 files changed, 6 insertions(+), 1 deletion(-) Applied to ppc-for-2.8. >=20 > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c > index 63b6a0d..03e3803 100644 > --- a/hw/ppc/spapr.c > +++ b/hw/ppc/spapr.c > @@ -1775,7 +1775,7 @@ static void ppc_spapr_init(MachineState *machine) > =20 > /* init CPUs */ > if (machine->cpu_model =3D=3D NULL) { > - machine->cpu_model =3D kvm_enabled() ? "host" : "POWER7"; > + machine->cpu_model =3D kvm_enabled() ? "host" : smc->tcg_default= _cpu; > } > =20 > ppc_cpu_parse_features(machine->cpu_model); > @@ -2402,6 +2402,7 @@ static void spapr_machine_class_init(ObjectClass *o= c, void *data) > mc->cpu_index_to_socket_id =3D spapr_cpu_index_to_socket_id; > =20 > smc->dr_lmb_enabled =3D true; > + smc->tcg_default_cpu =3D "POWER8"; > mc->query_hotpluggable_cpus =3D spapr_query_hotpluggable_cpus; > fwc->get_dev_path =3D spapr_get_fw_dev_path; > nc->nmi_monitor_handler =3D spapr_nmi; > @@ -2478,7 +2479,10 @@ static void spapr_machine_2_7_instance_options(Mac= hineState *machine) > =20 > static void spapr_machine_2_7_class_options(MachineClass *mc) > { > + sPAPRMachineClass *smc =3D SPAPR_MACHINE_CLASS(mc); > + > spapr_machine_2_8_class_options(mc); > + smc->tcg_default_cpu =3D "POWER7"; > SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_7); > } > =20 > diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h > index 6289d50..39dadaa 100644 > --- a/include/hw/ppc/spapr.h > +++ b/include/hw/ppc/spapr.h > @@ -39,6 +39,7 @@ struct sPAPRMachineClass { > /*< public >*/ > bool dr_lmb_enabled; /* enable dynamic-reconfig/hotplug of LMB= s */ > bool use_ohci_by_default; /* use USB-OHCI instead of XHCI */ > + const char *tcg_default_cpu; /* which (TCG) CPU to simulate by defau= lt */ > }; > =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 --VrqPEDrXMn8OVzN4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJX9ZQNAAoJEGw4ysog2bOSDgwP/ie4HzZHb5LDSUpj+QZLTlYh 9uuqSSn/A92Z5KgGnzvNp3VpG7iSLsUqCe7R6VsOpFVICc69+6xhiN614eMMf2HB azkyJpH+cySm+8MKizBC+G0DknG4ujMEPFb03UbYvjr5pHUC//8xrw22nk+xPTsa kAVtNUzRxrzbX8LTgDp0pbYZm4i37QZ3HhL0r+fJNwaLCh9z9in+xV/VkNbpi9Lk 31iPT2NAfSv+LNYHsogo3HSnRzYz/DvGv1rIQJAOkXF4yL/pFX8jO9EllcuZ7uze V86Qy9j1e06u/hDIv8Yjbwe6ERMyOR5zHs3kzaLSeeBpgPKkuOpkAOqE5MGpRwxg n1NVwU82YhUzCAgDoOA4yq2+btDjCIt2K0N4v65vTwpQByHdgKRN+BqufU+Hiq46 MKIqbEmxjc6F9MQ+W+AYQW8XIDTsI4Sq2SdBzUp0aZlfjMJKzk0BEKJ7ZeYrfqkd Quo/Wyaeb14yPS2vpikFJMUptpwPqdzbkAXZpUfnAO7oOBCfS7tB2BJuopcpZezl ngJXYU0E0DykIFY0FZvCOIBROhDW1wXrJG8+VAVlzJ8Vwmo1xVBGC/X5GP4J0Sd5 8T/sbdAXvy7rNlPECzAnj5OmnGtrKKT+ofrX1uZnzxICv8gtmIuaIkG2gt2yBvNg xdvalkmZLBlRSzoWJpRh =QYgj -----END PGP SIGNATURE----- --VrqPEDrXMn8OVzN4--