qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] kvm: Mark full address range dirty on live migration start
@ 2009-05-22 21:51 Jan Kiszka
  2009-05-23 13:47 ` Glauber Costa
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Kiszka @ 2009-05-22 21:51 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1239 bytes --]

As Avi correctly noted, last_ram_offset does not mark the last physical
RAM address the guest may see (due to non-continuous memory regions).
Ensure that we catch them all by marking the full possible address range
dirty.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

 targphys.h |    2 ++
 vl.c       |    2 +-
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/targphys.h b/targphys.h
index 81a9c37..99ab23c 100644
--- a/targphys.h
+++ b/targphys.h
@@ -12,9 +12,11 @@
 
 #if TARGET_PHYS_ADDR_BITS == 32
 typedef uint32_t target_phys_addr_t;
+#define TARGET_PHYS_ADDR_MAX UINT32_MAX
 #define TARGET_FMT_plx "%08x"
 #elif TARGET_PHYS_ADDR_BITS == 64
 typedef uint64_t target_phys_addr_t;
+#define TARGET_PHYS_ADDR_MAX UINT64_MAX
 #define TARGET_FMT_plx "%016" PRIx64
 #endif
 #endif
diff --git a/vl.c b/vl.c
index 2c1f0e0..090c83d 100644
--- a/vl.c
+++ b/vl.c
@@ -3232,7 +3232,7 @@ static int ram_save_live(QEMUFile *f, int stage, void *opaque)
 {
     ram_addr_t addr;
 
-    if (cpu_physical_sync_dirty_bitmap(0, last_ram_offset) != 0) {
+    if (cpu_physical_sync_dirty_bitmap(0, TARGET_PHYS_ADDR_MAX) != 0) {
         qemu_file_set_error(f);
         return 0;
     }


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] kvm: Mark full address range dirty on live migration start
  2009-05-23 13:47 ` Glauber Costa
@ 2009-05-23 13:47   ` Jan Kiszka
  2009-05-24 18:23   ` Paul Brook
  1 sibling, 0 replies; 4+ messages in thread
From: Jan Kiszka @ 2009-05-23 13:47 UTC (permalink / raw)
  To: Glauber Costa; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 879 bytes --]

Glauber Costa wrote:
> On Fri, May 22, 2009 at 11:51:45PM +0200, Jan Kiszka wrote:
>> As Avi correctly noted, last_ram_offset does not mark the last physical
>> RAM address the guest may see (due to non-continuous memory regions).
>> Ensure that we catch them all by marking the full possible address range
>> dirty.
>>
>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> Indeed, we already do something in that lines in qemu-kvm tree, 
> in a place that does not apply for  It makes a lot of sense. Just
> maybe you could just -1UL instead of defining a new constant, but I don't
> really care.

I intentionally made this verbose.

> 
> As soon as this is applied to master, I'll pick it for stable too.

Migration for KVM would be a new feature for stable. It requires a new
CPU save/restore format (V9). Do think that qualifies it for stable.

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] kvm: Mark full address range dirty on live migration start
  2009-05-22 21:51 [Qemu-devel] [PATCH] kvm: Mark full address range dirty on live migration start Jan Kiszka
@ 2009-05-23 13:47 ` Glauber Costa
  2009-05-23 13:47   ` Jan Kiszka
  2009-05-24 18:23   ` Paul Brook
  0 siblings, 2 replies; 4+ messages in thread
From: Glauber Costa @ 2009-05-23 13:47 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: qemu-devel

On Fri, May 22, 2009 at 11:51:45PM +0200, Jan Kiszka wrote:
> As Avi correctly noted, last_ram_offset does not mark the last physical
> RAM address the guest may see (due to non-continuous memory regions).
> Ensure that we catch them all by marking the full possible address range
> dirty.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Indeed, we already do something in that lines in qemu-kvm tree, 
in a place that does not apply for  It makes a lot of sense. Just
maybe you could just -1UL instead of defining a new constant, but I don't
really care.

As soon as this is applied to master, I'll pick it for stable too.

Thanks

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] kvm: Mark full address range dirty on live migration start
  2009-05-23 13:47 ` Glauber Costa
  2009-05-23 13:47   ` Jan Kiszka
@ 2009-05-24 18:23   ` Paul Brook
  1 sibling, 0 replies; 4+ messages in thread
From: Paul Brook @ 2009-05-24 18:23 UTC (permalink / raw)
  To: qemu-devel; +Cc: Glauber Costa, Jan Kiszka

On Saturday 23 May 2009, Glauber Costa wrote:
> On Fri, May 22, 2009 at 11:51:45PM +0200, Jan Kiszka wrote:
> > As Avi correctly noted, last_ram_offset does not mark the last physical
> > RAM address the guest may see (due to non-continuous memory regions).
> > Ensure that we catch them all by marking the full possible address range
> > dirty.
> >
> > Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>
> Indeed, we already do something in that lines in qemu-kvm tree,
> in a place that does not apply for  It makes a lot of sense. Just
> maybe you could just -1UL instead of defining a new constant, but I don't
> really care.

-1ul is wrong. -1 is correct.

Paul

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-05-24 18:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-22 21:51 [Qemu-devel] [PATCH] kvm: Mark full address range dirty on live migration start Jan Kiszka
2009-05-23 13:47 ` Glauber Costa
2009-05-23 13:47   ` Jan Kiszka
2009-05-24 18:23   ` Paul Brook

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).