]> git.baikalelectronics.ru Git - kernel.git/commit
vhost/net: Clear the pending messages when the backend is removed
authorEric Auger <eric.auger@redhat.com>
Tue, 17 Jan 2023 15:15:18 +0000 (10:15 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Feb 2023 10:28:03 +0000 (11:28 +0100)
commit0b12f164738efa2e4f344c10fe7ea79192c19998
treebde46d7332adbc0366c8c490c69b732380addd6a
parente1f8bbcd523b95e7bf7dc2edfeb80802d65ce08d
vhost/net: Clear the pending messages when the backend is removed

[ Upstream commit f83d59d200dc27b23d5301fd0192a44d38f12072 ]

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: 89cd651c320dc ("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>
drivers/vhost/net.c
drivers/vhost/vhost.c
drivers/vhost/vhost.h