Skip to content

Commit 8ccd54f

Browse files
committed
Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
Pull virtio updates from Michael Tsirkin: "virtio,vhost,vdpa: features, fixes, and cleanups: - reduction in interrupt rate in virtio - perf improvement for VDUSE - scalability for vhost-scsi - non power of 2 ring support for packed rings - better management for mlx5 vdpa - suspend for snet - VIRTIO_F_NOTIFICATION_DATA - shared backend with vdpa-sim-blk - user VA support in vdpa-sim - better struct packing for virtio and fixes, cleanups all over the place" * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: (52 commits) vhost_vdpa: fix unmap process in no-batch mode MAINTAINERS: make me a reviewer of VIRTIO CORE AND NET DRIVERS tools/virtio: fix build caused by virtio_ring changes virtio_ring: add a struct device forward declaration vdpa_sim_blk: support shared backend vdpa_sim: move buffer allocation in the devices vdpa/snet: use likely/unlikely macros in hot functions vdpa/snet: implement kick_vq_with_data callback virtio-vdpa: add VIRTIO_F_NOTIFICATION_DATA feature support virtio: add VIRTIO_F_NOTIFICATION_DATA feature support vdpa/snet: support the suspend vDPA callback vdpa/snet: support getting and setting VQ state MAINTAINERS: add vringh.h to Virtio Core and Net Drivers vringh: address kdoc warnings vdpa: address kdoc warnings virtio_ring: don't update event idx on get_buf vdpa_sim: add support for user VA vdpa_sim: replace the spinlock with a mutex to protect the state vdpa_sim: use kthread worker vdpa_sim: make devices agnostic for work management ...
2 parents 0835b5e + c82729e commit 8ccd54f

32 files changed

Lines changed: 1761 additions & 481 deletions

MAINTAINERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22212,6 +22212,7 @@ F: include/uapi/linux/virtio_console.h
2221222212
VIRTIO CORE AND NET DRIVERS
2221322213
M: "Michael S. Tsirkin" <mst@redhat.com>
2221422214
M: Jason Wang <jasowang@redhat.com>
22215+
R: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
2221522216
L: virtualization@lists.linux-foundation.org
2221622217
S: Maintained
2221722218
F: Documentation/ABI/testing/sysfs-bus-vdpa
@@ -22225,6 +22226,7 @@ F: drivers/vdpa/
2222522226
F: drivers/virtio/
2222622227
F: include/linux/vdpa.h
2222722228
F: include/linux/virtio*.h
22229+
F: include/linux/vringh.h
2222822230
F: include/uapi/linux/virtio_*.h
2222922231
F: tools/virtio/
2223022232

drivers/s390/virtio/virtio_ccw.c

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ static void virtio_ccw_drop_indicator(struct virtio_ccw_device *vcdev,
391391
ccw_device_dma_free(vcdev->cdev, thinint_area, sizeof(*thinint_area));
392392
}
393393

394-
static bool virtio_ccw_kvm_notify(struct virtqueue *vq)
394+
static inline bool virtio_ccw_do_kvm_notify(struct virtqueue *vq, u32 data)
395395
{
396396
struct virtio_ccw_vq_info *info = vq->priv;
397397
struct virtio_ccw_device *vcdev;
@@ -402,12 +402,22 @@ static bool virtio_ccw_kvm_notify(struct virtqueue *vq)
402402
BUILD_BUG_ON(sizeof(struct subchannel_id) != sizeof(unsigned int));
403403
info->cookie = kvm_hypercall3(KVM_S390_VIRTIO_CCW_NOTIFY,
404404
*((unsigned int *)&schid),
405-
vq->index, info->cookie);
405+
data, info->cookie);
406406
if (info->cookie < 0)
407407
return false;
408408
return true;
409409
}
410410

411+
static bool virtio_ccw_kvm_notify(struct virtqueue *vq)
412+
{
413+
return virtio_ccw_do_kvm_notify(vq, vq->index);
414+
}
415+
416+
static bool virtio_ccw_kvm_notify_with_data(struct virtqueue *vq)
417+
{
418+
return virtio_ccw_do_kvm_notify(vq, vring_notification_data(vq));
419+
}
420+
411421
static int virtio_ccw_read_vq_conf(struct virtio_ccw_device *vcdev,
412422
struct ccw1 *ccw, int index)
413423
{
@@ -495,13 +505,19 @@ static struct virtqueue *virtio_ccw_setup_vq(struct virtio_device *vdev,
495505
struct ccw1 *ccw)
496506
{
497507
struct virtio_ccw_device *vcdev = to_vc_device(vdev);
508+
bool (*notify)(struct virtqueue *vq);
498509
int err;
499510
struct virtqueue *vq = NULL;
500511
struct virtio_ccw_vq_info *info;
501512
u64 queue;
502513
unsigned long flags;
503514
bool may_reduce;
504515

516+
if (__virtio_test_bit(vdev, VIRTIO_F_NOTIFICATION_DATA))
517+
notify = virtio_ccw_kvm_notify_with_data;
518+
else
519+
notify = virtio_ccw_kvm_notify;
520+
505521
/* Allocate queue. */
506522
info = kzalloc(sizeof(struct virtio_ccw_vq_info), GFP_KERNEL);
507523
if (!info) {
@@ -524,7 +540,7 @@ static struct virtqueue *virtio_ccw_setup_vq(struct virtio_device *vdev,
524540
may_reduce = vcdev->revision > 0;
525541
vq = vring_create_virtqueue(i, info->num, KVM_VIRTIO_CCW_RING_ALIGN,
526542
vdev, true, may_reduce, ctx,
527-
virtio_ccw_kvm_notify, callback, name);
543+
notify, callback, name);
528544

529545
if (!vq) {
530546
/* For now, we fail if we can't get the requested size. */

0 commit comments

Comments
 (0)