vhost/net: Clear the pending messages when the backend is removed
stable inclusion from stable-v5.10.168 commit f9815b303e61c70ab5724b5059ce96571b4eeefd category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I7URR4 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=f9815b303e61c70ab5724b5059ce96571b4eeefd ---------------------------------------------------- [ Upstream commit 9526f9a2 ] 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: NEric Auger <eric.auger@redhat.com> Suggested-by: NJason Wang <jasowang@redhat.com> Fixes: 6b1e6cc7 ("vhost: new device IOTLB API") Message-Id: <20230117151518.44725-3-eric.auger@redhat.com> Signed-off-by: NMichael S. Tsirkin <mst@redhat.com> Signed-off-by: NSasha Levin <sashal@kernel.org> Signed-off-by: Nzhaoxiaoqiang11 <zhaoxiaoqiang11@jd.com>
Showing
想要评论请 注册 或 登录