[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 49/53] target/xtensa: convert to use format_tlb callback
From: |
Max Filippov |
Subject: |
Re: [PATCH v2 49/53] target/xtensa: convert to use format_tlb callback |
Date: |
Wed, 15 Sep 2021 01:01:30 -0700 |
On Tue, Sep 14, 2021 at 7:35 AM Daniel P. Berrangé <berrange@redhat.com> wrote:
>
> Change the "info tlb" implementation to use the format_tlb callback.
>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
> target/xtensa/cpu.h | 2 +-
> target/xtensa/mmu_helper.c | 126 +++++++++++++++++++++----------------
> target/xtensa/monitor.c | 10 ++-
> 3 files changed, 79 insertions(+), 59 deletions(-)
>
> diff --git a/target/xtensa/mmu_helper.c b/target/xtensa/mmu_helper.c
> index b01ff9399a..d499255984 100644
> --- a/target/xtensa/mmu_helper.c
> +++ b/target/xtensa/mmu_helper.c
> @@ -1055,7 +1055,7 @@ int xtensa_get_physical_addr(CPUXtensaState *env, bool
> update_tlb,
> }
> }
>
> -static void dump_tlb(CPUXtensaState *env, bool dtlb)
> +static void dump_tlb(CPUXtensaState *env, bool dtlb, GString *buf)
> {
> unsigned wi, ei;
> const xtensa_tlb *conf =
> @@ -1094,34 +1094,40 @@ static void dump_tlb(CPUXtensaState *env, bool dtlb)
>
> if (print_header) {
> print_header = false;
> - qemu_printf("Way %u (%d %s)\n", wi, sz, sz_text);
> - qemu_printf("\tVaddr Paddr ASID Attr RWX
> Cache\n"
> - "\t---------- ---------- ---- ---- ---
> -------\n");
> + g_string_append_printf(buf, "Way %u (%d %s)\n",
> + wi, sz, sz_text);
> + g_string_append_printf(buf, "\tVaddr Paddr "
> + "ASID Attr RWX Cache\n"
> + "\t---------- ---------- ---- "
> + "---- --- -------\n");
These lines had a nice visual alignment, now they are broken randomly.
Can we please keep them aligned?
> }
> - qemu_printf("\t0x%08x 0x%08x 0x%02x 0x%02x %c%c%c %-7s\n",
> - entry->vaddr,
> - entry->paddr,
> - entry->asid,
> - entry->attr,
> - (access & PAGE_READ) ? 'R' : '-',
> - (access & PAGE_WRITE) ? 'W' : '-',
> - (access & PAGE_EXEC) ? 'X' : '-',
> - cache_text[cache_idx] ?
> - cache_text[cache_idx] : "Invalid");
> + g_string_append_printf(buf, "\t0x%08x 0x%08x 0x%02x "
> + "0x%02x %c%c%c %-7s\n",
> + entry->vaddr,
> + entry->paddr,
> + entry->asid,
> + entry->attr,
> + (access & PAGE_READ) ? 'R' : '-',
> + (access & PAGE_WRITE) ? 'W' : '-',
> + (access & PAGE_EXEC) ? 'X' : '-',
> + cache_text[cache_idx] ?
> + cache_text[cache_idx] : "Invalid");
> }
> }
> }
> }
>
> static void dump_mpu(CPUXtensaState *env,
> - const xtensa_mpu_entry *entry, unsigned n)
> + const xtensa_mpu_entry *entry, unsigned n, GString *buf)
> {
> unsigned i;
>
> - qemu_printf("\t%s Vaddr Attr Ring0 Ring1 System Type
> CPU cache\n"
> - "\t%s ---------- ---------- ----- ----- -------------
> ---------\n",
> - env ? "En" : " ",
> - env ? "--" : " ");
> + g_string_append_printf(buf, "\t%s Vaddr Attr "
> + "Ring0 Ring1 System Type CPU cache\n"
> + "\t%s ---------- ---------- ----- ----- "
> + "------------- ---------\n",
And here as well?
--
Thanks.
-- Max
- [PATCH v2 43/53] target/i386: convert to use format_tlb callback, (continued)
- [PATCH v2 43/53] target/i386: convert to use format_tlb callback, Daniel P . Berrangé, 2021/09/14
- [PATCH v2 44/53] target/m68k: convert to use format_tlb callback, Daniel P . Berrangé, 2021/09/14
- [PATCH v2 45/53] target/nios2: convert to use format_tlb callback, Daniel P . Berrangé, 2021/09/14
- [PATCH v2 46/53] target/ppc: convert to use format_tlb callback, Daniel P . Berrangé, 2021/09/14
- [PATCH v2 47/53] target/sh4: convert to use format_tlb callback, Daniel P . Berrangé, 2021/09/14
- [PATCH v2 48/53] target/sparc: convert to use format_tlb callback, Daniel P . Berrangé, 2021/09/14
- [PATCH v2 49/53] target/xtensa: convert to use format_tlb callback, Daniel P . Berrangé, 2021/09/14
- Re: [PATCH v2 49/53] target/xtensa: convert to use format_tlb callback,
Max Filippov <=
- [PATCH v2 50/53] monitor: merge duplicate "info tlb" handlers, Daniel P . Berrangé, 2021/09/14
- [PATCH v2 51/53] qapi: introduce x-query-tlb QMP command, Daniel P . Berrangé, 2021/09/14
- [PATCH v2 52/53] qapi: introduce x-query-jit QMP command, Daniel P . Berrangé, 2021/09/14
- [PATCH v2 53/53] qapi: introduce x-query-opcount QMP command, Daniel P . Berrangé, 2021/09/14