From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53686) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9jeR-0006uL-6e for qemu-devel@nongnu.org; Sun, 05 Jun 2016 21:48:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b9jeM-0000lz-Ja for qemu-devel@nongnu.org; Sun, 05 Jun 2016 21:48:23 -0400 Date: Mon, 6 Jun 2016 11:23:39 +1000 From: David Gibson Message-ID: <20160606012339.GD9226@voom.fritz.box> References: <1464962289-17688-1-git-send-email-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="HWvPVVuAAfuRc6SZ" Content-Disposition: inline In-Reply-To: <1464962289-17688-1-git-send-email-mark.cave-ayland@ilande.co.uk> Subject: Re: [Qemu-devel] [PATCH] target-ppc: fixup bitrot in mmu_helper.c debug statements List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mark Cave-Ayland Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org --HWvPVVuAAfuRc6SZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 03, 2016 at 02:58:09PM +0100, Mark Cave-Ayland wrote: > This fixes compilation of mmu_helper.c when all of the debug #defines at > the start of the file are enabled. >=20 > Signed-off-by: Mark Cave-Ayland Applied to ppc-for-2.7. > --- > target-ppc/mmu_helper.c | 38 ++++++++++++++++++++++++-------------- > 1 file changed, 24 insertions(+), 14 deletions(-) >=20 > diff --git a/target-ppc/mmu_helper.c b/target-ppc/mmu_helper.c > index 1499af72..f5c4e69 100644 > --- a/target-ppc/mmu_helper.c > +++ b/target-ppc/mmu_helper.c > @@ -512,18 +512,20 @@ static inline int get_segment_6xx_tlb(CPUPPCState *= env, mmu_ctx_t *ctx, > /* Software TLB search */ > ret =3D ppc6xx_tlb_check(env, ctx, eaddr, rw, type); > #if defined(DUMP_PAGE_TABLES) > - if (qemu_log_mask(CPU_LOG_MMU)) { > + if (qemu_loglevel_mask(CPU_LOG_MMU)) { > + CPUState *cs =3D ENV_GET_CPU(env); > hwaddr curaddr; > uint32_t a0, a1, a2, a3; > =20 > qemu_log("Page table: " TARGET_FMT_plx " len " TARGET_FM= T_plx > - "\n", sdr, mask + 0x80); > - for (curaddr =3D sdr; curaddr < (sdr + mask + 0x80); > + "\n", env->htab_base, env->htab_mask + 0x80); > + for (curaddr =3D env->htab_base; > + curaddr < (env->htab_base + env->htab_mask + 0x80); > curaddr +=3D 16) { > - a0 =3D ldl_phys(curaddr); > - a1 =3D ldl_phys(curaddr + 4); > - a2 =3D ldl_phys(curaddr + 8); > - a3 =3D ldl_phys(curaddr + 12); > + a0 =3D ldl_phys(cs->as, curaddr); > + a1 =3D ldl_phys(cs->as, curaddr + 4); > + a2 =3D ldl_phys(cs->as, curaddr + 8); > + a3 =3D ldl_phys(cs->as, curaddr + 12); > if (a0 !=3D 0 || a1 !=3D 0 || a2 !=3D 0 || a3 !=3D 0= ) { > qemu_log(TARGET_FMT_plx ": %08x %08x %08x %08x\n= ", > curaddr, a0, a1, a2, a3); > @@ -894,9 +896,9 @@ static int ppcmas_tlb_check(CPUPPCState *env, ppcmas_= tlb_t *tlb, > =20 > mask =3D ~(booke206_tlb_to_page_size(env, tlb) - 1); > LOG_SWTLB("%s: TLB ADDR=3D0x" TARGET_FMT_lx " PID=3D0x%x MAS1=3D0x%x= MAS2=3D0x%" > - PRIx64 " mask=3D0x" TARGET_FMT_lx " MAS7_3=3D0x%" PRIx64 "= MAS8=3D%x\n", > - __func__, address, pid, tlb->mas1, tlb->mas2, mask, tlb->m= as7_3, > - tlb->mas8); > + PRIx64 " mask=3D0x%" HWADDR_PRIx " MAS7_3=3D0x%" PRIx64 " = MAS8=3D0x%" > + PRIx32 "\n", __func__, address, pid, tlb->mas1, tlb->mas2,= mask, > + tlb->mas7_3, tlb->mas8); > =20 > /* Check PID */ > tlb_pid =3D (tlb->mas1 & MAS1_TID_MASK) >> MAS1_TID_SHIFT; > @@ -1746,6 +1748,9 @@ static inline void dump_store_bat(CPUPPCState *env,= char ID, int ul, int nr, > void helper_store_ibatu(CPUPPCState *env, uint32_t nr, target_ulong valu= e) > { > target_ulong mask; > +#if defined(FLUSH_ALL_TLBS) > + PowerPCCPU *cpu =3D ppc_env_get_cpu(env); > +#endif > =20 > dump_store_bat(env, 'I', 0, nr, value); > if (env->IBAT[0][nr] !=3D value) { > @@ -1764,7 +1769,7 @@ void helper_store_ibatu(CPUPPCState *env, uint32_t = nr, target_ulong value) > #if !defined(FLUSH_ALL_TLBS) > do_invalidate_BAT(env, env->IBAT[0][nr], mask); > #else > - tlb_flush(env, 1); > + tlb_flush(CPU(cpu), 1); > #endif > } > } > @@ -1778,6 +1783,9 @@ void helper_store_ibatl(CPUPPCState *env, uint32_t = nr, target_ulong value) > void helper_store_dbatu(CPUPPCState *env, uint32_t nr, target_ulong valu= e) > { > target_ulong mask; > +#if defined(FLUSH_ALL_TLBS) > + PowerPCCPU *cpu =3D ppc_env_get_cpu(env); > +#endif > =20 > dump_store_bat(env, 'D', 0, nr, value); > if (env->DBAT[0][nr] !=3D value) { > @@ -1796,7 +1804,7 @@ void helper_store_dbatu(CPUPPCState *env, uint32_t = nr, target_ulong value) > #if !defined(FLUSH_ALL_TLBS) > do_invalidate_BAT(env, env->DBAT[0][nr], mask); > #else > - tlb_flush(env, 1); > + tlb_flush(CPU(cpu), 1); > #endif > } > } > @@ -1811,6 +1819,7 @@ void helper_store_601_batu(CPUPPCState *env, uint32= _t nr, target_ulong value) > { > target_ulong mask; > #if defined(FLUSH_ALL_TLBS) > + PowerPCCPU *cpu =3D ppc_env_get_cpu(env); > int do_inval; > #endif > =20 > @@ -1843,7 +1852,7 @@ void helper_store_601_batu(CPUPPCState *env, uint32= _t nr, target_ulong value) > } > #if defined(FLUSH_ALL_TLBS) > if (do_inval) { > - tlb_flush(env, 1); > + tlb_flush(CPU(cpu), 1); > } > #endif > } > @@ -1854,6 +1863,7 @@ void helper_store_601_batl(CPUPPCState *env, uint32= _t nr, target_ulong value) > #if !defined(FLUSH_ALL_TLBS) > target_ulong mask; > #else > + PowerPCCPU *cpu =3D ppc_env_get_cpu(env); > int do_inval; > #endif > =20 > @@ -1882,7 +1892,7 @@ void helper_store_601_batl(CPUPPCState *env, uint32= _t nr, target_ulong value) > env->DBAT[1][nr] =3D value; > #if defined(FLUSH_ALL_TLBS) > if (do_inval) { > - tlb_flush(env, 1); > + tlb_flush(CPU(cpu), 1); > } > #endif > } --=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 --HWvPVVuAAfuRc6SZ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXVNCbAAoJEGw4ysog2bOSJ7YP/3qhBVNShJ8tIwPVhIZIAXj1 ZBV7/TK3sB3XkHfOxxKm+IsdMj9kWJplLiSrk9t6+ZB+v1Orp3lseCYLj3QucJPE am2Fb/hlej3KEA+hs//FYkC7BSuwkkV7LTfdkMR4RnRCssdu3pY53XAXLr/38bbC kvj8YBJE4me5giG4MfYCGP1JMEyFtpN55NoTRiG+OFaspmMPJKeNtO+uoO4dtPrh EWU25KszCUf66Wc1g2Bo1icV4cVfR3HBucsO+S9IgH5FJMwTF2zAVmL7GZj1Yksg qzAJXQZ6i24PcWwltGD4QW6xs43szN/pC3o9g1QjjvMLmYlyRHcnSdYuXvBZFDTD nk2NJ3HaKJCYwo6zy+cCcG69SgO/6jw9uoL9UdIevN1wSOv2sC96ChHC9STSeZi2 uGmr3sBMl90PX0qpDWGaG2GDLbZBxTVs29f08f4YqqxUzvSqp/Zl/yuIPfAyMN+n 49nzW1n/FeE4pwXOPVBYZsTrcwICWtqal+DYuw6/WCt4uRr282+QsFAuO5rRtGir 8g8WenstVRqT7B+bjeT+QcDB1cfevQKtS5kAFgxR/CXDgaU+Dz8TQ02lUgWYI9ZW SGCykvr3N92B8DF1u355QWmFD4Rqq14fB7EY2LdfScO8uXjnswjtJ5OkfL3d6Uqt gIYv3ibhvt7hE8wN/yJv =IIMq -----END PGP SIGNATURE----- --HWvPVVuAAfuRc6SZ--