qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Jason Wang <jasowang@redhat.com>,
	jmforbes@linuxtx.org, qemu-devel@nongnu.org,
	Juan Quintela <quintela@redhat.com>
Subject: [Qemu-devel] Re: [PATCH master, stable] vhost: fix dirty page handling
Date: Wed, 16 Mar 2011 08:17:05 -0600	[thread overview]
Message-ID: <1300285026.3141.85.camel@x201> (raw)
In-Reply-To: <20110316100909.GA12895@redhat.com>

On Wed, 2011-03-16 at 12:09 +0200, Michael S. Tsirkin wrote:
> vhost was passing a physical address to cpu_physical_memory_set_dirty,
> which is wrong: we need to translate to ram address first.
> 
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> 
> Note: this lead to crashes during migration, so the patch
> is needed on the stable branch too.
> 
> ---
>  hw/vhost.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/hw/vhost.c b/hw/vhost.c
> index aaa34e4..97a1299 100644
> --- a/hw/vhost.c
> +++ b/hw/vhost.c
> @@ -49,8 +49,10 @@ static void vhost_dev_sync_region(struct vhost_dev *dev,
>          log = __sync_fetch_and_and(from, 0);
>          while ((bit = sizeof(log) > sizeof(int) ?
>                  ffsll(log) : ffs(log))) {
> +            ram_addr_t ram_addr;
>              bit -= 1;
> -            cpu_physical_memory_set_dirty(addr + bit * VHOST_LOG_PAGE);
> +            ram_addr = cpu_get_physical_page_desc(addr + bit * VHOST_LOG_PAGE);
> +            cpu_physical_memory_set_dirty(ram_addr);
>              log &= ~(0x1ull << bit);
>          }
>          addr += VHOST_LOG_CHUNK;

Reviewed-by: Alex Williamson <alex.williamson@redhat.com>

      parent reply	other threads:[~2011-03-16 14:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-16 10:09 [Qemu-devel] [PATCH master,stable] vhost: fix dirty page handling Michael S. Tsirkin
2011-03-16 12:53 ` [Qemu-devel] Re: [PATCH master, stable] " Juan Quintela
2011-03-16 14:17 ` Alex Williamson [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=1300285026.3141.85.camel@x201 \
    --to=alex.williamson@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=jmforbes@linuxtx.org \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /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).