[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 38/41] vhost: implement vhost_force_iommu method
From: |
Michael S. Tsirkin |
Subject: |
[PULL v2 38/41] vhost: implement vhost_force_iommu method |
Date: |
Sat, 4 Jul 2020 14:31:00 -0400 |
From: Cindy Lu <lulu@redhat.com>
use the vhost_force_iommu callback to force enable feature bit
VIRTIO_F_IOMMU_PLATFORM
Signed-off-by: Cindy Lu <lulu@redhat.com>
Message-Id: <20200701145538.22333-12-lulu@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
---
hw/virtio/vhost.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index 1e083a8976..1a1384e7a6 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -810,6 +810,11 @@ static int vhost_dev_set_features(struct vhost_dev *dev,
if (!vhost_dev_has_iommu(dev)) {
features &= ~(0x1ULL << VIRTIO_F_IOMMU_PLATFORM);
}
+ if (dev->vhost_ops->vhost_force_iommu) {
+ if (dev->vhost_ops->vhost_force_iommu(dev) == true) {
+ features |= 0x1ULL << VIRTIO_F_IOMMU_PLATFORM;
+ }
+ }
r = dev->vhost_ops->vhost_set_features(dev, features);
if (r < 0) {
VHOST_OPS_DEBUG("vhost_set_features failed");
--
MST
- Re: [PULL v2 31/41] virtio-pci: implement queue_enabled method, (continued)
[PULL v2 32/41] vhost: check the existence of vhost_set_iotlb_callback, Michael S. Tsirkin, 2020/07/04
[PULL v2 33/41] vhost: introduce new VhostOps vhost_dev_start, Michael S. Tsirkin, 2020/07/04
[PULL v2 34/41] vhost: implement vhost_dev_start method, Michael S. Tsirkin, 2020/07/04
[PULL v2 35/41] vhost: introduce new VhostOps vhost_vq_get_addr, Michael S. Tsirkin, 2020/07/04
[PULL v2 36/41] vhost: implement vhost_vq_get_addr method, Michael S. Tsirkin, 2020/07/04
[PULL v2 37/41] vhost: introduce new VhostOps vhost_force_iommu, Michael S. Tsirkin, 2020/07/04
[PULL v2 39/41] vhost_net: introduce set_config & get_config, Michael S. Tsirkin, 2020/07/04
[PULL v2 38/41] vhost: implement vhost_force_iommu method,
Michael S. Tsirkin <=
[PULL v2 40/41] vhost-vdpa: introduce vhost-vdpa backend, Michael S. Tsirkin, 2020/07/04
[PULL v2 41/41] vhost-vdpa: introduce vhost-vdpa net client, Michael S. Tsirkin, 2020/07/04
[PULL v2 21/41] virtio-mem: Migration sanity checks, Michael S. Tsirkin, 2020/07/04
Re: [PULL v2 00/41] virtio,acpi: features, fixes, cleanups., Peter Maydell, 2020/07/07
- Re: [PULL v2 00/41] virtio,acpi: features, fixes, cleanups., Michael S. Tsirkin, 2020/07/07
- Re: [PULL v2 00/41] virtio,acpi: features, fixes, cleanups., Peter Maydell, 2020/07/07
- Re: [PULL v2 00/41] virtio,acpi: features, fixes, cleanups., Michael S. Tsirkin, 2020/07/08
- Re: [PULL v2 00/41] virtio,acpi: features, fixes, cleanups., Peter Maydell, 2020/07/08