From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43545) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1braap-0007DB-4C for qemu-devel@nongnu.org; Tue, 04 Oct 2016 21:01:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1braam-0002iF-Lr for qemu-devel@nongnu.org; Tue, 04 Oct 2016 21:01:54 -0400 Date: Wed, 5 Oct 2016 11:07:52 +1100 From: David Gibson Message-ID: <20161005000752.GF18648@umbus.fritz.box> References: <1475585744-28692-1-git-send-email-thuth@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="dgjlcl3Tl+kb3YDk" Content-Disposition: inline In-Reply-To: <1475585744-28692-1-git-send-email-thuth@redhat.com> Subject: Re: [Qemu-devel] [PATCH] 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 --dgjlcl3Tl+kb3YDk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 04, 2016 at 02:55:44PM +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. Due to this reason, the linux-user > target already switched to POWER8 by default a while ago (see commit > de3f1b98410e0d5b406a0df3a48547b559d18602). Since the softmmu target > of course has the same problem, we should switch there to POWER8 > by default for the newer machine types, too. >=20 > Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=3D1357808 > Signed-off-by: Thomas Huth Sounds good, one detail.. > --- > 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 | 11 ++++++++++- > include/hw/ppc/spapr.h | 1 + > 2 files changed, 11 insertions(+), 1 deletion(-) >=20 > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c > index 63b6a0d..799bcff 100644 > --- a/hw/ppc/spapr.c > +++ b/hw/ppc/spapr.c > @@ -1775,7 +1775,13 @@ 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"; > + if (kvm_enabled()) { > + machine->cpu_model =3D "host"; > + } else if (smc->tcg_default_cpu) { > + machine->cpu_model =3D smc->tcg_default_cpu; > + } else { > + machine->cpu_model =3D "POWER8"; > + } You can avoid the last if branch if you initialize tcg_default_cpu to POWER8 in spapr_machine_class_init(). > } > =20 > ppc_cpu_parse_features(machine->cpu_model); > @@ -2478,7 +2484,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 --dgjlcl3Tl+kb3YDk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJX9ERVAAoJEGw4ysog2bOSsT8P/3ix6+v3EXkMlGEqKaCRmil1 DFDp0CO0oxqP6vMKdoQJ/oanjaoUpYlhcy51TEj4DNX2aB4khGSJYb73HU3NVhrn c/t2AuwZ2xZFHKvMEf33EpQF/q4AL9MOJb+DY/eWgTD0bF3OHZHCj0oZRD15OODo dy+Z3mI0CnD/6f70PyF5C2EK62Ic3GVQmRJOaeUwgDLqolWZ/MZbPdQRowVHvzYx 47vb0qGRWCaXRY2Xs0D1d/3rgO4yTTFQBQA9sbUv08MZZIgXwULQ44o//vhbESoQ eVsjnLSDoNp0pTxG0CQrnkgEsHc9AlnchvTIdqI9DVcZL5nLYEKpkKZhhqc7EVHP eZpQiqK+0+eU8zWUfcvdcPKNQpfnxroT6RHL/n4ScUMdGKKWkDzTohQ04FrRK0ot Rpiwqf7M0LNje9+nQIVz/IpL36luISxbojrtY4prhVTBhg8bL1rAeNeu7DmkKNsJ QnMIWOxz/CzvgGMRtAT/gNqGvcPekLy1d4UnMwrEv+YJFXw0jDa2B7ogzTRfAvjC BSc3jTkrAJ2tj4FGBCTL6MWtJQLjOhZR3gRM/m2Y4j1oqpKHitcTcBkdF/5Q4/X/ Pfqynim9URh+vitDPfF+tfaK/EBUZ8H/qRfFxiiOYglGfUxbYlBbFjxntg0QD6hQ cB4/OYhGRh2nyy7tAzht =A8C7 -----END PGP SIGNATURE----- --dgjlcl3Tl+kb3YDk--