memory: dump HPA and access type of ramblocks
PATCH 1/1 memory: dump HPA and access type of ramblocks
It's convenient to dump HVA and RW/RO status of a ramblock in "info ramblock" for debug purpose.
Before:
Offset Used Total0x0000000000000000 0x0000000400000000 0x0000000400000000
After:
Offset Used Total HVA RO0x0000000000000000 0x0000000400000000 0x0000000400000000 0x00007f12ebe00000 rw
--- softmmu/physmem.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
softmmu/physmem.c +10 -4
@@ -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); }
Signature · 1 line
2.34.1
Quoted 7 lines · Ted Chen
It's convenient to dump HVA and RW/RO status of a ramblock in "info ramblock" for debug purpose.
Before:
Offset Used Total0x00000000000000000x00000004000000000x0000000400000000
Quoted 8 lines
After:
Offset Used Total HVA RO0x00000000000000000x00000004000000000x00000004000000000x00007f12ebe00000rwSigned-off-by Ted Chen <[email protected]>--- softmmu/physmem.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
Quoted 36 lines · Ted Chen
It's convenient to dump HVA and RW/RO status of a ramblock in "info ramblock" for debug purpose.
Before:
Offset Used Total0x00000000000000000x00000004000000000x0000000400000000After:
Offset Used Total HVA RO0x00000000000000000x00000004000000000x00000004000000000x00007f12ebe00000rwSigned-off-by Ted Chen <[email protected]>--- softmmu/physmem.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)softmmu/physmem.c +6
-3@@ -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,
softmmu/physmem.c GString *ram_block_format(void) · line 1336
Quoted 10 lines
softmmu/physmem.c +4
-1(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); }
Signature · 3 lines
Thanks, David / dhildenb
Quoted 7 lines · Ted Chen
It's convenient to dump HVA and RW/RO status of a ramblock in "info ramblock" for debug purpose.
Before:
Offset Used Total0x00000000000000000x00000004000000000x0000000400000000
Quoted 5 lines
After:
Offset Used Total HVA RO0x00000000000000000x00000004000000000x00000004000000000x00007f12ebe00000rwSigned-off-by Ted Chen <[email protected]>
Signature · 1 line
Peter Xu
Since I applied this twice already to my local trees, let me ping for Ted to make sure it's not lost..
Quoted 49 lines · Ted Chen
It's convenient to dump HVA and RW/RO status of a ramblock in "info ramblock" for debug purpose.
Before:
Offset Used Total0x00000000000000000x00000004000000000x0000000400000000After:
Offset Used Total HVA RO0x00000000000000000x00000004000000000x00000004000000000x00007f12ebe00000rwSigned-off-by Ted Chen <[email protected]>--- softmmu/physmem.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)softmmu/physmem.c +10
-4@@ -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); }Signature · 1 line
2.34.1
Signature · 1 line
Peter Xu
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
Quoted 57 lines · Peter Xu
Since I applied this twice already to my local trees, let me ping for Ted to make sure it's not lost..
Quoted 49 lines · Ted Chen
It's convenient to dump HVA and RW/RO status of a ramblock in "info ramblock" for debug purpose.
Before:
Offset Used Total0x00000000000000000x00000004000000000x0000000400000000After:
Offset Used Total HVA RO0x00000000000000000x00000004000000000x00000004000000000x00007f12ebe00000rwSigned-off-by Ted Chen <[email protected]>--- softmmu/physmem.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)softmmu/physmem.c +10
-4@@ -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); }Signature · 1 line
2.34.1Signature · 1 line
Peter Xu
Quoted 5 lines · Ted Chen
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).