From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:48514) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RdA8x-00062K-2N for qemu-devel@nongnu.org; Tue, 20 Dec 2011 19:34:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RdA8t-0007R8-2V for qemu-devel@nongnu.org; Tue, 20 Dec 2011 19:34:51 -0500 Date: Wed, 21 Dec 2011 11:33:46 +1100 From: David Gibson Message-ID: <20111221003346.GA5188@truffala.fritz.box> References: <1323750275-947-1-git-send-email-david@gibson.dropbear.id.au> <1323750275-947-3-git-send-email-david@gibson.dropbear.id.au> <0B54269F-3B52-4466-A7F1-033F81B13DD5@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0B54269F-3B52-4466-A7F1-033F81B13DD5@suse.de> Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH 2/8] monitor: add ability to dump SLB entries List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org On Tue, Dec 20, 2011 at 04:28:47PM +0100, Alexander Graf wrote: > > On 13.12.2011, at 05:24, David Gibson wrote: > > > From: Nishanth Aravamudan > > > > When run with a PPC Book3S (server) CPU Currently 'info tlb' in the > > qemu monitor reports "dump_mmu: unimplemented". However, during > > bringup work, it can be quite handy to have the SLB entries, which are > > available in the CPUPPCState. This patch adds an implementation of > > info tlb for book3s, which dumps the SLB. > > > > Signed-off-by: Nishanth Aravamudan > > Signed-off-by: David Gibson > > --- > > target-ppc/helper.c | 32 +++++++++++++++++++++++++++----- > > 1 files changed, 27 insertions(+), 5 deletions(-) > > > > diff --git a/target-ppc/helper.c b/target-ppc/helper.c > > index 137a494..29c7050 100644 > > --- a/target-ppc/helper.c > > +++ b/target-ppc/helper.c > > @@ -1545,14 +1545,36 @@ static void mmubooke206_dump_mmu(FILE *f, fprintf_function cpu_fprintf, > > } > > } > > > > +static void mmubooks_dump_mmu(FILE *f, fprintf_function cpu_fprintf, > > + CPUState *env) > > +{ > > + int i; > > + uint64_t slbe, slbv; > > + > > + cpu_synchronize_state(env); > > + > > + cpu_fprintf(f, "SLB\tESID\t\t\tVSID\n"); > > + for (i = 0; i < env->slb_nr; i++) { > > + slbe = env->slb[i].esid; > > + slbv = env->slb[i].vsid; > > + if (slbe == 0 && slbv == 0) { > > + continue; > > + } > > + cpu_fprintf(f, "%d\t0x%016" PRIx64 "\t0x%016" PRIx64 "\n", > > + i, slbe, slbv); > > + } > > +} > > + > > void dump_mmu(FILE *f, fprintf_function cpu_fprintf, CPUState *env) > > { > > - switch (env->mmu_model) { > > - case POWERPC_MMU_BOOKE206: > > + if (env->mmu_model == POWERPC_MMU_BOOKE206) { > > mmubooke206_dump_mmu(f, cpu_fprintf, env); > > - break; > > - default: > > - cpu_fprintf(f, "%s: unimplemented\n", __func__); > > + } else { > > + if ((env->mmu_model & POWERPC_MMU_64B) != 0) { > > + mmubooks_dump_mmu(f, cpu_fprintf, env); > > + } else { > > + cpu_fprintf(f, "%s: unimplemented\n", __func__); > > + } > > Didn't I comment on this one before, saying that it should stay a > switch? In fact, I even applied his v2 already. Ah, yes, sorry. I was tracking upstream, so I forgot it was in your tree. -- 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