Skip to contentSkip to conversation

memory: Fix wrong end address dump

PATCH In review Zhenzhong Duan 4 participants 6 messages Jun 22, 2022 – Oct 28, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 memory: Fix wrong end address dump

The end address of memory region section isn't correctly calculated which leads to overflowed mtree dump:

Dispatch

    Physical sections
      ......
      #70 @0000000000002000..0000000000011fff io [ROOT]
      #71 @0000000000005000..0000000000005fff (noname)
      #72 @0000000000005000..0000000000014fff io [ROOT]
      #73 @0000000000005658..0000000000005658 vmport
      #74 @0000000000005659..0000000000015658 io [ROOT]
      #75 @0000000000006000..0000000000015fff io [ROOT]

After fix:

      #70 @0000000000002000..0000000000004fff io [ROOT]
      #71 @0000000000005000..0000000000005fff (noname)
      #72 @0000000000005000..0000000000005657 io [ROOT]
      #73 @0000000000005658..0000000000005658 vmport
      #74 @0000000000005659..0000000000005fff io [ROOT]
      #75 @0000000000006000..000000000000ffff io [ROOT]
Fixes 5e8fd947e2670 ("memory: Rework "info mtree" to print flat views and dispatch trees")
---
 softmmu/physmem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
softmmu/physmem.c +1 -1
index 214cb04c8fc3..cbabd10ac0bf 100644
@@ -3701,7 +3701,7 @@ void mtree_print_dispatch(AddressSpaceDispatch *d, MemoryRegion *root)
                     " %s%s%s%s%s",
             i,
             s->offset_within_address_space,
-            s->offset_within_address_space + MR_SIZE(s->mr->size),
+            s->offset_within_address_space + MR_SIZE(s->size),
             s->mr->name ? s->mr->name : "(noname)",
             i < ARRAY_SIZE(names) ? names[i] : "",
             s->mr == root ? " [ROOT]" : "",
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 21 lines · Zhenzhong Duan

The end address of memory region section isn't correctly calculated which leads to overflowed mtree dump:

Dispatch

    Physical sections
      ......
      #70 @0000000000002000..0000000000011fff io [ROOT]
      #71 @0000000000005000..0000000000005fff (noname)
      #72 @0000000000005000..0000000000014fff io [ROOT]
      #73 @0000000000005658..0000000000005658 vmport
      #74 @0000000000005659..0000000000015658 io [ROOT]
      #75 @0000000000006000..0000000000015fff io [ROOT]

After fix:

      #70 @0000000000002000..0000000000004fff io [ROOT]
      #71 @0000000000005000..0000000000005fff (noname)
      #72 @0000000000005000..0000000000005657 io [ROOT]
      #73 @0000000000005658..0000000000005658 vmport
      #74 @0000000000005659..0000000000005fff io [ROOT]
      #75 @0000000000006000..000000000000ffff io [ROOT]
Quoted 2 lines
Fixes 5e8fd947e2670 ("memory: Rework "info mtree" to print flat views and dispatch trees")
Signature · 1 line
Peter Xu
#2 lore raw
Quoted 32 lines

-----Original Message-----
From: Peter Xu <[email protected]>
Sent: Thursday, June 23, 2022 5:05 AM
To: Duan, Zhenzhong <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH] memory: Fix wrong end address dump

Quoted 21 lines · Zhenzhong Duan

The end address of memory region section isn't correctly calculated which leads to overflowed mtree dump:

Dispatch

    Physical sections
      ......
      #70 @0000000000002000..0000000000011fff io [ROOT]
      #71 @0000000000005000..0000000000005fff (noname)
      #72 @0000000000005000..0000000000014fff io [ROOT]
      #73 @0000000000005658..0000000000005658 vmport
      #74 @0000000000005659..0000000000015658 io [ROOT]
      #75 @0000000000006000..0000000000015fff io [ROOT]

