[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 11/13] vhost: implement vhost_force_iommu method
From: |
Cindy Lu |
Subject: |
[PATCH v3 11/13] vhost: implement vhost_force_iommu method |
Date: |
Wed, 1 Jul 2020 17:24:47 +0800 |
use the vhost_force_iommu callback to force enable feature bit
VIRTIO_F_IOMMU_PLATFORM
Signed-off-by: Cindy Lu <lulu@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");
--
2.21.1
- [PATCH v3 01/13] net: introduce qemu_get_peer, (continued)
- [PATCH v3 01/13] net: introduce qemu_get_peer, Cindy Lu, 2020/07/01
- [PATCH v3 02/13] vhost_net: use the function qemu_get_peer, Cindy Lu, 2020/07/01
- [PATCH v3 03/13] virtio-bus: introduce queue_enabled method, Cindy Lu, 2020/07/01
- [PATCH v3 04/13] virtio-pci: implement queue_enabled method, Cindy Lu, 2020/07/01
- [PATCH v3 05/13] vhost: check the existence of vhost_set_iotlb_callback, Cindy Lu, 2020/07/01
- [PATCH v3 06/13] vhost: introduce new VhostOps vhost_dev_start, Cindy Lu, 2020/07/01
- [PATCH v3 07/13] vhost: implement vhost_dev_start method, Cindy Lu, 2020/07/01
- [PATCH v3 08/13] vhost: introduce new VhostOps vhost_vq_get_addr, Cindy Lu, 2020/07/01
- [PATCH v3 09/13] vhost: implement vhost_vq_get_addr method, Cindy Lu, 2020/07/01
- [PATCH v3 10/13] vhost: introduce new VhostOps vhost_force_iommu, Cindy Lu, 2020/07/01
- [PATCH v3 11/13] vhost: implement vhost_force_iommu method,
Cindy Lu <=
- [PATCH v3 12/13] vhost-vdpa: introduce vhost-vdpa backend, Cindy Lu, 2020/07/01
- [PATCH v3 13/13] vhost-vdpa: introduce vhost-vdpa net client, Cindy Lu, 2020/07/01
- Re: [PATCH v3 00/13] vDPA support in qemu, no-reply, 2020/07/01