From: "Daniel P. Berrangé" <berrange@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>
Cc: Don Porter <porter@cs.unc.edu>,
qemu-devel@nongnu.org, dave@treblig.org,
peter.maydell@linaro.org, nadav.amit@gmail.com,
richard.henderson@linaro.org
Subject: Re: [PATCH v3 2/6] Convert 'info tlb' to use generic iterator
Date: Mon, 10 Jun 2024 10:13:06 +0100 [thread overview]
Message-ID: <ZmbDosOA7EzarYuJ@redhat.com> (raw)
In-Reply-To: <1dd777bb-184d-4c0d-ad80-afa65e0c58bd@linaro.org>
On Fri, Jun 07, 2024 at 08:02:51AM +0200, Philippe Mathieu-Daudé wrote:
> Hi Don,
>
> (Cc'ing Daniel for HumanReadableText)
>
> On 6/6/24 16:02, Don Porter wrote:
> > Signed-off-by: Don Porter <porter@cs.unc.edu>
> > ---
> > include/hw/core/sysemu-cpu-ops.h | 7 +
> > monitor/hmp-cmds-target.c | 1 +
> > target/i386/cpu.h | 2 +
> > target/i386/monitor.c | 217 ++++++-------------------------
> > 4 files changed, 53 insertions(+), 174 deletions(-)
> >
> > diff --git a/include/hw/core/sysemu-cpu-ops.h b/include/hw/core/sysemu-cpu-ops.h
> > index eb16a1c3e2..bf3de3e004 100644
> > --- a/include/hw/core/sysemu-cpu-ops.h
> > +++ b/include/hw/core/sysemu-cpu-ops.h
> > @@ -243,6 +243,13 @@ typedef struct SysemuCPUOps {
> > bool (*mon_flush_page_print_state)(CPUState *cs,
> > struct mem_print_state *state);
> > + /**
> > + * @mon_print_pte: Hook called by the monitor to print a page
> > + * table entry at address addr, with contents pte.
> > + */
> > + void (*mon_print_pte) (Monitor *mon, CPUArchState *env, hwaddr addr,
> > + hwaddr pte);
>
> IMO the SysemuCPUOps prototype should not use the monitor and return
> a HumanReadableText:
>
> HumanReadableText *(*mon_print_pte)(CPUArchState *env,
> hwaddr addr, hwaddr pte);
>
> Then define a QMP handler, itself registered to the monitor using
> monitor_register_hmp_info_hrt().
IIUC, this method is called repeatedly from an iterator, so I
think you would need to be instead relpacing the 'Monitor *mon'
parmeter with "GString *str", and print into that buffer.
The HumanReadableText would be created from teh GString higher
up in the call path.
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2024-06-10 9:14 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-06 14:02 [PATCH v3 0/6] Rework x86 page table walks Don Porter
2024-06-06 14:02 ` [PATCH v3 1/6] Add an "info pg" command that prints the current page tables Don Porter
2024-06-07 6:09 ` Philippe Mathieu-Daudé
2024-06-07 7:16 ` Daniel P. Berrangé
2024-06-11 18:49 ` Don Porter
2024-06-07 16:57 ` Richard Henderson
2024-06-14 18:16 ` Don Porter
2024-06-07 17:43 ` Richard Henderson
2024-06-14 21:14 ` Don Porter
2024-06-15 15:34 ` Richard Henderson
2024-06-06 14:02 ` [PATCH v3 2/6] Convert 'info tlb' to use generic iterator Don Porter
2024-06-07 6:02 ` Philippe Mathieu-Daudé
2024-06-10 9:13 ` Daniel P. Berrangé [this message]
2024-06-06 14:02 ` [PATCH v3 3/6] Convert 'info mem' " Don Porter
2024-06-10 9:15 ` Daniel P. Berrangé
2024-06-06 14:02 ` [PATCH v3 4/6] Convert x86_cpu_get_memory_mapping() to use generic iterators Don Porter
2024-06-06 14:02 ` [PATCH v3 5/6] Move tcg implementation of x86 get_physical_address into common helper code Don Porter
2024-06-07 6:12 ` Philippe Mathieu-Daudé
2024-06-07 17:03 ` Richard Henderson
2024-06-15 12:49 ` Don Porter
2024-06-06 14:02 ` [PATCH v3 6/6] Convert x86_mmu_translate() to use common code Don Porter
2024-06-07 17:28 ` Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZmbDosOA7EzarYuJ@redhat.com \
--to=berrange@redhat.com \
--cc=dave@treblig.org \
--cc=nadav.amit@gmail.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=porter@cs.unc.edu \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).