* [PATCH] memory: dump HPA and access type of ramblocks
@ 2022-12-05 12:07 Ted Chen
2022-12-05 12:12 ` Philippe Mathieu-Daudé
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Ted Chen @ 2022-12-05 12:07 UTC (permalink / raw)
To: pbonzini, peterx, david, philmd; +Cc: qemu-devel, Ted Chen
It's convenient to dump HVA and RW/RO status of a ramblock in "info ramblock"
for debug purpose.
Before:
Offset Used Total
0x0000000000000000 0x0000000400000000 0x0000000400000000
After:
Offset Used Total HVA RO
0x0000000000000000 0x0000000400000000 0x0000000400000000 0x00007f12ebe00000 rw
Signed-off-by: Ted Chen <znscnchen@gmail.com>
---
softmmu/physmem.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/softmmu/physmem.c b/softmmu/physmem.c
index 1b606a3002..fed4dfb72c 100644
--- a/softmmu/physmem.c
+++ b/softmmu/physmem.c
@@ -1316,15 +1316,21 @@ GString *ram_block_format(void)
GString *buf = g_string_new("");
RCU_READ_LOCK_GUARD();
- g_string_append_printf(buf, "%24s %8s %18s %18s %18s\n",
- "Block Name", "PSize", "Offset", "Used", "Total");
+ g_string_append_printf(buf, "%24s %8s %18s %18s %18s %18s %3s\n",
+ "Block Name", "PSize", "Offset", "Used", "Total",
+ "HVA", "RO");
+
RAMBLOCK_FOREACH(block) {
psize = size_to_str(block->page_size);
g_string_append_printf(buf, "%24s %8s 0x%016" PRIx64 " 0x%016" PRIx64
- " 0x%016" PRIx64 "\n", block->idstr, psize,
+ " 0x%016" PRIx64 " 0x%016" PRIx64 " %3s\n",
+ block->idstr, psize,
(uint64_t)block->offset,
(uint64_t)block->used_length,
- (uint64_t)block->max_length);
+ (uint64_t)block->max_length,
+ (uint64_t)block->host,
+ block->mr->readonly ? "ro" : "rw");
+
g_free(psize);
}
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] memory: dump HPA and access type of ramblocks
2022-12-05 12:07 [PATCH] memory: dump HPA and access type of ramblocks Ted Chen
@ 2022-12-05 12:12 ` Philippe Mathieu-Daudé
2022-12-05 12:15 ` David Hildenbrand
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Philippe Mathieu-Daudé @ 2022-12-05 12:12 UTC (permalink / raw)
To: Ted Chen, pbonzini, peterx, david; +Cc: qemu-devel
On 5/12/22 13:07, Ted Chen wrote:
> It's convenient to dump HVA and RW/RO status of a ramblock in "info ramblock"
> for debug purpose.
>
> Before:
> Offset Used Total
> 0x0000000000000000 0x0000000400000000 0x0000000400000000
>
> After:
> Offset Used Total HVA RO
> 0x0000000000000000 0x0000000400000000 0x0000000400000000 0x00007f12ebe00000 rw
>
> Signed-off-by: Ted Chen <znscnchen@gmail.com>
> ---
> softmmu/physmem.c | 14 ++++++++++----
> 1 file changed, 10 insertions(+), 4 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] memory: dump HPA and access type of ramblocks
2022-12-05 12:07 [PATCH] memory: dump HPA and access type of ramblocks Ted Chen
2022-12-05 12:12 ` Philippe Mathieu-Daudé
@ 2022-12-05 12:15 ` David Hildenbrand
2022-12-05 14:54 ` Peter Xu
2023-01-06 18:01 ` Peter Xu
3 siblings, 0 replies; 7+ messages in thread
From: David Hildenbrand @ 2022-12-05 12:15 UTC (permalink / raw)
To: Ted Chen, pbonzini, peterx, philmd; +Cc: qemu-devel
On 05.12.22 13:07, Ted Chen wrote:
> It's convenient to dump HVA and RW/RO status of a ramblock in "info ramblock"
> for debug purpose.
>
> Before:
> Offset Used Total
> 0x0000000000000000 0x0000000400000000 0x0000000400000000
>
> After:
> Offset Used Total HVA RO
> 0x0000000000000000 0x0000000400000000 0x0000000400000000 0x00007f12ebe00000 rw
>
> Signed-off-by: Ted Chen <znscnchen@gmail.com>
> ---
> softmmu/physmem.c | 14 ++++++++++----
> 1 file changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/softmmu/physmem.c b/softmmu/physmem.c
> index 1b606a3002..fed4dfb72c 100644
> --- a/softmmu/physmem.c
> +++ b/softmmu/physmem.c
> @@ -1316,15 +1316,21 @@ GString *ram_block_format(void)
> GString *buf = g_string_new("");
>
> RCU_READ_LOCK_GUARD();
> - g_string_append_printf(buf, "%24s %8s %18s %18s %18s\n",
> - "Block Name", "PSize", "Offset", "Used", "Total");
> + g_string_append_printf(buf, "%24s %8s %18s %18s %18s %18s %3s\n",
> + "Block Name", "PSize", "Offset", "Used", "Total",
> + "HVA", "RO");
> +
> RAMBLOCK_FOREACH(block) {
> psize = size_to_str(block->page_size);
> g_string_append_printf(buf, "%24s %8s 0x%016" PRIx64 " 0x%016" PRIx64
> - " 0x%016" PRIx64 "\n", block->idstr, psize,
> + " 0x%016" PRIx64 " 0x%016" PRIx64 " %3s\n",
> + block->idstr, psize,
> (uint64_t)block->offset,
> (uint64_t)block->used_length,
> - (uint64_t)block->max_length);
> + (uint64_t)block->max_length,
> + (uint64_t)block->host,
> + block->mr->readonly ? "ro" : "rw");
> +
> g_free(psize);
> }
>
Reviewed-by: David Hildenbrand <david@redhat.com>
--
Thanks,
David / dhildenb
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] memory: dump HPA and access type of ramblocks
2022-12-05 12:07 [PATCH] memory: dump HPA and access type of ramblocks Ted Chen
2022-12-05 12:12 ` Philippe Mathieu-Daudé
2022-12-05 12:15 ` David Hildenbrand
@ 2022-12-05 14:54 ` Peter Xu
2023-01-06 18:01 ` Peter Xu
3 siblings, 0 replies; 7+ messages in thread
From: Peter Xu @ 2022-12-05 14:54 UTC (permalink / raw)
To: Ted Chen; +Cc: pbonzini, david, philmd, qemu-devel
On Mon, Dec 05, 2022 at 08:07:12PM +0800, Ted Chen wrote:
> It's convenient to dump HVA and RW/RO status of a ramblock in "info ramblock"
> for debug purpose.
>
> Before:
> Offset Used Total
> 0x0000000000000000 0x0000000400000000 0x0000000400000000
>
> After:
> Offset Used Total HVA RO
> 0x0000000000000000 0x0000000400000000 0x0000000400000000 0x00007f12ebe00000 rw
>
> Signed-off-by: Ted Chen <znscnchen@gmail.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
--
Peter Xu
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] memory: dump HPA and access type of ramblocks
2022-12-05 12:07 [PATCH] memory: dump HPA and access type of ramblocks Ted Chen
` (2 preceding siblings ...)
2022-12-05 14:54 ` Peter Xu
@ 2023-01-06 18:01 ` Peter Xu
2023-03-01 12:07 ` Ted Chen
3 siblings, 1 reply; 7+ messages in thread
From: Peter Xu @ 2023-01-06 18:01 UTC (permalink / raw)
To: Ted Chen; +Cc: pbonzini, david, philmd, qemu-devel
Since I applied this twice already to my local trees, let me ping for Ted
to make sure it's not lost..
On Mon, Dec 05, 2022 at 08:07:12PM +0800, Ted Chen wrote:
> It's convenient to dump HVA and RW/RO status of a ramblock in "info ramblock"
> for debug purpose.
>
> Before:
> Offset Used Total
> 0x0000000000000000 0x0000000400000000 0x0000000400000000
>
> After:
> Offset Used Total HVA RO
> 0x0000000000000000 0x0000000400000000 0x0000000400000000 0x00007f12ebe00000 rw
>
> Signed-off-by: Ted Chen <znscnchen@gmail.com>
> ---
> softmmu/physmem.c | 14 ++++++++++----
> 1 file changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/softmmu/physmem.c b/softmmu/physmem.c
> index 1b606a3002..fed4dfb72c 100644
> --- a/softmmu/physmem.c
> +++ b/softmmu/physmem.c
> @@ -1316,15 +1316,21 @@ GString *ram_block_format(void)
> GString *buf = g_string_new("");
>
> RCU_READ_LOCK_GUARD();
> - g_string_append_printf(buf, "%24s %8s %18s %18s %18s\n",
> - "Block Name", "PSize", "Offset", "Used", "Total");
> + g_string_append_printf(buf, "%24s %8s %18s %18s %18s %18s %3s\n",
> + "Block Name", "PSize", "Offset", "Used", "Total",
> + "HVA", "RO");
> +
> RAMBLOCK_FOREACH(block) {
> psize = size_to_str(block->page_size);
> g_string_append_printf(buf, "%24s %8s 0x%016" PRIx64 " 0x%016" PRIx64
> - " 0x%016" PRIx64 "\n", block->idstr, psize,
> + " 0x%016" PRIx64 " 0x%016" PRIx64 " %3s\n",
> + block->idstr, psize,
> (uint64_t)block->offset,
> (uint64_t)block->used_length,
> - (uint64_t)block->max_length);
> + (uint64_t)block->max_length,
> + (uint64_t)block->host,
> + block->mr->readonly ? "ro" : "rw");
> +
> g_free(psize);
> }
>
> --
> 2.34.1
>
--
Peter Xu
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] memory: dump HPA and access type of ramblocks
2023-01-06 18:01 ` Peter Xu
@ 2023-03-01 12:07 ` Ted Chen
2023-03-09 13:33 ` Philippe Mathieu-Daudé
0 siblings, 1 reply; 7+ messages in thread
From: Ted Chen @ 2023-03-01 12:07 UTC (permalink / raw)
To: pbonzini; +Cc: peterx, david, philmd, qemu-devel
Thanks, Peter.
hi Paolo,
A gentle ping:)
May I know what's your opinion to this patch? Any concern or further improvement required?
Thanks
Ted
On Fri, Jan 06, 2023 at 01:01:03PM -0500, Peter Xu wrote:
> Since I applied this twice already to my local trees, let me ping for Ted
> to make sure it's not lost..
>
> On Mon, Dec 05, 2022 at 08:07:12PM +0800, Ted Chen wrote:
> > It's convenient to dump HVA and RW/RO status of a ramblock in "info ramblock"
> > for debug purpose.
> >
> > Before:
> > Offset Used Total
> > 0x0000000000000000 0x0000000400000000 0x0000000400000000
> >
> > After:
> > Offset Used Total HVA RO
> > 0x0000000000000000 0x0000000400000000 0x0000000400000000 0x00007f12ebe00000 rw
> >
> > Signed-off-by: Ted Chen <znscnchen@gmail.com>
> > ---
> > softmmu/physmem.c | 14 ++++++++++----
> > 1 file changed, 10 insertions(+), 4 deletions(-)
> >
> > diff --git a/softmmu/physmem.c b/softmmu/physmem.c
> > index 1b606a3002..fed4dfb72c 100644
> > --- a/softmmu/physmem.c
> > +++ b/softmmu/physmem.c
> > @@ -1316,15 +1316,21 @@ GString *ram_block_format(void)
> > GString *buf = g_string_new("");
> >
> > RCU_READ_LOCK_GUARD();
> > - g_string_append_printf(buf, "%24s %8s %18s %18s %18s\n",
> > - "Block Name", "PSize", "Offset", "Used", "Total");
> > + g_string_append_printf(buf, "%24s %8s %18s %18s %18s %18s %3s\n",
> > + "Block Name", "PSize", "Offset", "Used", "Total",
> > + "HVA", "RO");
> > +
> > RAMBLOCK_FOREACH(block) {
> > psize = size_to_str(block->page_size);
> > g_string_append_printf(buf, "%24s %8s 0x%016" PRIx64 " 0x%016" PRIx64
> > - " 0x%016" PRIx64 "\n", block->idstr, psize,
> > + " 0x%016" PRIx64 " 0x%016" PRIx64 " %3s\n",
> > + block->idstr, psize,
> > (uint64_t)block->offset,
> > (uint64_t)block->used_length,
> > - (uint64_t)block->max_length);
> > + (uint64_t)block->max_length,
> > + (uint64_t)block->host,
> > + block->mr->readonly ? "ro" : "rw");
> > +
> > g_free(psize);
> > }
> >
> > --
> > 2.34.1
> >
>
> --
> Peter Xu
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] memory: dump HPA and access type of ramblocks
2023-03-01 12:07 ` Ted Chen
@ 2023-03-09 13:33 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 7+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-03-09 13:33 UTC (permalink / raw)
To: Ted Chen, pbonzini; +Cc: peterx, david, qemu-devel
On 1/3/23 13:07, Ted Chen wrote:
> Thanks, Peter.
>
> hi Paolo,
> A gentle ping:)
> May I know what's your opinion to this patch? Any concern or further improvement required?
Merged as commit dbc6ae9c3b (fixing format string on 32-bit hosts).
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-03-09 13:34 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-05 12:07 [PATCH] memory: dump HPA and access type of ramblocks Ted Chen
2022-12-05 12:12 ` Philippe Mathieu-Daudé
2022-12-05 12:15 ` David Hildenbrand
2022-12-05 14:54 ` Peter Xu
2023-01-06 18:01 ` Peter Xu
2023-03-01 12:07 ` Ted Chen
2023-03-09 13:33 ` Philippe Mathieu-Daudé
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.