qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] memory: dump HPA and access type of ramblocks


From: David Hildenbrand
Subject: Re: [PATCH] memory: dump HPA and access type of ramblocks
Date: Mon, 5 Dec 2022 13:15:18 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]