* [Qemu-devel] new memory api: offsets? @ 2011-08-31 22:54 Michael Walle 2011-09-01 5:54 ` Avi Kivity 0 siblings, 1 reply; 6+ messages in thread From: Michael Walle @ 2011-08-31 22:54 UTC (permalink / raw) To: Avi Kivity, qemu-devel 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? btw. you may include the memory region name in the warning. -- Michael ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] new memory api: offsets? 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 0 siblings, 1 reply; 6+ messages in thread From: Avi Kivity @ 2011-09-01 5:54 UTC (permalink / raw) To: Michael Walle; +Cc: qemu-devel 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()? The subregion collision warning is unrelated? > btw. you may include the memory region name in the warning. > sure, patches welcome. -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] new memory api: offsets? 2011-09-01 5:54 ` Avi Kivity @ 2011-09-01 10:00 ` Michael Walle 2011-09-06 7:50 ` Avi Kivity 0 siblings, 1 reply; 6+ messages in thread From: Michael Walle @ 2011-09-01 10:00 UTC (permalink / raw) To: Avi Kivity; +Cc: qemu-devel 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 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] new memory api: offsets? 2011-09-01 10:00 ` Michael Walle @ 2011-09-06 7:50 ` Avi Kivity 2011-09-15 21:16 ` [Qemu-devel] [PATCH] memory: fix subregion collision warning Michael Walle 0 siblings, 1 reply; 6+ messages in thread From: Avi Kivity @ 2011-09-06 7:50 UTC (permalink / raw) To: Michael Walle; +Cc: qemu-devel On 09/01/2011 01:00 PM, Michael Walle wrote: > 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? Ah, of course. > > @@ -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; > } Right. Please post with a changelog and signoff. > > > > 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 :) > Yes, with a signoff. -- error compiling committee.c: too many arguments to function ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Qemu-devel] [PATCH] memory: fix subregion collision warning 2011-09-06 7:50 ` Avi Kivity @ 2011-09-15 21:16 ` Michael Walle 2011-09-18 11:55 ` Avi Kivity 0 siblings, 1 reply; 6+ messages in thread From: Michael Walle @ 2011-09-15 21:16 UTC (permalink / raw) To: qemu-devel; +Cc: Michael Walle, Avi Kivity Instead of the offset property use the proper addr property to calculate the offsets. Additionally, be a little more verbose on the warning and print the subregion name. Signed-off-by: Michael Walle <michael@walle.cc> --- memory.c | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-) diff --git a/memory.c b/memory.c index 101b67c..ba74435 100644 --- a/memory.c +++ b/memory.c @@ -1190,16 +1190,19 @@ 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; } #if 0 - 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); #endif } QTAILQ_FOREACH(other, &mr->subregions, subregions_link) { -- 1.7.2.5 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] memory: fix subregion collision warning 2011-09-15 21:16 ` [Qemu-devel] [PATCH] memory: fix subregion collision warning Michael Walle @ 2011-09-18 11:55 ` Avi Kivity 0 siblings, 0 replies; 6+ messages in thread From: Avi Kivity @ 2011-09-18 11:55 UTC (permalink / raw) To: Michael Walle; +Cc: qemu-devel On 09/16/2011 12:16 AM, Michael Walle wrote: > Instead of the offset property use the proper addr property to calculate > the offsets. > > Additionally, be a little more verbose on the warning and print the > subregion name. > > Thanks, applied to memory/core. -- error compiling committee.c: too many arguments to function ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-09-18 11:55 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 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 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
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).