WSL2-Linux-Kernel/drivers/vhost
Eric Auger 83cc6a7bb7 vhost/net: Clear the pending messages when the backend is removed
[ Upstream commit 9526f9a2b7 ]

When the vhost iotlb is used along with a guest virtual iommu
and the guest gets rebooted, some MISS messages may have been
recorded just before the reboot and spuriously executed by
the virtual iommu after the reboot.

As vhost does not have any explicit reset user API,
VHOST_NET_SET_BACKEND looks a reasonable point where to clear
the pending messages, in case the backend is removed.

Export vhost_clear_msg() and call it in vhost_net_set_backend()
when fd == -1.

Signed-off-by: Eric Auger <eric.auger@redhat.com>
Suggested-by: Jason Wang <jasowang@redhat.com>
Fixes: 6b1e6cc785 ("vhost: new device IOTLB API")
Message-Id: <20230117151518.44725-3-eric.auger@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-02-09 11:26:34 +01:00
..
Kconfig vhost_vdpa: implement IRQ offloading in vhost_vdpa 2020-08-05 11:08:42 -04:00
Makefile vhost: introduce vDPA-based backend 2020-04-02 10:41:40 -04:00
iotlb.c vhost: handle error while adding split ranges to iotlb 2022-04-08 14:24:12 +02:00
net.c vhost/net: Clear the pending messages when the backend is removed 2023-02-09 11:26:34 +01:00
scsi.c vhost scsi: Convert to SPDX identifier 2021-09-05 16:23:08 -04:00
test.c tools/virtio: Add --reset 2020-06-22 12:34:21 -04:00
test.h tools/virtio: Add --reset 2020-06-22 12:34:21 -04:00
vdpa.c vhost_vdpa: don't setup irq offloading when irq_num < 0 2022-05-25 09:57:25 +02:00
vhost.c vhost/net: Clear the pending messages when the backend is removed 2023-02-09 11:26:34 +01:00
vhost.h vhost/net: Clear the pending messages when the backend is removed 2023-02-09 11:26:34 +01:00
vringh.c vringh: fix range used in iotlb_translate() 2023-01-12 11:59:11 +01:00
vsock.c vhost/vsock: Fix error handling in vhost_vsock_init() 2023-01-12 11:59:11 +01:00