From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55459) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bIlmt-00068m-Rt for qemu-devel@nongnu.org; Thu, 30 Jun 2016 19:54:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bIlms-0001uK-NR for qemu-devel@nongnu.org; Thu, 30 Jun 2016 19:54:27 -0400 Date: Fri, 1 Jul 2016 09:56:04 +1000 From: David Gibson Message-ID: <20160630235604.GV8885@voom.fritz.box> References: <1467096514-18905-1-git-send-email-clg@kaod.org> <1467096514-18905-3-git-send-email-clg@kaod.org> <20160630205602.7d830a02@kryten> <1467324827.7422.28.camel@kernel.crashing.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="OlucDFihBVSxvK/7" Content-Disposition: inline In-Reply-To: <1467324827.7422.28.camel@kernel.crashing.org> Subject: Re: [Qemu-devel] [PATCH 2/2] ppc: Fix 64K pages support in full emulation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Benjamin Herrenschmidt Cc: =?iso-8859-1?Q?C=E9dric?= Le Goater , Anton Blanchard , qemu-ppc@nongnu.org, qemu-devel@nongnu.org --OlucDFihBVSxvK/7 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jul 01, 2016 at 08:13:47AM +1000, Benjamin Herrenschmidt wrote: > On Thu, 2016-06-30 at 18:01 +0200, C=E9dric Le Goater wrote: > > +static uint32_t ppc_hash64_pte_size_decode(PowerPCCPU *cpu, uint64_t > > pte0, > > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 uint64_t pte1, ui= nt32_t > > slb_pshift) > > =A0{ > > -=A0=A0=A0 switch (slb_pshift) { > > -=A0=A0=A0 case 12: > > -=A0=A0=A0=A0=A0=A0=A0 return 12; > > -=A0=A0=A0 case 16: > > -=A0=A0=A0=A0=A0=A0=A0 if ((pte1 & 0xf000) =3D=3D 0x1000) { > > -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return 16; > > -=A0=A0=A0=A0=A0=A0=A0 } > > -=A0=A0=A0=A0=A0=A0=A0 return 0; > > -=A0=A0=A0 case 24: > > -=A0=A0=A0=A0=A0=A0=A0 if ((pte1 & 0xff000) =3D=3D 0) { > > -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return 24; > > -=A0=A0=A0=A0=A0=A0=A0 } > > -=A0=A0=A0=A0=A0=A0=A0 return 0; > > -=A0=A0=A0 } > > -=A0=A0=A0 return 0; > > +=A0=A0=A0 unsigned spshift; > > + > > +=A0=A0=A0 return ppc_hash64_hpte_page_shift_noslb(cpu, pte0, pte1, > > &spshift); > > =A0} >=20 > Why not call ppc_hash64_hpte_page_shift_noslb() directly from the call > site ? That or rename it to=A0ppc_hash64_pte_size_decode :-) Right.. that is the usage that ppc_hash64_hpte_page_shift_noslb() was intended for. > Otherwise yes, your patch looks correct as in what > doesppc_hash64_hpte_page_shift_noslb() is definitely more correct than > what ppc_hash64_pte_size_decode() is doing. >=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 --OlucDFihBVSxvK/7 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXdbGUAAoJEGw4ysog2bOSJJwQAKReOZoJqB/5HTPbHVypNqzZ U1l02jl/GOUeWKZ4WMVAbvNkP3YAJpor93WLZELclVr+frn/vnPMlSlTRuAIJ1yE mqcK/HPsJsCkjIHWbZ1uTWkMvGPXdVlZbMhBNs34y6niWscDWxEpm5V/Brfrx0Bt Qm7DGD90RiiBxxF6wfPERO28KBsx0Ik/YoJ0k5EniNO2tfx1Wy+xkRT+54dnXdJl Ie1eMSN1f0b/Pe6JdRhaHsaNzm2uM+NhGogl4cSXyW7AnZSN3JKq2YBIuBmY1lxw axShDYOHQBcma9N7iJpFCQTvTvLcbPwBya4P0beq6ArJocp87xn6ZyYFDeU8BTno HcrAkLRQpG79a2/Are78QCva76+Em/jo7nKsBOM4oPRl2sVmUt3mB9qa1qRdY/D2 YkMP0iT6zvGiH3yHtuSgYfe+rvL4zJMWx9BTX5RdiNn2phy1WrwrnHPNh3PEgTLZ ChnZ5bDuCXW78lLaw2GjwOG1hoH2Wz0pP/H4BT/EcBkis29yuwe6apLsRjkD2VHh vAWHNZlI/gpkin63qxhiX4AuWLxfYxYV6FBpbOOzsliUeIKZqujFgxHbY9hDA9e1 Zzwm8ScANCUqtb9ghQq4XKyWocMfqwmC/iloP506SdcEeXGubRh3tS+Moto1rCvz s2Bnuw+yoFN2+Qrpzzzq =PqUf -----END PGP SIGNATURE----- --OlucDFihBVSxvK/7--