hc
2024-05-14 bedbef8ad3e75a304af6361af235302bcc61d06b
kernel/drivers/vhost/vhost.h
....@@ -87,13 +87,17 @@
8787 /* The routine to call when the Guest pings us, or timeout. */
8888 vhost_work_fn_t handle_kick;
8989
90
- /* Last available index we saw. */
90
+ /* Last available index we saw.
91
+ * Values are limited to 0x7fff, and the high bit is used as
92
+ * a wrap counter when using VIRTIO_F_RING_PACKED. */
9193 u16 last_avail_idx;
9294
9395 /* Caches available index value from user. */
9496 u16 avail_idx;
9597
96
- /* Last index we used. */
98
+ /* Last index we used.
99
+ * Values are limited to 0x7fff, and the high bit is used as
100
+ * a wrap counter when using VIRTIO_F_RING_PACKED. */
97101 u16 last_used_idx;
98102
99103 /* Used flags */
....@@ -183,6 +187,7 @@
183187 long vhost_vring_ioctl(struct vhost_dev *d, unsigned int ioctl, void __user *argp);
184188 bool vhost_vq_access_ok(struct vhost_virtqueue *vq);
185189 bool vhost_log_access_ok(struct vhost_dev *);
190
+void vhost_clear_msg(struct vhost_dev *dev);
186191
187192 int vhost_get_vq_desc(struct vhost_virtqueue *,
188193 struct iovec iov[], unsigned int iov_count,