aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorParav Pandit <parav@nvidia.com>2021-07-21 17:26:47 +0300
committerMichael S. Tsirkin <mst@redhat.com>2021-08-10 11:50:55 -0400
commit0e566c8f0f2e8325e35f6f97e13cde5356b41814 (patch)
tree2ab087e25fd4df501542acee9b5109ec7d5ffc22 /include
parentvirtio: Keep vring_del_virtqueue() mirror of VQ create (diff)
downloadlinux-dev-0e566c8f0f2e8325e35f6f97e13cde5356b41814.tar.xz
linux-dev-0e566c8f0f2e8325e35f6f97e13cde5356b41814.zip
virtio: Protect vqs list access
VQs may be accessed to mark the device broken while they are created/destroyed. Hence protect the access to the vqs list. Fixes: e2dcdfe95c0b ("virtio: virtio_break_device() to mark all virtqueues broken.") Signed-off-by: Parav Pandit <parav@nvidia.com> Link: https://lore.kernel.org/r/20210721142648.1525924-4-parav@nvidia.com Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/virtio.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/virtio.h b/include/linux/virtio.h
index b1894e0323fa..41edbc01ffa4 100644
--- a/include/linux/virtio.h
+++ b/include/linux/virtio.h
@@ -110,6 +110,7 @@ struct virtio_device {
bool config_enabled;
bool config_change_pending;
spinlock_t config_lock;
+ spinlock_t vqs_list_lock; /* Protects VQs list access */
struct device dev;
struct virtio_device_id id;
const struct virtio_config_ops *config;