qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Zhenzhong Duan <zhenzhong.duan@intel.com>, qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, peterx@redhat.com, f4bug@amsat.org
Subject: Re: [PATCH] memory: Fix wrong end address dump
Date: Fri, 22 Jul 2022 08:43:38 +0200	[thread overview]
Message-ID: <67dedbad-9d24-2c8d-f8a7-98e5387b89ae@redhat.com> (raw)
In-Reply-To: <20220622095912.3430583-1-zhenzhong.duan@intel.com>

On 22.06.22 11:59, Zhenzhong Duan wrote:
> 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")
> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
> ---
>  softmmu/physmem.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/softmmu/physmem.c b/softmmu/physmem.c
> index 214cb04c8fc3..cbabd10ac0bf 100644
> --- a/softmmu/physmem.c
> +++ b/softmmu/physmem.c
> @@ -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]" : "",

Reviewed-by: David Hildenbrand <david@redhat.com>

I assume this should get picked up soonish.

-- 
Thanks,

David / dhildenb



  parent reply	other threads:[~2022-07-22  7:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-22  9:59 [PATCH] memory: Fix wrong end address dump Zhenzhong Duan
2022-06-22 21:05 ` Peter Xu
2022-07-22  3:31   ` Duan, Zhenzhong
2022-07-22  6:43 ` David Hildenbrand [this message]
2022-10-28  2:19   ` Duan, Zhenzhong
2022-10-28  9:29     ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=67dedbad-9d24-2c8d-f8a7-98e5387b89ae@redhat.com \
    --to=david@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=zhenzhong.duan@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).