All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Peter Xu" <peterx@redhat.com>,
	"Alexander Bulekov" <alxndr@bu.edu>
Subject: [PATCH 1/3] memory: Better name 'offset' argument in mtree_print_mr()
Date: Sat,  6 Mar 2021 00:54:12 +0100	[thread overview]
Message-ID: <20210305235414.2358144-2-f4bug@amsat.org> (raw)
In-Reply-To: <20210305235414.2358144-1-f4bug@amsat.org>

The 'base' argument of mtree_print_mr() actually represents
an offset, not a base address. Rename it as such.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 softmmu/memory.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/softmmu/memory.c b/softmmu/memory.c
index 874a8fccdee..e4d93b2fd6f 100644
--- a/softmmu/memory.c
+++ b/softmmu/memory.c
@@ -2925,7 +2925,7 @@ static void mtree_print_mr_owner(const MemoryRegion *mr)
 }
 
 static void mtree_print_mr(const MemoryRegion *mr, unsigned int level,
-                           hwaddr base,
+                           hwaddr offset,
                            MemoryRegionListHead *alias_print_queue,
                            bool owner, bool display_disabled)
 {
@@ -2939,7 +2939,7 @@ static void mtree_print_mr(const MemoryRegion *mr, unsigned int level,
         return;
     }
 
-    cur_start = base + mr->addr;
+    cur_start = offset + mr->addr;
     cur_end = cur_start + MR_SIZE(mr->size);
 
     /*
@@ -2947,7 +2947,7 @@ static void mtree_print_mr(const MemoryRegion *mr, unsigned int level,
      * happen normally. When it happens, we dump something to warn the
      * user who is observing this.
      */
-    if (cur_start < base || cur_end < cur_start) {
+    if (cur_start < offset || cur_end < cur_start) {
         qemu_printf("[DETECTED OVERFLOW!] ");
     }
 
-- 
2.26.2



  reply	other threads:[~2021-03-05 23:56 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-05 23:54 [PATCH 0/3] memory: Display AddressSpace zero-based in 'info mtree' Philippe Mathieu-Daudé
2021-03-05 23:54 ` Philippe Mathieu-Daudé [this message]
2021-03-05 23:54 ` [PATCH 2/3] memory: Provide 'base address' argument to mtree_print_mr() Philippe Mathieu-Daudé
2021-03-08 23:40   ` Peter Xu
2021-03-09  9:39     ` Philippe Mathieu-Daudé
2021-03-09 21:54       ` Philippe Mathieu-Daudé
2021-03-10 17:06         ` Peter Xu
2021-03-10 19:09           ` Philippe Mathieu-Daudé
2021-03-10 19:12             ` [PATCH 1/2] hw/mips/jazz: Use generic I/O bus via get_system_io() Philippe Mathieu-Daudé
2021-03-10 19:12               ` [PATCH 2/2] NOTFORMERGE memory: Ensure AddressSpace physical base address is zero Philippe Mathieu-Daudé
2021-03-10 19:49               ` [PATCH 1/2] hw/mips/jazz: Use generic I/O bus via get_system_io() Peter Xu
2021-03-10 20:11                 ` Philippe Mathieu-Daudé
2021-03-10 20:29                   ` Peter Xu
2021-03-11 12:18                     ` Philippe Mathieu-Daudé
2021-03-11 16:21                       ` Philippe Mathieu-Daudé
2021-03-11 17:27                         ` Peter Xu
2021-03-11 17:59                           ` Philippe Mathieu-Daudé
2021-03-12  9:08                           ` Cédric Le Goater
2021-03-11 17:27                         ` Peter Xu
2021-03-11 17:41                         ` Philippe Mathieu-Daudé
2021-03-11  0:48               ` Jiaxun Yang
2021-03-10 19:31             ` [PATCH 2/3] memory: Provide 'base address' argument to mtree_print_mr() Peter Xu
2021-03-10 22:00         ` Mark Cave-Ayland
2021-03-05 23:54 ` [PATCH 3/3] memory: Make memory_region_to_absolute_addr() take a const MemoryRegion Philippe Mathieu-Daudé
2021-03-11 12:19   ` 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=20210305235414.2358144-2-f4bug@amsat.org \
    --to=f4bug@amsat.org \
    --cc=alxndr@bu.edu \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.