From: Blue Swirl <blauwirbel@gmail.com>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: Marcelo Tossatti <mtossatti@redhat.com>,
qemu-devel@nongnu.org, anthony@codemonkey.ws,
Avi Kivity <avi@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 6/6] kvm: Fix dirty tracking with large kernel page size
Date: Sun, 26 Feb 2012 21:41:17 +0000 [thread overview]
Message-ID: <CAAu8pHssMJBD16ZrbBZ=EOArLwp7d26VJw3236qCDOfv0mTsNA@mail.gmail.com> (raw)
In-Reply-To: <1330043012-30556-7-git-send-email-david@gibson.dropbear.id.au>
On Fri, Feb 24, 2012 at 00:23, David Gibson <david@gibson.dropbear.id.au> wrote:
> From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>
> If the kernel page size is larger than TARGET_PAGE_SIZE, which
> happens for example on ppc64 with kernels compiled for 64K pages,
> the dirty tracking doesn't work.
I think a better solution would be to push this to memory API and
underlying exec.c dirty tracking so that they use the same page size
as kernel (only in this KVM case, in general dirty tracking should
match TARGET_PAGE_SIZE granularity).
> Cc: Avi Kivity <avi@redhat.com>
> Cc: Marcelo Tossatti <mtossatti@redhat.com>
>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
> ---
> kvm-all.c | 7 ++++---
> 1 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/kvm-all.c b/kvm-all.c
> index 5e188bf..3f8cfd9 100644
> --- a/kvm-all.c
> +++ b/kvm-all.c
> @@ -348,10 +348,11 @@ static int kvm_set_migration_log(int enable)
> static int kvm_get_dirty_pages_log_range(MemoryRegionSection *section,
> unsigned long *bitmap)
> {
> - unsigned int i, j;
> + unsigned int i, j;
> unsigned long page_number, c;
> target_phys_addr_t addr, addr1;
> unsigned int len = ((section->size / TARGET_PAGE_SIZE) + HOST_LONG_BITS - 1) / HOST_LONG_BITS;
> + unsigned long hpratio = getpagesize() / TARGET_PAGE_SIZE;
>
> /*
> * bitmap-traveling is faster than memory-traveling (for addr...)
> @@ -363,10 +364,10 @@ static int kvm_get_dirty_pages_log_range(MemoryRegionSection *section,
> do {
> j = ffsl(c) - 1;
> c &= ~(1ul << j);
> - page_number = i * HOST_LONG_BITS + j;
> + page_number = (i * HOST_LONG_BITS + j) * hpratio;
> addr1 = page_number * TARGET_PAGE_SIZE;
> addr = section->offset_within_region + addr1;
> - memory_region_set_dirty(section->mr, addr, TARGET_PAGE_SIZE);
> + memory_region_set_dirty(section->mr, addr, TARGET_PAGE_SIZE * hpratio);
> } while (c != 0);
> }
> }
> --
> 1.7.9
>
>
next prev parent reply other threads:[~2012-02-26 21:41 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-24 0:23 [Qemu-devel] [0/6] Assorted bugfixes David Gibson
2012-02-24 0:23 ` [Qemu-devel] [PATCH 1/6] kvm: Comparison with ioctl number macros needs to be unsigned David Gibson
2012-02-24 0:23 ` [Qemu-devel] [PATCH 2/6] slirp: Fix assertion failure on rejected DHCP requests David Gibson
2012-02-27 13:58 ` Jan Kiszka
2012-02-28 1:07 ` David Gibson
2012-02-24 0:23 ` [Qemu-devel] [PATCH 3/6] USB OHCI bug fixes David Gibson
2012-02-27 14:13 ` Gerd Hoffmann
2012-02-28 3:09 ` David Gibson
2012-02-28 3:37 ` David Gibson
2012-02-24 0:23 ` [Qemu-devel] [PATCH 4/6] Endian fixes for virtfs David Gibson
2012-02-24 8:29 ` Aneesh Kumar K.V
2012-02-24 0:23 ` [Qemu-devel] [PATCH 5/6] Endian fix an assertion in usb-msd David Gibson
2012-02-24 0:23 ` [Qemu-devel] [PATCH 6/6] kvm: Fix dirty tracking with large kernel page size David Gibson
2012-02-24 1:03 ` Benjamin Herrenschmidt
2012-02-26 21:41 ` Blue Swirl [this message]
2012-02-27 0:16 ` David Gibson
2012-02-27 0:25 ` Benjamin Herrenschmidt
2012-02-27 0:36 ` Alexander Graf
2012-03-03 15:29 ` Blue Swirl
2012-02-28 12:32 ` Avi Kivity
2012-02-28 21:48 ` Benjamin Herrenschmidt
2012-03-04 10:49 ` Avi Kivity
2012-03-04 11:53 ` Benjamin Herrenschmidt
2012-03-04 12:18 ` Avi Kivity
2012-03-04 16:46 ` Andreas Färber
2012-03-04 18:46 ` Alexander Graf
2012-03-04 20:21 ` Andreas Färber
2012-03-04 20:25 ` Alexander Graf
2012-03-04 20:31 ` Andreas Färber
2012-03-04 20:59 ` Alexander Graf
2012-03-04 21:19 ` Benjamin Herrenschmidt
2012-03-04 21:45 ` Alexander Graf
2012-03-04 21:21 ` Andreas Färber
2012-03-04 21:17 ` Benjamin Herrenschmidt
2012-02-28 23:32 ` Alexander Graf
2012-02-29 0:22 ` David Gibson
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='CAAu8pHssMJBD16ZrbBZ=EOArLwp7d26VJw3236qCDOfv0mTsNA@mail.gmail.com' \
--to=blauwirbel@gmail.com \
--cc=anthony@codemonkey.ws \
--cc=avi@redhat.com \
--cc=david@gibson.dropbear.id.au \
--cc=mtossatti@redhat.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).