All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/1] vhost: bugfix
@ 2018-04-16 16:47 Michael S. Tsirkin
  2018-04-16 16:47 ` [Qemu-devel] [PULL 1/1] vhost: do not verify ring mappings when IOMMU is enabled Michael S. Tsirkin
  2018-04-17 10:13 ` [Qemu-devel] [PULL 0/1] vhost: bugfix Peter Maydell
  0 siblings, 2 replies; 3+ messages in thread
From: Michael S. Tsirkin @ 2018-04-16 16:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell

The following changes since commit 38e83a71d02e026d4a6d0ab1ef9855c4924c2c68:

  Update version for v2.12.0-rc3 release (2018-04-11 19:03:24 +0100)

are available in the git repository at:

  git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream

for you to fetch changes up to aebbdbee559389a9f0d0e56670b9332534b6bb9b:

  vhost: do not verify ring mappings when IOMMU is enabled (2018-04-16 19:11:38 +0300)

----------------------------------------------------------------
vhost: bugfix

This fixes a regression in vhost.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

----------------------------------------------------------------
Jason Wang (1):
      vhost: do not verify ring mappings when IOMMU is enabled

 hw/virtio/vhost.c | 4 ++++
 1 file changed, 4 insertions(+)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Qemu-devel] [PULL 1/1] vhost: do not verify ring mappings when IOMMU is enabled
  2018-04-16 16:47 [Qemu-devel] [PULL 0/1] vhost: bugfix Michael S. Tsirkin
@ 2018-04-16 16:47 ` Michael S. Tsirkin
  2018-04-17 10:13 ` [Qemu-devel] [PULL 0/1] vhost: bugfix Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Michael S. Tsirkin @ 2018-04-16 16:47 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Jason Wang, Dr . David Alan Gilbert, Igor Mammedov

From: Jason Wang <jasowang@redhat.com>

When IOMMU is enabled, we store virtqueue metadata as iova (though it
may has _phys suffix) and access them through dma helpers. Any
translation failures could be reported by IOMMU.

In this case, trying to validate iova against gpa won't work and will
cause a false error reporting. So this patch bypasses the ring
verification if IOMMU is enabled which is similar to the behavior
before 0ca1fd2d6878 that calls vhost_memory_map() which is a nop when
IOMMU is enabled.

Fixes: 0ca1fd2d6878 ("vhost: Simplify ring verification checks")
Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/virtio/vhost.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index f51bf57..9d5850a 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -342,6 +342,10 @@ static int vhost_verify_ring_mappings(struct vhost_dev *dev,
         "used ring"
     };
 
+    if (vhost_dev_has_iommu(dev)) {
+        return 0;
+    }
+
     for (i = 0; i < dev->nvqs; ++i) {
         struct vhost_virtqueue *vq = dev->vqs + i;
 
-- 
MST

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PULL 0/1] vhost: bugfix
  2018-04-16 16:47 [Qemu-devel] [PULL 0/1] vhost: bugfix Michael S. Tsirkin
  2018-04-16 16:47 ` [Qemu-devel] [PULL 1/1] vhost: do not verify ring mappings when IOMMU is enabled Michael S. Tsirkin
@ 2018-04-17 10:13 ` Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2018-04-17 10:13 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: QEMU Developers

On 16 April 2018 at 17:47, Michael S. Tsirkin <mst@redhat.com> wrote:
> The following changes since commit 38e83a71d02e026d4a6d0ab1ef9855c4924c2c68:
>
>   Update version for v2.12.0-rc3 release (2018-04-11 19:03:24 +0100)
>
> are available in the git repository at:
>
>   git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
>
> for you to fetch changes up to aebbdbee559389a9f0d0e56670b9332534b6bb9b:
>
>   vhost: do not verify ring mappings when IOMMU is enabled (2018-04-16 19:11:38 +0300)
>
> ----------------------------------------------------------------
> vhost: bugfix
>
> This fixes a regression in vhost.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
>
> ----------------------------------------------------------------
> Jason Wang (1):
>       vhost: do not verify ring mappings when IOMMU is enabled
>
>  hw/virtio/vhost.c | 4 ++++
>  1 file changed, 4 insertions(+)

Applied, thanks.

-- PMM

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-04-17 10:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-16 16:47 [Qemu-devel] [PULL 0/1] vhost: bugfix Michael S. Tsirkin
2018-04-16 16:47 ` [Qemu-devel] [PULL 1/1] vhost: do not verify ring mappings when IOMMU is enabled Michael S. Tsirkin
2018-04-17 10:13 ` [Qemu-devel] [PULL 0/1] vhost: bugfix Peter Maydell

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.