From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48074) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bI5Q3-0005HG-TF for qemu-devel@nongnu.org; Tue, 28 Jun 2016 22:40:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bI5Pz-0004C5-Gz for qemu-devel@nongnu.org; Tue, 28 Jun 2016 22:40:02 -0400 Date: Wed, 29 Jun 2016 11:42:01 +1000 From: David Gibson Message-ID: <20160629014201.GB8885@voom.fritz.box> References: <201606281350.u5SDo5Ef028449@linux03a.ddci.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+pHx0qQiF2pBVqBT" Content-Disposition: inline In-Reply-To: <201606281350.u5SDo5Ef028449@linux03a.ddci.com> Subject: Re: [Qemu-devel] [PATCH v2] target-ppc: Eliminate redundant and incorrect function booke206_page_size_to_tlb List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aaron Larson Cc: agraf@suse.de, qemu-devel@nongnu.org, qemu-ppc@nongnu.org --+pHx0qQiF2pBVqBT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 28, 2016 at 06:50:05AM -0700, Aaron Larson wrote: >=20 > Eliminate redundant and incorrect booke206_page_size_to_tlb function > from ppce500_spin.c in preference to previously existing but newly > exported definition from e500.c >=20 > Defect analysis: >=20 > The booke206_page_size_to_tlb function in e500.c was updated in commit > 2bd9543 "ppc: booke206: use MAV=3D2.0 TSIZE definition, fix 4G pages" to > reflect a change in the definition of MAS1_TSIZE_SHIFT from 8 > (corresponding to a min TLB page size of 4kb) to a value of 7 (TLB > page size 2k). The booke206_page_size_to_tlb() function defined in > ppce500_spin.c was never updated to reflect the change in > MAS1_TSIZE_SHIFT. >=20 > In http://lists.nongnu.org/archive/html/qemu-ppc/2016-06/msg00533.html, > Scott Wood suggested this "root cause" explanation: >=20 > SW> The patch that changed MAS1_TSIZE_SHIFT from 8 to 7 was around the > SW> same time as the patch that added this code, which is probably why > SW> adjusting it got missed. Commit 2bd9543cd3 did update the > SW> equivalent code in ppce500_mpc8544ds.c, which now resides in > SW> hw/ppc/e500.c and has been changed to not assume a power-of-2 > SW> size. The ppce500_spin version should be eliminated. >=20 > Signed-off-by: Aaron Larson Applied to pppc-for-2.7, thanks. > --- > hw/ppc/e500.c | 2 +- > hw/ppc/e500.h | 2 ++ > hw/ppc/ppce500_spin.c | 7 +------ > 3 files changed, 4 insertions(+), 7 deletions(-) >=20 > diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c > index ee1c60b..0cd534d 100644 > --- a/hw/ppc/e500.c > +++ b/hw/ppc/e500.c > @@ -601,7 +601,7 @@ static int ppce500_prep_device_tree(MachineState *mac= hine, > } > =20 > /* Create -kernel TLB entries for BookE. */ > -static inline hwaddr booke206_page_size_to_tlb(uint64_t size) > +hwaddr booke206_page_size_to_tlb(uint64_t size) > { > return 63 - clz64(size >> 10); > } > diff --git a/hw/ppc/e500.h b/hw/ppc/e500.h > index ef224ea..70ba1d8 100644 > --- a/hw/ppc/e500.h > +++ b/hw/ppc/e500.h > @@ -26,4 +26,6 @@ typedef struct PPCE500Params { > =20 > void ppce500_init(MachineState *machine, PPCE500Params *params); > =20 > +hwaddr booke206_page_size_to_tlb(uint64_t size); > + > #endif > diff --git a/hw/ppc/ppce500_spin.c b/hw/ppc/ppce500_spin.c > index 225177b..22c584e 100644 > --- a/hw/ppc/ppce500_spin.c > +++ b/hw/ppc/ppce500_spin.c > @@ -32,6 +32,7 @@ > #include "sysemu/sysemu.h" > #include "hw/sysbus.h" > #include "sysemu/kvm.h" > +#include "e500.h" > =20 > #define MAX_CPUS 32 > =20 > @@ -72,12 +73,6 @@ static void spin_reset(void *opaque) > } > } > =20 > -/* Create -kernel TLB entries for BookE, linearly spanning 256MB. */ > -static inline hwaddr booke206_page_size_to_tlb(uint64_t size) > -{ > - return ctz32(size >> 10) >> 1; > -} > - > static void mmubooke_create_initial_mapping(CPUPPCState *env, > target_ulong va, > hwaddr pa, --=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 --+pHx0qQiF2pBVqBT Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXcydpAAoJEGw4ysog2bOSrsgP/iOuSObW7VHdtkPur69wtHdt UQyrpp4Hq0tZNW3ZQQ+LRDHg7EBKfU+tYS5eI3WUMloB33fxKxWVfDY/i83jsf+B isD7cDMSGY6zpDck+oFvjFXYfX7T/pl7Ze6xwjH5jTWMe5P89g92OeC3aI+NigUU Ycz0/4aR13dLt9ComTdbYXXt74fQFUKq1CPRxMgziG3ZSBcQMFCI5Jf3B4Jpp6eP g1kOz33H8OY1q4jGE09f98FdlWFS3+x3aIa3Rjp04mV3cHkttZ0p20ySDFdA7jhY YE+5RPTtuPohmUvQkqLqLvgHUK1FTJ92aI6qklYQYVMVQsY6G5Gjo00k6HpbIYPR kYar9TzzkpJrM1oZ7KThOevOQCXmjMsHqe9OeTvQSKk4l+bZAD/Mnf8MIFq8HR+j CfIlcM/f2W1bNzmo35uxxTvIBj3Btf3qjo4OlQfyVrdWFdLw9nTWJNkBq2n+i8U5 5oBtRWC/spxO27BG2b2qLcvhkXRaXmhmw8blwzPvJ/qoDRWgaKFsLrj2s5ApTJ0g pBZ/2R2w+x/H6mBm61KoMd1+KhYGPlxVFydrxlpfoUJdAQNr0GwHWCntjccuzRBd 4apJKl+UkbGXwn1fZeoa52UFJc+tcZYiQdPZCPb0GZUCDwkCs4IIbULyxNisRLkR urf39ot+3QkgT6lDfiu6 =E/rT -----END PGP SIGNATURE----- --+pHx0qQiF2pBVqBT--