Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost

Pull virtio fixes from Michael Tsirkin:
"Fixes all over the place, most notably fixes for latent bugs in
drivers that got exposed by suppressing interrupts before DRIVER_OK,
which in turn has been done by 8b4ec69d7e09 ("virtio: harden vring
IRQ")"

* tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
um: virt-pci: set device ready in probe()
vdpa: make get_vq_group and set_group_asid optional
virtio: Fix all occurences of the "the the" typo
vduse: Fix NULL pointer dereference on sysfs access
vringh: Fix loop descriptors check in the indirect cases
vdpa/mlx5: clean up indenting in handle_ctrl_vlan()
vdpa/mlx5: fix error code for deleting vlan
virtio-mmio: fix missing put_device() when vm_cmdline_parent registration failed
vdpa/mlx5: Fix syntax errors in comments
virtio-rng: make device ready before making request

+32 -15
+6 -1
arch/um/drivers/virt-pci.c
··· 544 544 dev->cmd_vq = vqs[0]; 545 545 dev->irq_vq = vqs[1]; 546 546 547 + virtio_device_ready(dev->vdev); 548 + 547 549 for (i = 0; i < NUM_IRQ_MSGS; i++) { 548 550 void *msg = kzalloc(MAX_IRQ_MSG_SIZE, GFP_KERNEL); 549 551 ··· 589 587 dev->irq = irq_alloc_desc(numa_node_id()); 590 588 if (dev->irq < 0) { 591 589 err = dev->irq; 592 - goto error; 590 + goto err_reset; 593 591 } 594 592 um_pci_devices[free].dev = dev; 595 593 vdev->priv = dev; ··· 606 604 607 605 um_pci_rescan(); 608 606 return 0; 607 + err_reset: 608 + virtio_reset_device(vdev); 609 + vdev->config->del_vqs(vdev); 609 610 error: 610 611 mutex_unlock(&um_pci_mtx); 611 612 kfree(dev);
+2
drivers/char/hw_random/virtio-rng.c
··· 159 159 goto err_find; 160 160 } 161 161 162 + virtio_device_ready(vdev); 163 + 162 164 /* we always have a pending entropy request */ 163 165 request_entropy(vi); 164 166
+5 -4
drivers/vdpa/mlx5/net/mlx5_vnet.c
··· 107 107 108 108 /* Resources for implementing the notification channel from the device 109 109 * to the driver. fwqp is the firmware end of an RC connection; the 110 - * other end is vqqp used by the driver. cq is is where completions are 110 + * other end is vqqp used by the driver. cq is where completions are 111 111 * reported. 112 112 */ 113 113 struct mlx5_vdpa_cq cq; ··· 1814 1814 1815 1815 id = mlx5vdpa16_to_cpu(mvdev, vlan); 1816 1816 mac_vlan_del(ndev, ndev->config.mac, id, true); 1817 + status = VIRTIO_NET_OK; 1817 1818 break; 1818 1819 default: 1819 - break; 1820 - } 1820 + break; 1821 + } 1821 1822 1822 - return status; 1823 + return status; 1823 1824 } 1824 1825 1825 1826 static void mlx5_cvq_kick_handler(struct work_struct *work)
+3 -4
drivers/vdpa/vdpa_user/vduse_dev.c
··· 1345 1345 1346 1346 dev->minor = ret; 1347 1347 dev->msg_timeout = VDUSE_MSG_DEFAULT_TIMEOUT; 1348 - dev->dev = device_create(vduse_class, NULL, 1349 - MKDEV(MAJOR(vduse_major), dev->minor), 1350 - dev, "%s", config->name); 1348 + dev->dev = device_create_with_groups(vduse_class, NULL, 1349 + MKDEV(MAJOR(vduse_major), dev->minor), 1350 + dev, vduse_dev_groups, "%s", config->name); 1351 1351 if (IS_ERR(dev->dev)) { 1352 1352 ret = PTR_ERR(dev->dev); 1353 1353 goto err_dev; ··· 1596 1596 return PTR_ERR(vduse_class); 1597 1597 1598 1598 vduse_class->devnode = vduse_devnode; 1599 - vduse_class->dev_groups = vduse_dev_groups; 1600 1599 1601 1600 ret = alloc_chrdev_region(&vduse_major, 0, VDUSE_DEV_MAX, "vduse"); 1602 1601 if (ret)
+2
drivers/vhost/vdpa.c
··· 499 499 ops->set_vq_ready(vdpa, idx, s.num); 500 500 return 0; 501 501 case VHOST_VDPA_GET_VRING_GROUP: 502 + if (!ops->get_vq_group) 503 + return -EOPNOTSUPP; 502 504 s.index = idx; 503 505 s.num = ops->get_vq_group(vdpa, idx); 504 506 if (s.num >= vdpa->ngroups)
+8 -2
drivers/vhost/vringh.c
··· 292 292 int (*copy)(const struct vringh *vrh, 293 293 void *dst, const void *src, size_t len)) 294 294 { 295 - int err, count = 0, up_next, desc_max; 295 + int err, count = 0, indirect_count = 0, up_next, desc_max; 296 296 struct vring_desc desc, *descs; 297 297 struct vringh_range range = { -1ULL, 0 }, slowrange; 298 298 bool slow = false; ··· 349 349 continue; 350 350 } 351 351 352 - if (count++ == vrh->vring.num) { 352 + if (up_next == -1) 353 + count++; 354 + else 355 + indirect_count++; 356 + 357 + if (count > vrh->vring.num || indirect_count > desc_max) { 353 358 vringh_bad("Descriptor loop in %p", descs); 354 359 err = -ELOOP; 355 360 goto fail; ··· 416 411 i = return_from_indirect(vrh, &up_next, 417 412 &descs, &desc_max); 418 413 slow = false; 414 + indirect_count = 0; 419 415 } else 420 416 break; 421 417 }
+2 -1
drivers/virtio/virtio_mmio.c
··· 255 255 256 256 /* 257 257 * Per memory-barriers.txt, wmb() is not needed to guarantee 258 - * that the the cache coherent memory writes have completed 258 + * that the cache coherent memory writes have completed 259 259 * before writing to the MMIO region. 260 260 */ 261 261 writel(status, vm_dev->base + VIRTIO_MMIO_STATUS); ··· 701 701 if (!vm_cmdline_parent_registered) { 702 702 err = device_register(&vm_cmdline_parent); 703 703 if (err) { 704 + put_device(&vm_cmdline_parent); 704 705 pr_err("Failed to register parent device!\n"); 705 706 return err; 706 707 }
+1 -1
drivers/virtio/virtio_pci_modern_dev.c
··· 469 469 470 470 /* 471 471 * Per memory-barriers.txt, wmb() is not needed to guarantee 472 - * that the the cache coherent memory writes have completed 472 + * that the cache coherent memory writes have completed 473 473 * before writing to the MMIO region. 474 474 */ 475 475 vp_iowrite8(status, &cfg->device_status);
+3 -2
include/linux/vdpa.h
··· 178 178 * for the device 179 179 * @vdev: vdpa device 180 180 * Returns virtqueue algin requirement 181 - * @get_vq_group: Get the group id for a specific virtqueue 181 + * @get_vq_group: Get the group id for a specific 182 + * virtqueue (optional) 182 183 * @vdev: vdpa device 183 184 * @idx: virtqueue index 184 185 * Returns u32: group id for this virtqueue ··· 244 243 * Returns the iova range supported by 245 244 * the device. 246 245 * @set_group_asid: Set address space identifier for a 247 - * virtqueue group 246 + * virtqueue group (optional) 248 247 * @vdev: vdpa device 249 248 * @group: virtqueue group 250 249 * @asid: address space id for this group