qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: qemu-devel@nongnu.org
Cc: Avi Kivity <avi@redhat.com>, Alexander Graf <agraf@suse.de>,
	David Gibson <dwg@au1.ibm.com>
Subject: [Qemu-devel] [PATCH] Fix KVM dirty logging with 32-bit qemu & >32-bit physical addresses
Date: Fri, 23 Dec 2011 11:15:06 +1100	[thread overview]
Message-ID: <1324599306.6632.13.camel@pasglop> (raw)

We were using the wrong types in kvm_get_dirty_pages_log_range().

This would break dirty logging if the region to log resides at a
physical address above 32-bit, which can happen with 64-bit guest
but also with 32-bit guests that support >32-bit physical addresses
such as ppc BookE.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 kvm-all.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/kvm-all.c b/kvm-all.c
index 4c466d6..91b0694 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -328,13 +328,14 @@ static int kvm_set_migration_log(int enable)
 }
 
 /* get kvm's dirty pages bitmap and update qemu's */
-static int kvm_get_dirty_pages_log_range(unsigned long start_addr,
+static int kvm_get_dirty_pages_log_range(target_phys_addr_t start_addr,
                                          unsigned long *bitmap,
-                                         unsigned long offset,
+                                         target_phys_addr_t offset,
                                          unsigned long mem_size)
 {
     unsigned int i, j;
-    unsigned long page_number, addr, addr1, c;
+    unsigned long page_number, c;
+    target_phys_addr_t addr, addr1;
     ram_addr_t ram_addr;
     unsigned int len = ((mem_size / TARGET_PAGE_SIZE) + HOST_LONG_BITS - 1) /
         HOST_LONG_BITS;

             reply	other threads:[~2011-12-23  0:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-23  0:15 Benjamin Herrenschmidt [this message]
2011-12-23 13:53 ` [Qemu-devel] [PATCH] Fix KVM dirty logging with 32-bit qemu & >32-bit physical addresses Alexander Graf

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=1324599306.6632.13.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=agraf@suse.de \
    --cc=avi@redhat.com \
    --cc=dwg@au1.ibm.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).