From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:58109) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RLKZG-00062J-Vf for qemu-devel@nongnu.org; Tue, 01 Nov 2011 16:04:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RLKZF-0000Zu-NK for qemu-devel@nongnu.org; Tue, 01 Nov 2011 16:04:18 -0400 Received: from e31.co.us.ibm.com ([32.97.110.149]:48220) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RLKZF-0000Zo-8X for qemu-devel@nongnu.org; Tue, 01 Nov 2011 16:04:17 -0400 Received: from /spool/local by e31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 1 Nov 2011 13:59:24 -0600 Date: Tue, 1 Nov 2011 12:57:52 -0700 From: Nishanth Aravamudan Message-ID: <20111101195752.GA17615@us.ibm.com> References: <1320031007-25884-1-git-send-email-david@gibson.dropbear.id.au> <1320031007-25884-4-git-send-email-david@gibson.dropbear.id.au> <3CCDA61A-2DAE-416F-879B-ABE3104EED2B@suse.de> <20111031041412.GG9698@truffala.fritz.box> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111031041412.GG9698@truffala.fritz.box> Subject: [Qemu-devel] [PATCH v2] monitor: add ability to dump SLB entries List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf , qemu-devel@nongnu.org, qemu-ppc@nongnu.org On 31.10.2011 [15:14:12 +1100], David Gibson wrote: > Good points below. I forgot to CC Nish, the original patch author on > my post, so I've added him to the list now. > > Nish, can you correct these problems and resend the patch please? 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 --- v2: Update to build on PPC and PPC64 via suggestion from AGraf. diff --git a/target-ppc/helper.c b/target-ppc/helper.c index 137a494..5847453 100644 --- a/target-ppc/helper.c +++ b/target-ppc/helper.c @@ -1545,12 +1545,40 @@ static void mmubooke206_dump_mmu(FILE *f, fprintf_function cpu_fprintf, } } +#if defined(TARGET_PPC64) +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); + } +} +#endif + void dump_mmu(FILE *f, fprintf_function cpu_fprintf, CPUState *env) { switch (env->mmu_model) { case POWERPC_MMU_BOOKE206: mmubooke206_dump_mmu(f, cpu_fprintf, env); break; +#if defined(TARGET_PPC64) + case POWERPC_MMU_64B: + case POWERPC_MMU_2_06: + mmubooks_dump_mmu(f, cpu_fprintf, env); + break; +#endif default: cpu_fprintf(f, "%s: unimplemented\n", __func__); } -- Nishanth Aravamudan IBM Linux Technology Center