After fix:

      #70 @0000000000002000..0000000000004fff io [ROOT]
      #71 @0000000000005000..0000000000005fff (noname)
      #72 @0000000000005000..0000000000005657 io [ROOT]
      #73 @0000000000005658..0000000000005658 vmport
      #74 @0000000000005659..0000000000005fff io [ROOT]
      #75 @0000000000006000..000000000000ffff io [ROOT]
Quoted 5 lines
Quoted 3 lines
Fixes 5e8fd947e2670 ("memory: Rework "info mtree" to print flat views

and dispatch trees")

Hi,

No progress for a long time, any further comments? Thanks!

Zhenzhong

Reviewed-by on v1 1/1
#3 lore raw
In reply to Zhenzhong Duan
Quoted 32 lines · Zhenzhong Duan

The end address of memory region section isn't correctly calculated which leads to overflowed mtree dump:

Dispatch

    Physical sections
      ......
      #70 @0000000000002000..0000000000011fff io [ROOT]
      #71 @0000000000005000..0000000000005fff (noname)
      #72 @0000000000005000..0000000000014fff io [ROOT]
      #73 @0000000000005658..0000000000005658 vmport
      #74 @0000000000005659..0000000000015658 io [ROOT]
      #75 @0000000000006000..0000000000015fff io [ROOT]

After fix:

      #70 @0000000000002000..0000000000004fff io [ROOT]
      #71 @0000000000005000..0000000000005fff (noname)
      #72 @0000000000005000..0000000000005657 io [ROOT]
      #73 @0000000000005658..0000000000005658 vmport
      #74 @0000000000005659..0000000000005fff io [ROOT]
      #75 @0000000000006000..000000000000ffff io [ROOT]
Fixes 5e8fd947e2670 ("memory: Rework "info mtree" to print flat views and dispatch trees")
---
 softmmu/physmem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
softmmu/physmem.c +0 -0
index 214cb04c8fc3..cbabd10ac0bf 100644

softmmu/physmem.c void mtree_print_dispatch(AddressSpaceDispatch *d, MemoryRegion *root) · line 3707

Quoted 8 lines
softmmu/physmem.c +1 -1
@@ -3701,7 +3701,7 @@ void mtree_print_dispatch(AddressSpaceDispatch *d, MemoryRegion *root)
                     " %s%s%s%s%s",
             i,
             s->offset_within_address_space,
-            s->offset_within_address_space + MR_SIZE(s->mr->size),
+            s->offset_within_address_space + MR_SIZE(s->size),
             s->mr->name ? s->mr->name : "(noname)",
             i < ARRAY_SIZE(names) ? names[i] : "",
             s->mr == root ? " [ROOT]" : "",

I assume this should get picked up soonish.

Signature · 3 lines
Thanks,

David / dhildenb
#4 lore raw
Quoted 54 lines

-----Original Message-----
From: David Hildenbrand <[email protected]>
Sent: Friday, July 22, 2022 2:44 PM
To: Duan, Zhenzhong <[email protected]>; qemu- [email protected]
Cc: [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH] memory: Fix wrong end address dump

softmmu/physmem.c void mtree_print_dispatch(AddressSpaceDispatch

Quoted 33 lines · Zhenzhong Duan

The end address of memory region section isn't correctly calculated which leads to overflowed mtree dump:

Dispatch

    Physical sections
      ......
      #70 @0000000000002000..0000000000011fff io [ROOT]
      #71 @0000000000005000..0000000000005fff (noname)
      #72 @0000000000005000..0000000000014fff io [ROOT]
      #73 @0000000000005658..0000000000005658 vmport
      #74 @0000000000005659..0000000000015658 io [ROOT]
      #75 @0000000000006000..0000000000015fff io [ROOT]

After fix:

      #70 @0000000000002000..0000000000004fff io [ROOT]
      #71 @0000000000005000..0000000000005fff (noname)
      #72 @0000000000005000..0000000000005657 io [ROOT]
      #73 @0000000000005658..0000000000005658 vmport
      #74 @0000000000005659..0000000000005fff io [ROOT]
      #75 @0000000000006000..000000000000ffff io [ROOT]
Fixes 5e8fd947e2670 ("memory: Rework "info mtree" to print flat views

and dispatch trees")

---
 softmmu/physmem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
softmmu/physmem.c index renamed from softmmu/physmem.c +0 -0

214cb04c8fc3..cbabd10ac0bf 100644

softmmu/physmem.c +0 -0
@@ -3701,7 +3701,7 @@ void mtree_print_dispatch(AddressSpaceDispatch

*d, MemoryRegion *root)

softmmu/physmem.c void mtree_print_dispatch(AddressSpaceDispatch *d, MemoryRegion *root) · line 3707

Quoted 8 lines
softmmu/physmem.c +1 -1
                     " %s%s%s%s%s",
             i,
             s->offset_within_address_space,
-            s->offset_within_address_space + MR_SIZE(s->mr->size),
+            s->offset_within_address_space + MR_SIZE(s->size),
             s->mr->name ? s->mr->name : "(noname)",
             i < ARRAY_SIZE(names) ? names[i] : "",
             s->mr == root ? " [ROOT]" : "",
Quoted 3 lines

I assume this should get picked up soonish.

Hi Maintainers,

Can this patch be considered merged as it got reviewed-by and no objection for a long time. Thanks.

Zhenzhong

#5 lore raw
Quoted 54 lines · Zhenzhong
Quoted 54 lines

-----Original Message-----
From: David Hildenbrand <[email protected]>
Sent: Friday, July 22, 2022 2:44 PM
To: Duan, Zhenzhong <[email protected]>; qemu- [email protected]
Cc: [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH] memory: Fix wrong end address dump

softmmu/physmem.c void mtree_print_dispatch(AddressSpaceDispatch

Quoted 33 lines · Zhenzhong Duan

The end address of memory region section isn't correctly calculated which leads to overflowed mtree dump:

   Dispatch
     Physical sections
       ......
       #70 @0000000000002000..0000000000011fff io [ROOT]
       #71 @0000000000005000..0000000000005fff (noname)
       #72 @0000000000005000..0000000000014fff io [ROOT]
       #73 @0000000000005658..0000000000005658 vmport
       #74 @0000000000005659..0000000000015658 io [ROOT]
       #75 @0000000000006000..0000000000015fff io [ROOT]

After fix:

       #70 @0000000000002000..0000000000004fff io [ROOT]
       #71 @0000000000005000..0000000000005fff (noname)
       #72 @0000000000005000..0000000000005657 io [ROOT]
       #73 @0000000000005658..0000000000005658 vmport
       #74 @0000000000005659..0000000000005fff io [ROOT]
       #75 @0000000000006000..000000000000ffff io [ROOT]
Fixes 5e8fd947e2670 ("memory: Rework "info mtree" to print flat views

and dispatch trees")

---
  softmmu/physmem.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
softmmu/physmem.c index renamed from softmmu/physmem.c +0 -0

214cb04c8fc3..cbabd10ac0bf 100644

softmmu/physmem.c +0 -0
@@ -3701,7 +3701,7 @@ void mtree_print_dispatch(AddressSpaceDispatch

*d, MemoryRegion *root)

Quoted 8 lines
softmmu/physmem.c +1 -1
                      " %s%s%s%s%s",
              i,
              s->offset_within_address_space,
-            s->offset_within_address_space + MR_SIZE(s->mr->size),
+            s->offset_within_address_space + MR_SIZE(s->size),
              s->mr->name ? s->mr->name : "(noname)",
              i < ARRAY_SIZE(names) ? names[i] : "",
              s->mr == root ? " [ROOT]" : "",
Quoted 1 line
Quoted 1 line
Quoted 4 lines
Quoted 1 line

I assume this should get picked up soonish.

Hi Maintainers,

Can this patch be considered merged as it got reviewed-by and no objection for a long time. Thanks.

That dropped through the cracks, sorry.

Paolo, except if you are planning another PR before soft-freeze, I'm queuing this single patch via the mips-next PR I'm backing.

Thanks,

Phil.