From: Jason Wang <jasowang@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Jason Wang <jasowang@redhat.com>,
virtualization@lists.osdl.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH] vhost: correctly set bits of dirty pages
Date: Mon, 29 Nov 2010 21:50:06 +0800 [thread overview]
Message-ID: <19699.44942.204823.848838@gargle.gargle.HOWL> (raw)
In-Reply-To: <20101129081840.GB25496@redhat.com>
Michael S. Tsirkin writes:
> On Mon, Nov 29, 2010 at 01:48:20PM +0800, Jason Wang wrote:
> > When counting pages we should increase it by 1 instead of VHOST_PAGE_SIZE,
> > and also make log_write() can correctly process the request across
> > pages with write_address not start at page boundary.
> >
> > Signed-off-by: Jason Wang <jasowang@redhat.com>
>
> dd
> Thanks, good catch!
> But let's to it in small steps: first, a small patch to fix the bug:
> I think this is equivalent, right?
>
Yes.
> Subject: vhost: correctly set bits of dirty pages
>
> When counting pages we should increase address by 1 instead of
> VHOST_PAGE_SIZE, and also make log_write() can correctly process the
> request across pages with write_address not starting at page boundary.
>
> Reported-by: Jason Wang <jasowang@redhat.com>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
>
I'm fine with this, thanks!
> ---
>
> diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
> index 568eb70..d0a3552 100644
> --- a/drivers/vhost/vhost.c
> +++ b/drivers/vhost/vhost.c
> @@ -887,6 +887,7 @@ static int log_write(void __user *log_base,
> int r;
> if (!write_length)
> return 0;
> + write_length += write_address % VHOST_PAGE_SIZE;
> write_address /= VHOST_PAGE_SIZE;
> for (;;) {
> u64 base = (u64)(unsigned long)log_base;
> @@ -900,7 +901,7 @@ static int log_write(void __user *log_base,
> if (write_length <= VHOST_PAGE_SIZE)
> break;
> write_length -= VHOST_PAGE_SIZE;
> - write_address += VHOST_PAGE_SIZE;
> + write_address += 1;
> }
> return r;
> }
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2010-11-29 13:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-29 5:48 [PATCH] vhost: correctly set bits of dirty pages Jason Wang
2010-11-29 8:18 ` Michael S. Tsirkin
2010-11-29 8:25 ` Michael S. Tsirkin
2010-11-29 13:50 ` Jason Wang [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=19699.44942.204823.848838@gargle.gargle.HOWL \
--to=jasowang@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=virtualization@lists.osdl.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