- vdpa: suspend function return 0 when the vdpa device is stopped - vdpa: don't suspend/resume device when vdpa device not started - vdpa: support vdpa device suspend/resume - vdpa: correct param passed in when unregister save - vdpa: set vring enable only if the vring address has already been set - shadow_dev: introduce shadow dev for virtio-net device - revert "tcg/loongarch64: Fix tcg_out_mov() Aborted" - migration: Set downtime_start even for postcopy - gdb-xml: fix duplicate register in arm-neon.xml - iotests: fix default machine type detection - migration: fix RAMBlock add NULL check - s390x: Fix spelling errors - ppc: spelling fixes - hw/scsi/vhost-scsi: don't double close vhostfd on error - virtio/vhost-vsock: don't double close vhostfd, remove redundant cleanup - hw/scsi/vhost-scsi: don't leak vqs on error - hw/i386/pc: Add missing property descriptions - pcie_aer: Don't trigger a LSI if none are defined - pci: Export the pci_intx() function - hw/qdev: Cosmetic around documentation - tests/unit: fix a -Wformat-truncation warning - tests/avocado: mark ReplayKernelNormal.test_mips64el_malta as flaky - i386/sev: Avoid SEV-ES crash due to missing MSR_EFER_LMA bit - ui/vnc-clipboard: fix inflate_buffer - hw/usb/hcd-xhci.c: spelling: tranfer Signed-off-by: Jiabo Feng <fengjiabo1@huawei.com> (cherry picked from commit 68fee7dc06a6beb5f69d951e22a7f16091f269ff)
45 lines
1.5 KiB
Diff
45 lines
1.5 KiB
Diff
From 11c0e08a95c35adec07e3b40d1bd9452d7113236 Mon Sep 17 00:00:00 2001
|
|
From: jiangdongxu <jiangdongxu1@huawei.com>
|
|
Date: Thu, 14 Dec 2023 11:05:52 +0800
|
|
Subject: [PATCH] vdpa: set vring enable only if the vring address has already
|
|
been set
|
|
|
|
Currently, vhost-vdpa does not determine the status of each vring when
|
|
performing the enable operation on vring. When the vBIOS(EDK2) is running,
|
|
the driver will not enable all vrings. In this case, setting all vrings
|
|
to enable is isconsistent with the actual situation.
|
|
|
|
Add logic when enabling vring, make a judement on the vring status. If the
|
|
vring address is not set, the vring will not enabled.
|
|
|
|
Signed-off-by: jiangdongxu <jiangdongxu1@huawei.com>
|
|
---
|
|
hw/virtio/vhost-vdpa.c | 9 +++++++++
|
|
1 file changed, 9 insertions(+)
|
|
|
|
diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
|
|
index c7aaff7f20..36ed0c9a99 100644
|
|
--- a/hw/virtio/vhost-vdpa.c
|
|
+++ b/hw/virtio/vhost-vdpa.c
|
|
@@ -714,8 +714,17 @@ static int vhost_vdpa_get_vq_index(struct vhost_dev *dev, int idx)
|
|
static int vhost_vdpa_set_vring_ready(struct vhost_dev *dev)
|
|
{
|
|
int i;
|
|
+ int idx;
|
|
+ hwaddr addr;
|
|
+
|
|
trace_vhost_vdpa_set_vring_ready(dev);
|
|
for (i = 0; i < dev->nvqs; ++i) {
|
|
+ idx = vhost_vdpa_get_vq_index(dev, dev->vq_index + i);
|
|
+ addr = virtio_queue_get_desc_addr(dev->vdev, idx);
|
|
+ if (addr == 0) {
|
|
+ continue;
|
|
+ }
|
|
+
|
|
struct vhost_vring_state state = {
|
|
.index = dev->vq_index + i,
|
|
.num = 1,
|
|
--
|
|
2.27.0
|
|
|