You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
2.2 KiB
63 lines
2.2 KiB
3 days ago
|
From 2052d94ffccde5d6eb5af8cca77aaf8bba650c68 Mon Sep 17 00:00:00 2001
|
||
|
From: Prasad Pandit <pjp@fedoraproject.org>
|
||
|
Date: Thu, 7 Nov 2024 17:02:47 +0530
|
||
|
Subject: [PATCH] vhost: fail device start if iotlb update fails
|
||
|
|
||
|
RH-Author: Prasad Pandit <None>
|
||
|
RH-MergeRequest: 426: vhost: fail device start if iotlb update fails
|
||
|
RH-Jira: RHEL-73006
|
||
|
RH-Acked-by: Stefano Garzarella <sgarzare@redhat.com>
|
||
|
RH-Commit: [1/1] a96478385297d0559dd7dcaebd1834141bb5fb75
|
||
|
|
||
|
While starting a vhost device, updating iotlb entries
|
||
|
via 'vhost_device_iotlb_miss' may return an error.
|
||
|
|
||
|
qemu-kvm: vhost_device_iotlb_miss:
|
||
|
700871,700871: Fail to update device iotlb
|
||
|
|
||
|
Fail device start when such an error occurs.
|
||
|
|
||
|
Jira: https://issues.redhat.com/browse/RHEL-73006
|
||
|
Signed-off-by: Prasad Pandit <pjp@fedoraproject.org>
|
||
|
Message-Id: <20241107113247.46532-1-ppandit@redhat.com>
|
||
|
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
|
||
|
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
|
||
|
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
|
||
|
(cherry picked from commit 571bdc97b83646dfd3746ec56fb2f70bca55b9a2)
|
||
|
Signed-off-by: Prasad Pandit <pjp@fedoraproject.org>
|
||
|
---
|
||
|
hw/virtio/vhost.c | 13 ++++++++++++-
|
||
|
1 file changed, 12 insertions(+), 1 deletion(-)
|
||
|
|
||
|
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
|
||
|
index f50180e60e..da0f10c4dc 100644
|
||
|
--- a/hw/virtio/vhost.c
|
||
|
+++ b/hw/virtio/vhost.c
|
||
|
@@ -2074,11 +2074,22 @@ int vhost_dev_start(struct vhost_dev *hdev, VirtIODevice *vdev, bool vrings)
|
||
|
* vhost-kernel code requires for this.*/
|
||
|
for (i = 0; i < hdev->nvqs; ++i) {
|
||
|
struct vhost_virtqueue *vq = hdev->vqs + i;
|
||
|
- vhost_device_iotlb_miss(hdev, vq->used_phys, true);
|
||
|
+ r = vhost_device_iotlb_miss(hdev, vq->used_phys, true);
|
||
|
+ if (r) {
|
||
|
+ goto fail_iotlb;
|
||
|
+ }
|
||
|
}
|
||
|
}
|
||
|
vhost_start_config_intr(hdev);
|
||
|
return 0;
|
||
|
+fail_iotlb:
|
||
|
+ if (vhost_dev_has_iommu(hdev) &&
|
||
|
+ hdev->vhost_ops->vhost_set_iotlb_callback) {
|
||
|
+ hdev->vhost_ops->vhost_set_iotlb_callback(hdev, false);
|
||
|
+ }
|
||
|
+ if (hdev->vhost_ops->vhost_dev_start) {
|
||
|
+ hdev->vhost_ops->vhost_dev_start(hdev, false);
|
||
|
+ }
|
||
|
fail_start:
|
||
|
if (vrings) {
|
||
|
vhost_dev_set_vring_enable(hdev, false);
|
||
|
--
|
||
|
2.39.3
|
||
|
|