[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] IOMMU and ATS not supported by vhost-user filesystem.

From: Leonardo Augusto Guimarães Garcia
Subject: Re: [PATCH] IOMMU and ATS not supported by vhost-user filesystem.
Date: Tue, 26 Jan 2021 18:58:51 -0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0

On 1/26/21 4:45 PM, Dr. David Alan Gilbert wrote:
* lagarcia@linux.ibm.com (lagarcia@linux.ibm.com) wrote:
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 
+        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 
+ if (virtio_host_has_feature(vdev, VIRTIO_F_IOMMU_PLATFORM)) {
+        error_setg(errp, "IOMMU is currently not supported with 
+        return;
+    }
Yes, I've seen this problem - however, I'm a little confused; isn't the
negotiation of features on virtio supposed to happen automatically?
If so, how come it's managing to set VIRTIO_F_IOMMU_PLATFORM?

It is easy to set by passing iommu_platform=on on the QEMU command line. Something like this:

-device vhost-user-fs-pci,chardev=chr-vu-fs0,queue-size=512,tag=myfs,iommu_platform=on,ats=on

I understand this is a user error, but QEMU should not allow this configuration as it doesn't work.




      if (!vhost_user_init(&fs->vhost_user, &fs->conf.chardev, errp)) {

reply via email to

[Prev in Thread] Current Thread [Next in Thread]