qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 2/4] Use 64bit pointer for dirty log
Date: Sat, 25 Jul 2009 01:16:44 +0200	[thread overview]
Message-ID: <1248477406-50728-3-git-send-email-agraf@suse.de> (raw)
In-Reply-To: <1248477406-50728-2-git-send-email-agraf@suse.de>

Dirty logs currently get written with native "long" size. On little endian
it doesn't matter if we use uint64_t instead though, because we'd still end
up using the right bytes.

On big endian, this does become a bigger problem, so we need to ensure that
kernel and userspace talk the same language, which means getting rid of "long"
and using a defined size instead.

So I decided to use 64 bit types at all times. This doesn't break existing
targets but will in conjunction with a patch I'll send to the KVM ML make
dirty logs work with 32 bit userspace on 64 kernel with big endian.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 kvm-all.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kvm-all.c b/kvm-all.c
index 824bb4c..9d02ce3 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -357,7 +357,7 @@ int kvm_physical_sync_dirty_bitmap(target_phys_addr_t start_addr,
         for (phys_addr = mem->start_addr, addr = mem->phys_offset;
              phys_addr < mem->start_addr + mem->memory_size;
              phys_addr += TARGET_PAGE_SIZE, addr += TARGET_PAGE_SIZE) {
-            unsigned long *bitmap = (unsigned long *)d.dirty_bitmap;
+            uint64_t *bitmap = (uint64_t *)d.dirty_bitmap;
             unsigned nr = (phys_addr - mem->start_addr) >> TARGET_PAGE_BITS;
             unsigned word = nr / (sizeof(*bitmap) * 8);
             unsigned bit = nr % (sizeof(*bitmap) * 8);
-- 
1.6.0.2

  reply	other threads:[~2009-07-24 23:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-24 23:16 [Qemu-devel] [PATCH 0/4] PPC KVM bringup patches round 2 v2 Alexander Graf
2009-07-24 23:16 ` [Qemu-devel] [PATCH 1/4] Move mp_state to CPU_COMMON Alexander Graf
2009-07-24 23:16   ` Alexander Graf [this message]
2009-07-24 23:16     ` [Qemu-devel] [PATCH 3/4] PPC: Round VGA BIOS size to page boundary Alexander Graf
2009-07-24 23:16       ` [Qemu-devel] [PATCH 4/4] Give the kernel more room Alexander Graf
2009-07-25 17:15       ` [Qemu-devel] [PATCH 3/4] PPC: Round VGA BIOS size to page boundary Blue Swirl
2009-07-25 18:12         ` Alexander Graf
2009-07-27  7:22           ` Blue Swirl
2009-07-27 13:51   ` [Qemu-devel] [PATCH 1/4] Move mp_state to CPU_COMMON Anthony Liguori
2009-07-27 13:56     ` 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=1248477406-50728-3-git-send-email-agraf@suse.de \
    --to=agraf@suse.de \
    --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).