Skip to content

Commit 9e5eefb

Browse files
committed
Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
Pull virtio fixes from Michael Tsirkin: "Some minor fixes" * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: vringh: fix copy direction of vringh_iov_push_kern() vsock/virtio: remove unused 'work' field from 'struct virtio_vsock_pkt' virtio_ring: fix stalls for packed rings
2 parents d6d5df1 + b3683de commit 9e5eefb

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

drivers/vhost/vringh.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -852,6 +852,12 @@ static inline int xfer_kern(void *src, void *dst, size_t len)
852852
return 0;
853853
}
854854

855+
static inline int kern_xfer(void *dst, void *src, size_t len)
856+
{
857+
memcpy(dst, src, len);
858+
return 0;
859+
}
860+
855861
/**
856862
* vringh_init_kern - initialize a vringh for a kernelspace vring.
857863
* @vrh: the vringh to initialize.
@@ -958,7 +964,7 @@ EXPORT_SYMBOL(vringh_iov_pull_kern);
958964
ssize_t vringh_iov_push_kern(struct vringh_kiov *wiov,
959965
const void *src, size_t len)
960966
{
961-
return vringh_iov_xfer(wiov, (void *)src, len, xfer_kern);
967+
return vringh_iov_xfer(wiov, (void *)src, len, kern_xfer);
962968
}
963969
EXPORT_SYMBOL(vringh_iov_push_kern);
964970

drivers/virtio/virtio_ring.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1499,9 +1499,6 @@ static bool virtqueue_enable_cb_delayed_packed(struct virtqueue *_vq)
14991499
* counter first before updating event flags.
15001500
*/
15011501
virtio_wmb(vq->weak_barriers);
1502-
} else {
1503-
used_idx = vq->last_used_idx;
1504-
wrap_counter = vq->packed.used_wrap_counter;
15051502
}
15061503

15071504
if (vq->packed.event_flags_shadow == VRING_PACKED_EVENT_FLAG_DISABLE) {
@@ -1518,7 +1515,9 @@ static bool virtqueue_enable_cb_delayed_packed(struct virtqueue *_vq)
15181515
*/
15191516
virtio_mb(vq->weak_barriers);
15201517

1521-
if (is_used_desc_packed(vq, used_idx, wrap_counter)) {
1518+
if (is_used_desc_packed(vq,
1519+
vq->last_used_idx,
1520+
vq->packed.used_wrap_counter)) {
15221521
END_USE(vq);
15231522
return false;
15241523
}

include/linux/virtio_vsock.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ struct virtio_vsock_sock {
4848

4949
struct virtio_vsock_pkt {
5050
struct virtio_vsock_hdr hdr;
51-
struct work_struct work;
5251
struct list_head list;
5352
/* socket refcnt not held, only use for cancellation */
5453
struct vsock_sock *vsk;

0 commit comments

Comments
 (0)