From: Juan Quintela <quintela@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: peter.maydell@linaro.org, mst@redhat.com, qemu-devel@nongnu.org,
dgilbert@redhat.com, kraxel@redhat.com
Subject: Re: [Qemu-devel] [PATCH for-2.1] exec: fix migration with devices that use address_space_rw
Date: Tue, 22 Jul 2014 14:56:57 +0200 [thread overview]
Message-ID: <87a981y2jq.fsf@troll.troll> (raw)
In-Reply-To: <1405955204-10438-1-git-send-email-pbonzini@redhat.com> (Paolo Bonzini's message of "Mon, 21 Jul 2014 17:06:44 +0200")
Paolo Bonzini <pbonzini@redhat.com> wrote:
> Devices that use address_space_rw to write large areas to memory
> (as opposed to address_space_map/unmap) were broken with respect
> to migration since fe680d0 (exec: Limit translation limiting in
> address_space_translate to xen, 2014-05-07). Such devices include
> IDE CD-ROMs.
>
> The reason is that invalidate_and_set_dirty (called by address_space_rw
> but not address_space_map/unmap) was only setting the dirty bit for
> the first page in the translation.
>
> To fix this, introduce cpu_physical_memory_set_dirty_range_nocode that
> is the same as cpu_physical_memory_set_dirty_range except it does not
> muck with the DIRTY_MEMORY_CODE bitmap. This function can be used if
> the caller invalidates translations with tb_invalidate_phys_page_range.
>
> There is another difference between cpu_physical_memory_set_dirty_range
> and cpu_physical_memory_set_dirty_flag; the former includes a call
> to xen_modified_memory. This is handled separately in
> invalidate_and_set_dirty, and is not needed in other callers of
> cpu_physical_memory_set_dirty_range_nocode, so leave it alone.
>
> Just one nit: now that invalidate_and_set_dirty takes care of handling
> multiple pages, there is no need for address_space_unmap to wrap it
> in a loop. In fact that loop would now be O(n^2).
>
> Reported-by: Dave Gilbert <dgilbert@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Paolo, are you doing the pull for this, or should I do it?
Thanks, Juan.
prev parent reply other threads:[~2014-07-22 12:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-21 15:06 [Qemu-devel] [PATCH for-2.1] exec: fix migration with devices that use address_space_rw Paolo Bonzini
2014-07-21 21:29 ` Michael S. Tsirkin
2014-07-22 8:32 ` Gerd Hoffmann
2014-07-22 12:56 ` Juan Quintela [this message]
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=87a981y2jq.fsf@troll.troll \
--to=quintela@redhat.com \
--cc=dgilbert@redhat.com \
--cc=kraxel@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.