qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Michael Walle <michael@walle.cc>
To: Avi Kivity <avi@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] new memory api: offsets?
Date: Thu, 1 Sep 2011 12:00:11 +0200	[thread overview]
Message-ID: <201109011200.12035.michael@walle.cc> (raw)
In-Reply-To: <4E5F1E14.3060606@redhat.com>

Am Donnerstag 01 September 2011, 07:54:28 schrieb Avi Kivity:
> On 09/01/2011 01:54 AM, Michael Walle wrote:
> > Hi Avi,
> > 
> > while debugging, i noticed, that mr->offset is never set, expect in the
> > initializer. (The subregion collision warning is printed although the
> > regions are not overlapping.) Is this intended?
> 
> Did you miss memory_region_set_offset()?
I saw that function but it's never called. Now i noticed that this is a 
deprecated public function.

> The subregion collision warning is unrelated?
you are walking along the subregions and use that offset property to detect 
collisions. Shouldn't you use the addr property instead?

@@ -1190,16 +1190,18 @@ static void 
memory_region_add_subregion_common(MemoryRegion *mr,
         if (subregion->may_overlap || other->may_overlap) {
             continue;
         }
-        if (offset >= other->offset + other->size
-            || offset + subregion->size <= other->offset) {
+        if (offset >= other->addr + other->size
+            || offset + subregion->size <= other->addr) {
             continue;
         }

> > btw. you may include the memory region name in the warning.
> 
> sure, patches welcome.

-        printf("warning: subregion collision %llx/%llx vs %llx/%llx\n",
+        printf("warning: subregion collision %llx/%llx (%s) "
+               "vs %llx/%llx (%s)\n",
                (unsigned long long)offset,
                (unsigned long long)subregion->size,
-               (unsigned long long)other->offset,
-               (unsigned long long)other->size);
+               subregion->name,
+               (unsigned long long)other->addr,
+               (unsigned long long)other->size,
+               other->name);

let me know if i should post a git patch instead :)

-- 
Michael

  reply	other threads:[~2011-09-01 10:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-31 22:54 [Qemu-devel] new memory api: offsets? Michael Walle
2011-09-01  5:54 ` Avi Kivity
2011-09-01 10:00   ` Michael Walle [this message]
2011-09-06  7:50     ` Avi Kivity
2011-09-15 21:16       ` [Qemu-devel] [PATCH] memory: fix subregion collision warning Michael Walle
2011-09-18 11:55         ` Avi Kivity

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=201109011200.12035.michael@walle.cc \
    --to=michael@walle.cc \
    --cc=avi@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 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).