All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] IOMMU and ATS not supported by vhost-user filesystem.
@ 2021-01-26 18:23 lagarcia
  2021-01-26 19:45 ` Dr. David Alan Gilbert
  2021-01-27 11:19 ` Stefan Hajnoczi
  0 siblings, 2 replies; 16+ messages in thread
From: lagarcia @ 2021-01-26 18:23 UTC (permalink / raw)
  To: qemu-devel; +Cc: Leonardo Garcia, dgilbert, stefanha

From: Leonardo Garcia <lagarcia@br.ibm.com>

Currently, as IOMMU and ATS are not supported, if a user mistakenly set
any of them and tries to mount the vhost-user filesystem inside the
guest, whenever the user tries to access the mount point, the system
will hang forever.

Signed-off-by: Leonardo Garcia <lagarcia@br.ibm.com>
---
 hw/virtio/vhost-user-fs-pci.c | 7 +++++++
 hw/virtio/vhost-user-fs.c     | 5 +++++
 2 files changed, 12 insertions(+)

diff --git a/hw/virtio/vhost-user-fs-pci.c b/hw/virtio/vhost-user-fs-pci.c
index 2ed8492b3f..564d1fd108 100644
--- a/hw/virtio/vhost-user-fs-pci.c
+++ b/hw/virtio/vhost-user-fs-pci.c
@@ -11,6 +11,8 @@
  * top-level directory.
  */
 
+#include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu/osdep.h"
 #include "hw/qdev-properties.h"
 #include "hw/virtio/vhost-user-fs.h"
@@ -45,6 +47,11 @@ static void vhost_user_fs_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
         vpci_dev->nvectors = dev->vdev.conf.num_request_queues + 2;
     }
 
+    if (vpci_dev->flags & VIRTIO_PCI_FLAG_ATS) {
+        error_setg(errp, "ATS is currently not supported with vhost-user-fs-pci");
+        return;
+    }
+
     qdev_realize(vdev, BUS(&vpci_dev->bus), errp);
 }
 
diff --git a/hw/virtio/vhost-user-fs.c b/hw/virtio/vhost-user-fs.c
index ac4fc34b36..914d68b3ee 100644
--- a/hw/virtio/vhost-user-fs.c
+++ b/hw/virtio/vhost-user-fs.c
@@ -203,6 +203,11 @@ static void vuf_device_realize(DeviceState *dev, Error **errp)
         return;
     }
 
+    if (virtio_host_has_feature(vdev, VIRTIO_F_IOMMU_PLATFORM)) {
+        error_setg(errp, "IOMMU is currently not supported with vhost-user-fs");
+        return;
+    }
+
     if (!vhost_user_init(&fs->vhost_user, &fs->conf.chardev, errp)) {
         return;
     }
-- 
2.29.2



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

end of thread, other threads:[~2021-02-17 17:17 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-26 18:23 [PATCH] IOMMU and ATS not supported by vhost-user filesystem lagarcia
2021-01-26 19:45 ` Dr. David Alan Gilbert
2021-01-26 21:58   ` Leonardo Augusto Guimarães Garcia
2021-01-27 11:19 ` Stefan Hajnoczi
2021-01-27 12:30   ` Leonardo Augusto Guimarães Garcia
2021-01-27 14:18     ` Stefan Hajnoczi
2021-01-27 15:48   ` Leonardo Augusto Guimarães Garcia
2021-01-27 16:34     ` Dr. David Alan Gilbert
2021-01-27 19:32       ` Leonardo Augusto Guimarães Garcia
2021-01-27 19:40         ` Dr. David Alan Gilbert
2021-01-27 19:54           ` Leonardo Augusto Guimarães Garcia
2021-01-27 16:49   ` Laszlo Ersek
2021-01-27 19:54     ` Dr. David Alan Gilbert
2021-01-28 15:41   ` Leonardo Augusto Guimarães Garcia
2021-02-01 11:01     ` Stefan Hajnoczi
2021-02-17 17:07   ` Leonardo Augusto Guimarães Garcia

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.