[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-8.2.3 85/87] vdpa-dev: Fix the issue of device status not updati
From: |
Michael Tokarev |
Subject: |
[Stable-8.2.3 85/87] vdpa-dev: Fix the issue of device status not updating when configuration interruption is triggered |
Date: |
Wed, 10 Apr 2024 10:22:58 +0300 |
From: lyx634449800 <yuxue.liu@jaguarmicro.com>
The set_config callback function vhost_vdpa_device_get_config in
vdpa-dev does not fetch the current device status from the hardware
device, causing the guest os to not receive the latest device status
information.
The hardware updates the config status of the vdpa device and then
notifies the os. The guest os receives an interrupt notification,
triggering a get_config access in the kernel, which then enters qemu
internally. Ultimately, the vhost_vdpa_device_get_config function of
vdpa-dev is called
One scenario encountered is when the device needs to bring down the
vdpa net device. After modifying the status field of virtio_net_config
in the hardware, it sends an interrupt notification. However, the guest
os always receives the STATUS field as VIRTIO_NET_S_LINK_UP.
Signed-off-by: Yuxue Liu <yuxue.liu@jaguarmicro.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Message-Id: <20240408020003.1979-1-yuxue.liu@jaguarmicro.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 6ae72f609a21cfc56bf655cd4bcded5d07691ce7)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/hw/virtio/vdpa-dev.c b/hw/virtio/vdpa-dev.c
index c9c6d6c611..74af1822c1 100644
--- a/hw/virtio/vdpa-dev.c
+++ b/hw/virtio/vdpa-dev.c
@@ -192,7 +192,14 @@ static void
vhost_vdpa_device_get_config(VirtIODevice *vdev, uint8_t *config)
{
VhostVdpaDevice *s = VHOST_VDPA_DEVICE(vdev);
+ int ret;
+ ret = vhost_dev_get_config(&s->dev, s->config, s->config_size,
+ NULL);
+ if (ret < 0) {
+ error_report("get device config space failed");
+ return;
+ }
memcpy(config, s->config, s->config_size);
}
--
2.39.2
- [Stable-8.2.3 76/87] migration/postcopy: Ensure postcopy_start() sets errp if it fails, (continued)
- [Stable-8.2.3 76/87] migration/postcopy: Ensure postcopy_start() sets errp if it fails, Michael Tokarev, 2024/04/10
- [Stable-8.2.3 75/87] target/hppa: Clear psw_n for BE on use_nullify_skip path, Michael Tokarev, 2024/04/10
- [Stable-8.2.3 78/87] hw/intc/arm_gicv3: ICC_HPPIR* return SPURIOUS if int group is disabled, Michael Tokarev, 2024/04/10
- [Stable-8.2.3 74/87] tcg/optimize: Fix sign_mask for logical right-shift, Michael Tokarev, 2024/04/10
- [Stable-8.2.3 79/87] target/arm: take HSTR traps of cp15 accesses to EL2, not EL1, Michael Tokarev, 2024/04/10
- [Stable-8.2.3 80/87] hw/net/virtio-net: fix qemu set used ring flag even vhost started, Michael Tokarev, 2024/04/10
- [Stable-8.2.3 81/87] block/virtio-blk: Fix memory leak from virtio_blk_zone_report, Michael Tokarev, 2024/04/10
- [Stable-8.2.3 82/87] migration/postcopy: ensure preempt channel is ready before loading states, Michael Tokarev, 2024/04/10
- [Stable-8.2.3 83/87] target/arm: Use correct SecuritySpace for AArch64 AT ops at EL3, Michael Tokarev, 2024/04/10
- [Stable-8.2.3 84/87] hw/virtio: Fix packed virtqueue flush used_idx, Michael Tokarev, 2024/04/10
- [Stable-8.2.3 85/87] vdpa-dev: Fix the issue of device status not updating when configuration interruption is triggered,
Michael Tokarev <=
- [Stable-8.2.3 87/87] virtio-snd: rewrite invalid tx/rx message handling, Michael Tokarev, 2024/04/10
- [Stable-8.2.3 86/87] virtio-snd: Enhance error handling for invalid transfers, Michael Tokarev, 2024/04/10
- Re: [Stable-8.2.3 00/87] Patch Round-up for stable 8.2.3, freeze on 2024-04-20, Cole Robinson, 2024/04/16