[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH v4 23/23] target-ppc: Some support for dumping TLB_EMB
From: |
Andreas Färber |
Subject: |
[Qemu-ppc] [PATCH v4 23/23] target-ppc: Some support for dumping TLB_EMB TLBs |
Date: |
Wed, 30 May 2012 16:23:43 +0200 |
From: François Revol <address@hidden>
Add mmubooke_dump_mmu().
TODO: Add printing of individual flags.
Signed-off-by: François Revol <address@hidden>
[agraf: fix coding style]
Signed-off-by: Alexander Graf <address@hidden>
Signed-off-by: Andreas Färber <address@hidden>
---
target-ppc/mmu_helper.c | 50 +++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 50 insertions(+), 0 deletions(-)
diff --git a/target-ppc/mmu_helper.c b/target-ppc/mmu_helper.c
index dfbd759..2260c1d 100644
--- a/target-ppc/mmu_helper.c
+++ b/target-ppc/mmu_helper.c
@@ -1481,6 +1481,53 @@ static const char *book3e_tsize_to_str[32] = {
"1T", "2T"
};
+static void mmubooke_dump_mmu(FILE *f, fprintf_function cpu_fprintf,
+ CPUPPCState *env)
+{
+ ppcemb_tlb_t *entry;
+ int i;
+
+ if (kvm_enabled() && !env->kvm_sw_tlb) {
+ cpu_fprintf(f, "Cannot access KVM TLB\n");
+ return;
+ }
+
+ cpu_fprintf(f, "\nTLB:\n");
+ cpu_fprintf(f, "Effective Physical Size PID Prot "
+ "Attr\n");
+
+ entry = &env->tlb.tlbe[0];
+ for (i = 0; i < env->nb_tlb; i++, entry++) {
+ target_phys_addr_t ea, pa;
+ target_ulong mask;
+ uint64_t size = (uint64_t)entry->size;
+ char size_buf[20];
+
+ /* Check valid flag */
+ if (!(entry->prot & PAGE_VALID)) {
+ continue;
+ }
+
+ mask = ~(entry->size - 1);
+ ea = entry->EPN & mask;
+ pa = entry->RPN & mask;
+#if (TARGET_PHYS_ADDR_BITS >= 36)
+ /* Extend the physical address to 36 bits */
+ pa |= (target_phys_addr_t)(entry->RPN & 0xF) << 32;
+#endif
+ size /= 1024;
+ if (size >= 1024) {
+ snprintf(size_buf, sizeof(size_buf), "%3" PRId64 "M", size / 1024);
+ } else {
+ snprintf(size_buf, sizeof(size_buf), "%3" PRId64 "k", size);
+ }
+ cpu_fprintf(f, "0x%016" PRIx64 " 0x%016" PRIx64 " %s %-5u %08x %08x\n",
+ (uint64_t)ea, (uint64_t)pa, size_buf, (uint32_t)entry->PID,
+ entry->prot, entry->attr);
+ }
+
+}
+
static void mmubooke206_dump_one_tlb(FILE *f, fprintf_function cpu_fprintf,
CPUPPCState *env, int tlbn, int offset,
int tlbsize)
@@ -1578,6 +1625,9 @@ static void mmubooks_dump_mmu(FILE *f, fprintf_function
cpu_fprintf,
void dump_mmu(FILE *f, fprintf_function cpu_fprintf, CPUPPCState *env)
{
switch (env->mmu_model) {
+ case POWERPC_MMU_BOOKE:
+ mmubooke_dump_mmu(f, cpu_fprintf, env);
+ break;
case POWERPC_MMU_BOOKE206:
mmubooke206_dump_mmu(f, cpu_fprintf, env);
break;
--
1.7.7
- [Qemu-ppc] [PATCH v4 02/23] ppc: Split exception helpers, (continued)
- [Qemu-ppc] [PATCH v4 02/23] ppc: Split exception helpers, Andreas Färber, 2012/05/30
- [Qemu-ppc] [PATCH v4 04/23] ppc: Fix coding style in helper.c, Andreas Färber, 2012/05/30
- [Qemu-ppc] [PATCH v4 19/23] ppc: Move misc helpers from helper.c to misc_helper.c, Andreas Färber, 2012/05/30
- [Qemu-ppc] [PATCH v4 18/23] ppc: Avoid AREG0 for misc helpers, Andreas Färber, 2012/05/30
- [Qemu-ppc] [PATCH v4 03/23] ppc: Avoid AREG0 for exception helpers, Andreas Färber, 2012/05/30
- [Qemu-ppc] [PATCH v4 21/23] ppc: Add missing break, Andreas Färber, 2012/05/30
- [Qemu-ppc] [PATCH v4 11/23] ppc: Avoid AREG0 for MMU etc. helpers, Andreas Färber, 2012/05/30
- [Qemu-ppc] [PATCH v4 15/23] ppc: Split off timebase helpers, Andreas Färber, 2012/05/30
- [Qemu-ppc] [PATCH v4 14/23] ppc: Cleanup MMU merge, Andreas Färber, 2012/05/30
- [Qemu-ppc] [PATCH v4 20/23] ppc: Move load and store helpers, switch to AREG0 free mode, Andreas Färber, 2012/05/30
- [Qemu-ppc] [PATCH v4 23/23] target-ppc: Some support for dumping TLB_EMB TLBs,
Andreas Färber <=
- [Qemu-ppc] [PATCH v4 12/23] ppc: Avoid a warning with the next patch, Andreas Färber, 2012/05/30
- [Qemu-ppc] [PATCH v4 05/23] ppc: Move exception helpers from helper.c to excp_helper.c, Andreas Färber, 2012/05/30
- [Qemu-ppc] [PATCH v4 17/23] ppc: Split off misc helpers, Andreas Färber, 2012/05/30
- [Qemu-ppc] [PATCH v4 16/23] ppc: Avoid AREG0 for timebase helpers, Andreas Färber, 2012/05/30
- [Qemu-ppc] [PATCH v4 22/23] ppc: Make hbrev table const, Andreas Färber, 2012/05/30
- [Qemu-ppc] [PATCH v4 07/23] ppc: Avoid AREG0 for FPU and SPE helpers, Andreas Färber, 2012/05/30
- [Qemu-ppc] [PATCH v4 09/23] ppc: Avoid AREG0 for integer and vector helpers, Andreas Färber, 2012/05/30
- [Qemu-ppc] [PATCH v4 10/23] ppc: Split MMU etc. helpers from op_helper.c, Andreas Färber, 2012/05/30
- [Qemu-ppc] [PATCH v4 08/23] ppc: Split integer and vector ops, Andreas Färber, 2012/05/30