From: "Michael S. Tsirkin" <mst@redhat.com>
To: Jason Wang <jasowang@redhat.com>
Cc: kvm@vger.kernel.org, netdev@vger.kernel.org,
qemu-devel@nongnu.org, linux-kernel@vger.kernel.org,
David Gibson <david@gibson.dropbear.id.au>,
virtualization@lists.linux-foundation.org,
Laurent Vivier <laurent@vivier.eu>
Subject: Re: [PATCH v3 2/3] vhost: Use vhost_get_used_size() in vhost_vring_set_addr()
Date: Sun, 11 Oct 2020 02:46:49 -0400 [thread overview]
Message-ID: <20201011024636-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <5fc896c6-e60d-db0b-f7b0-5b6806d70b8e@redhat.com>
On Sat, Oct 10, 2020 at 10:32:13AM +0800, Jason Wang wrote:
>
> On 2020/10/3 下午6:02, Greg Kurz wrote:
> > The open-coded computation of the used size doesn't take the event
> > into account when the VIRTIO_RING_F_EVENT_IDX feature is present.
> > Fix that by using vhost_get_used_size().
> >
> > Signed-off-by: Greg Kurz <groug@kaod.org>
> > ---
> > drivers/vhost/vhost.c | 3 +--
> > 1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
> > index c3b49975dc28..9d2c225fb518 100644
> > --- a/drivers/vhost/vhost.c
> > +++ b/drivers/vhost/vhost.c
> > @@ -1519,8 +1519,7 @@ static long vhost_vring_set_addr(struct vhost_dev *d,
> > /* Also validate log access for used ring if enabled. */
> > if ((a.flags & (0x1 << VHOST_VRING_F_LOG)) &&
> > !log_access_ok(vq->log_base, a.log_guest_addr,
> > - sizeof *vq->used +
> > - vq->num * sizeof *vq->used->ring))
> > + vhost_get_used_size(vq, vq->num)))
> > return -EINVAL;
> > }
> >
> >
>
> Acked-by: Jason Wang <jasowang@redhat.com>
Linus already merged this, I can't add your ack, sorry!
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
WARNING: multiple messages have this Message-ID (diff)
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Jason Wang <jasowang@redhat.com>
Cc: Greg Kurz <groug@kaod.org>,
kvm@vger.kernel.org, virtualization@lists.linux-foundation.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
qemu-devel@nongnu.org, Laurent Vivier <laurent@vivier.eu>,
David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [PATCH v3 2/3] vhost: Use vhost_get_used_size() in vhost_vring_set_addr()
Date: Sun, 11 Oct 2020 02:46:49 -0400 [thread overview]
Message-ID: <20201011024636-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <5fc896c6-e60d-db0b-f7b0-5b6806d70b8e@redhat.com>
On Sat, Oct 10, 2020 at 10:32:13AM +0800, Jason Wang wrote:
>
> On 2020/10/3 下午6:02, Greg Kurz wrote:
> > The open-coded computation of the used size doesn't take the event
> > into account when the VIRTIO_RING_F_EVENT_IDX feature is present.
> > Fix that by using vhost_get_used_size().
> >
> > Signed-off-by: Greg Kurz <groug@kaod.org>
> > ---
> > drivers/vhost/vhost.c | 3 +--
> > 1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
> > index c3b49975dc28..9d2c225fb518 100644
> > --- a/drivers/vhost/vhost.c
> > +++ b/drivers/vhost/vhost.c
> > @@ -1519,8 +1519,7 @@ static long vhost_vring_set_addr(struct vhost_dev *d,
> > /* Also validate log access for used ring if enabled. */
> > if ((a.flags & (0x1 << VHOST_VRING_F_LOG)) &&
> > !log_access_ok(vq->log_base, a.log_guest_addr,
> > - sizeof *vq->used +
> > - vq->num * sizeof *vq->used->ring))
> > + vhost_get_used_size(vq, vq->num)))
> > return -EINVAL;
> > }
> >
> >
>
> Acked-by: Jason Wang <jasowang@redhat.com>
Linus already merged this, I can't add your ack, sorry!
WARNING: multiple messages have this Message-ID (diff)
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Jason Wang <jasowang@redhat.com>
Cc: kvm@vger.kernel.org, netdev@vger.kernel.org,
qemu-devel@nongnu.org, linux-kernel@vger.kernel.org,
Greg Kurz <groug@kaod.org>,
David Gibson <david@gibson.dropbear.id.au>,
virtualization@lists.linux-foundation.org,
Laurent Vivier <laurent@vivier.eu>
Subject: Re: [PATCH v3 2/3] vhost: Use vhost_get_used_size() in vhost_vring_set_addr()
Date: Sun, 11 Oct 2020 02:46:49 -0400 [thread overview]
Message-ID: <20201011024636-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <5fc896c6-e60d-db0b-f7b0-5b6806d70b8e@redhat.com>
On Sat, Oct 10, 2020 at 10:32:13AM +0800, Jason Wang wrote:
>
> On 2020/10/3 下午6:02, Greg Kurz wrote:
> > The open-coded computation of the used size doesn't take the event
> > into account when the VIRTIO_RING_F_EVENT_IDX feature is present.
> > Fix that by using vhost_get_used_size().
> >
> > Signed-off-by: Greg Kurz <groug@kaod.org>
> > ---
> > drivers/vhost/vhost.c | 3 +--
> > 1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
> > index c3b49975dc28..9d2c225fb518 100644
> > --- a/drivers/vhost/vhost.c
> > +++ b/drivers/vhost/vhost.c
> > @@ -1519,8 +1519,7 @@ static long vhost_vring_set_addr(struct vhost_dev *d,
> > /* Also validate log access for used ring if enabled. */
> > if ((a.flags & (0x1 << VHOST_VRING_F_LOG)) &&
> > !log_access_ok(vq->log_base, a.log_guest_addr,
> > - sizeof *vq->used +
> > - vq->num * sizeof *vq->used->ring))
> > + vhost_get_used_size(vq, vq->num)))
> > return -EINVAL;
> > }
> >
> >
>
> Acked-by: Jason Wang <jasowang@redhat.com>
Linus already merged this, I can't add your ack, sorry!
next prev parent reply other threads:[~2020-10-11 6:47 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-03 10:01 [PATCH v3 0/3] vhost: Skip access checks on GIOVAs Greg Kurz
2020-10-03 10:01 ` Greg Kurz
2020-10-03 10:01 ` [PATCH v3 1/3] vhost: Don't call access_ok() when using IOTLB Greg Kurz
2020-10-03 10:01 ` Greg Kurz
2020-10-03 10:02 ` [PATCH v3 2/3] vhost: Use vhost_get_used_size() in vhost_vring_set_addr() Greg Kurz
2020-10-03 10:02 ` Greg Kurz
2020-10-10 2:32 ` Jason Wang
2020-10-10 2:32 ` Jason Wang
2020-10-10 2:32 ` Jason Wang
2020-10-11 6:46 ` Michael S. Tsirkin [this message]
2020-10-11 6:46 ` Michael S. Tsirkin
2020-10-11 6:46 ` Michael S. Tsirkin
2020-10-03 10:02 ` [PATCH v3 3/3] vhost: Don't call log_access_ok() when using IOTLB Greg Kurz
2020-10-03 10:02 ` Greg Kurz
2020-10-10 3:00 ` Jason Wang
2020-10-10 3:00 ` Jason Wang
2020-10-10 3:00 ` Jason Wang
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=20201011024636-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=david@gibson.dropbear.id.au \
--cc=jasowang@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=laurent@vivier.eu \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=qemu-devel@nongnu.org \
--cc=virtualization@lists.linux-foundation.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.