From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47437) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c05G9-0001Ef-Ak for qemu-devel@nongnu.org; Fri, 28 Oct 2016 07:23:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c05G7-0005yZ-Vu for qemu-devel@nongnu.org; Fri, 28 Oct 2016 07:23:41 -0400 Date: Fri, 28 Oct 2016 22:14:12 +1100 From: David Gibson Message-ID: <20161028111412.GF19349@umbus.fritz.box> References: <1477620301-24822-1-git-send-email-david@gibson.dropbear.id.au> <20161028113243.0a4e92d4@bahia> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="qp4W5+cUSnZs0RIF" Content-Disposition: inline In-Reply-To: <20161028113243.0a4e92d4@bahia> Subject: Re: [Qemu-devel] [RFC] powernv: CPU compatibility modes don't make sense for powernv List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Greg Kurz Cc: clg@kaod.org, qemu-ppc@nongnu.org, qemu-devel@nongnu.org --qp4W5+cUSnZs0RIF Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 28, 2016 at 11:32:43AM +0200, Greg Kurz wrote: > On Fri, 28 Oct 2016 13:05:01 +1100 > David Gibson wrote: >=20 > > powernv has some code (derived from the spapr equivalent) used in device > > tree generation which depends on the CPU's compatibility mode / logical > > PVR. However, compatibility modes don't make sense on powernv - at lea= st > > not as a property controlled by the host - because the guest in powernv > > has full hypervisor level access to the virtual system, and so owns the > > PCR (Processor Compatibility Register) which implements compatiblity mo= des. > >=20 >=20 > This makes a lot of sense indeed. >=20 > > Signed-off-by: David Gibson > > --- > > hw/ppc/pnv.c | 6 +----- > > 1 file changed, 1 insertion(+), 5 deletions(-) > >=20 > > Hi C=E9dric, I'd appreciate it if you can double check my reasoning > > here. This patch gets powernv out of the way of a bunch of > > compatibility mode cleanups I have in the works. > >=20 > > diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c > > index 82276e0..6af3424 100644 > > --- a/hw/ppc/pnv.c > > +++ b/hw/ppc/pnv.c > > @@ -110,7 +110,7 @@ static void powernv_create_core_node(PnvChip *chip,= PnvCore *pc, void *fdt) > > CPUState *cs =3D CPU(DEVICE(pc->threads)); > > DeviceClass *dc =3D DEVICE_GET_CLASS(cs); > > PowerPCCPU *cpu =3D POWERPC_CPU(cs); > > - int smt_threads =3D ppc_get_compat_smt_threads(cpu); > > + int smt_threads =3D CPU_CORE(pc)->nr_threads; >=20 > Not speaking of the PCR, this has also another effect since=20 > ppc_get_compat_smt_threads() also take the KVM smt capability > into account: >=20 > int ret =3D MIN(cs->nr_threads, kvmppc_smt_threads()); >=20 > Shouldn't you do the same here ? Actually, no, though possible that needs mention in the commit message. I'm pretty sure there are checks elsewhere that ensure nr_threads <=3D kvmppc_smt_threads(). If not, having more virtual threads than kvmppc allows certainly can't work, so we're no more broken than before. Plus, kvmppc_smt_threads() is really only relevant for KVM HV which doesn't, and can't support the powernv machine type anyway. --=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 --qp4W5+cUSnZs0RIF Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJYEzMCAAoJEGw4ysog2bOSpE8P/3fk156SgBVbPWLcCJc1OZq7 13pLDUCSNxmDMScJFrRds197JY4sf0FjmMa2ZWuVrfPb45DFCyF0Ko35E86VOXcw V73j4fW7juC//bzX6FO5bAKv1Y9FYfge/PNbUg6V4Xg0/SAvkNmak7oj030wxvH/ m8uVLeCpmINA7dwcjlGhWagS1g724BzV8VmpLC2uSmhPTBxkbEIWQHnaczheWkFL 5e5D13+vom5eUOxmVn15yj8pi1DERvtAi6rSE3nD6uOO8dIBmTB2glum0ypLePY9 5s9WrUNej5eMDMKV+T4Nku8FMCAm6aIv2z+lL7jK7VXLxNAggpyf21ifCWYVMAfz sQbtIsZxkcra9+lsD/NZp1lIhIN0ydNMU6jqXPm9LO07/oVIXumloX2hC9f93jfZ +LwAltAgP/oq2xnG1XaKY7UJJBLLFEzwmyB9WNG6WRWoBifE5zKKZqKMjLb7qjak NMfNWmbDX6BBNVHC3NKtEemqhYBNkzy+oYDlN4Z6l7YiRtR3yEYUiIQwrqEEJf4H JEAe4o23g9d/pb2n3XDBV4TX+iuhl/KJkoYsp+4eXdRZncg+5AQys/y2+BujQLUQ l6ahOb611UT13HekqQHWSE5rQ5uaeawqA8M4aJ1EeglnFbRhlSwcF+b3M8xgLKFT ungN213LZjl7SNCCUXme =pd7O -----END PGP SIGNATURE----- --qp4W5+cUSnZs0RIF--