[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 19/20] memory: Dump HPA and access type of ramblocks
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 19/20] memory: Dump HPA and access type of ramblocks |
Date: |
Wed, 8 Mar 2023 00:47:10 +0100 |
From: Ted Chen <znscnchen@gmail.com>
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>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20221205120712.269013-1-znscnchen@gmail.com>
[PMD: Add uintptr_t cast for 32-bit hosts]
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
softmmu/physmem.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/softmmu/physmem.c b/softmmu/physmem.c
index 47143edb4f..085b3ca6d2 100644
--- a/softmmu/physmem.c
+++ b/softmmu/physmem.c
@@ -1126,15 +1126,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)(uintptr_t)block->host,
+ block->mr->readonly ? "ro" : "rw");
+
g_free(psize);
}
--
2.38.1
- [PULL 11/20] hw/display/sm501: Add debug property to control pixman usage, (continued)
- [PULL 15/20] hw/usb/vt82c686-uhci-pci: Use PCI IRQ routing, Philippe Mathieu-Daudé, 2023/03/07
- [PULL 16/20] hw/audio/via-ac97: Basic implementation of audio playback, Philippe Mathieu-Daudé, 2023/03/07
- [PULL 17/20] hw/usb/ohci: Implement resume on connection status change, Philippe Mathieu-Daudé, 2023/03/07
- [PULL 19/20] memory: Dump HPA and access type of ramblocks,
Philippe Mathieu-Daudé <=
- [PULL 20/20] log: Remove unneeded new line, Philippe Mathieu-Daudé, 2023/03/07
- [PULL 18/20] ui/cocoa: Override windowDidResignKey, Philippe Mathieu-Daudé, 2023/03/07
- Re: [PULL 00/20] MIPS patches for 2023-03-07, Peter Maydell, 2023/03/09