[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH-for-9.1 19/21] target/xtensa: Simplify dump_mpu() and dump_tlb()
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH-for-9.1 19/21] target/xtensa: Simplify dump_mpu() and dump_tlb() |
Date: |
Thu, 21 Mar 2024 16:48:35 +0100 |
Remove few qemu_printf() calls in xtensa_dump_mmu()
by slightly reworking dump_mpu() and dump_tlb().
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/xtensa/mmu_helper.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/target/xtensa/mmu_helper.c b/target/xtensa/mmu_helper.c
index 8be8d79dcd..3b4f53feb0 100644
--- a/target/xtensa/mmu_helper.c
+++ b/target/xtensa/mmu_helper.c
@@ -203,6 +203,7 @@ static void dump_tlb(CPUXtensaState *env, bool dtlb)
xtensa_option_enabled(env->config, XTENSA_OPTION_MMU) ?
mmu_attr_to_access : region_attr_to_access;
+ qemu_printf("%s:\n", dtlb ? "DTLB" : "IBLB");
for (wi = 0; wi < conf->nways; ++wi) {
uint32_t sz = ~xtensa_tlb_get_addr_mask(env, dtlb, wi) + 1;
const char *sz_text;
@@ -252,11 +253,12 @@ static void dump_tlb(CPUXtensaState *env, bool dtlb)
}
}
-static void dump_mpu(CPUXtensaState *env,
+static void dump_mpu(CPUXtensaState *env, const char *map_desc,
const xtensa_mpu_entry *entry, unsigned n)
{
unsigned i;
+ qemu_printf("%s map:\n", map_desc);
qemu_printf("\t%s Vaddr Attr Ring0 Ring1 System Type
CPU cache\n"
"\t%s ---------- ---------- ----- ----- -------------
---------\n",
env ? "En" : " ",
@@ -316,15 +318,15 @@ void xtensa_dump_mmu(CPUXtensaState *env)
XTENSA_OPTION_BIT(XTENSA_OPTION_REGION_TRANSLATION) |
XTENSA_OPTION_BIT(XTENSA_OPTION_MMU))) {
- qemu_printf("ITLB:\n");
dump_tlb(env, false);
- qemu_printf("\nDTLB:\n");
+ qemu_printf("\n");
dump_tlb(env, true);
} else if (xtensa_option_enabled(env->config, XTENSA_OPTION_MPU)) {
- qemu_printf("Foreground map:\n");
- dump_mpu(env, env->mpu_fg, env->config->n_mpu_fg_segments);
- qemu_printf("\nBackground map:\n");
- dump_mpu(NULL, env->config->mpu_bg, env->config->n_mpu_bg_segments);
+ dump_mpu(env, "Foreground",
+ env->mpu_fg, env->config->n_mpu_fg_segments);
+ qemu_printf("\n");
+ dump_mpu(NULL, "Background",
+ env->config->mpu_bg, env->config->n_mpu_bg_segments);
} else {
qemu_printf("No TLB for this CPU core\n");
}
--
2.41.0
- [PATCH-for-9.1 11/21] target/nios2: Move monitor commands to monitor.c, (continued)
- [PATCH-for-9.1 11/21] target/nios2: Move monitor commands to monitor.c, Philippe Mathieu-Daudé, 2024/03/21
- [PATCH-for-9.1 12/21] target/nios2: Replace qemu_printf() by monitor_printf() in monitor, Philippe Mathieu-Daudé, 2024/03/21
- [PATCH-for-9.1 13/21] target/ppc: Replace qemu_printf() by monitor_printf() in monitor, Philippe Mathieu-Daudé, 2024/03/21
- [PATCH-for-9.1 14/21] target/sh4: Extract sh4_dump_mmu() from hmp_info_tlb(), Philippe Mathieu-Daudé, 2024/03/21
- [PATCH-for-9.0? 15/21] target/sparc: Fix string format errors when DEBUG_MMU is defined, Philippe Mathieu-Daudé, 2024/03/21
- [PATCH-for-9.1 16/21] target/sparc: Replace qemu_printf() by monitor_printf() in monitor, Philippe Mathieu-Daudé, 2024/03/21
- [PATCH-for-9.1 17/21] target/xtensa: Prefix MMU API with 'xtensa_', Philippe Mathieu-Daudé, 2024/03/21
- [PATCH-for-9.1 21/21] target/xtensa: Replace qemu_printf() by monitor_printf() in monitor, Philippe Mathieu-Daudé, 2024/03/21
- [PATCH-for-9.1 18/21] target/xtensa: Extract MMU API to new mmu.c/mmu.h files, Philippe Mathieu-Daudé, 2024/03/21
- [PATCH-for-9.1 20/21] target/xtensa: Move monitor commands to monitor.c, Philippe Mathieu-Daudé, 2024/03/21
- [PATCH-for-9.1 19/21] target/xtensa: Simplify dump_mpu() and dump_tlb(),
Philippe Mathieu-Daudé <=