Skip to contentSkip to conversation

don't use a 32-bit bit type as offset argument.

PATCH Applied Glauber Costa 5 participants 5 messages May 13, 2009 – May 14, 2009 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 don't use a 32-bit bit type as offset argument.

In the call path of kvm_get_dirty_pages_log_range(), its caller kvm_get_dirty_bitmap_cb() passes the target_phys_addr_t both as start_addr and the offset. So, using int will make dirty tracking over 4G fail completely.

Of course we should be using qemu types in here, so please don't get me started on this. The whole file is wrong already ;)

---
 qemu-kvm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
qemu-kvm.c +1 -1
index f55cee8..27c37b5 100644
@@ -1201,7 +1201,7 @@ int kvm_physical_memory_set_dirty_tracking(int enable)
 /* get kvm's dirty pages bitmap and update qemu's */
 static int kvm_get_dirty_pages_log_range(unsigned long start_addr,
                                          unsigned char *bitmap,
-                                         unsigned int offset,
+                                         unsigned long offset,
                                          unsigned long mem_size)
 {
     unsigned int i, j, n=0;
Signature · 1 line
1.5.6.6
#1 lore raw
Quoted 5 lines · Glauber Costa

In the call path of kvm_get_dirty_pages_log_range(), its caller kvm_get_dirty_bitmap_cb() passes the target_phys_addr_t both as start_addr and the offset. So, using int will make dirty tracking over 4G fail completely.

Does this patch fix someting like 32-bit migration with >4G ? Seems like it might.

Quoted 30 lines

Of course we should be using qemu types in here, so please don't get me started on this. The whole file is wrong already ;)

---
 qemu-kvm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
qemu-kvm.c +1 -1
index f55cee8..27c37b5 100644
@@ -1201,7 +1201,7 @@ int kvm_physical_memory_set_dirty_tracking(int enable)
 /* get kvm's dirty pages bitmap and update qemu's */
 static int kvm_get_dirty_pages_log_range(unsigned long start_addr,
                                          unsigned char *bitmap,
-                                         unsigned int offset,
+                                         unsigned long offset,
                                          unsigned long mem_size)
 {
     unsigned int i, j, n=0;
Signature · 6 lines
1.5.6.6

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Signature · 4 lines
Ryan Harper
Software Engineer; Linux Technology Center
IBM Corp., Austin, Tx
[email protected]
#2 lore raw
Quoted 9 lines · Ryan Harper
Quoted 5 lines · Glauber Costa

In the call path of kvm_get_dirty_pages_log_range(), its caller kvm_get_dirty_bitmap_cb() passes the target_phys_addr_t both as start_addr and the offset. So, using int will make dirty tracking over 4G fail completely.

Does this patch fix someting like 32-bit migration with >4G ?  Seems like it might.

it fixes general > 4G migration. I tested a 64-bit guest on a 64-bit host, and it does not work previous to this patch

Signature · 5 lines
Glauber  Costa.
"Free as in Freedom"
http://glommer.net

"The less confident you are, the more serious you have to act."
#3 lore raw
In reply to Glauber Costa
Quoted 10 lines · Glauber Costa

In the call path of kvm_get_dirty_pages_log_range(), its caller kvm_get_dirty_bitmap_cb() passes the target_phys_addr_t both as start_addr and the offset. So, using int will make dirty tracking over 4G fail completely.

Of course we should be using qemu types in here, so please don't get me started on this. The whole file is wrong already ;)

:-)

Quoted 2 lines

Good candidate for stable too.

Regards,

Anthony Liguori

Applied
#4 lore raw
In reply to Glauber Costa
Quoted 7 lines · Glauber Costa

In the call path of kvm_get_dirty_pages_log_range(), its caller kvm_get_dirty_bitmap_cb() passes the target_phys_addr_t both as start_addr and the offset. So, using int will make dirty tracking over 4G fail completely.

Applied, thanks.

Quoted 4 lines

Of course we should be using qemu types in here, so please don't get me started on this. The whole file is wrong already ;)

These callbacks are called from libkvm, which doesn't know much about qemu.

Signature · 1 line
error compiling committee.c: too many arguments to function