Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
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 up some issues in rc5"

* tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
vhost-vdpa: Fix the wrong input in config_cb
VDUSE: fix documentation underline warning
Revert "virtio-blk: Add validation for block size in config space"
vhost_vdpa: unset vq irq before freeing irq
virtio: write back F_VERSION_1 before validate

+23 -37
+1 -1
Documentation/userspace-api/vduse.rst
··· 18 18 is clarified or fixed in the future. 19 19 20 20 Create/Destroy VDUSE devices 21 - ------------------------ 21 + ---------------------------- 22 22 23 23 VDUSE devices are created as follows: 24 24
+6 -31
drivers/block/virtio_blk.c
··· 689 689 static unsigned int virtblk_queue_depth; 690 690 module_param_named(queue_depth, virtblk_queue_depth, uint, 0444); 691 691 692 - static int virtblk_validate(struct virtio_device *vdev) 693 - { 694 - u32 blk_size; 695 - 696 - if (!vdev->config->get) { 697 - dev_err(&vdev->dev, "%s failure: config access disabled\n", 698 - __func__); 699 - return -EINVAL; 700 - } 701 - 702 - if (!virtio_has_feature(vdev, VIRTIO_BLK_F_BLK_SIZE)) 703 - return 0; 704 - 705 - blk_size = virtio_cread32(vdev, 706 - offsetof(struct virtio_blk_config, blk_size)); 707 - 708 - if (blk_size < SECTOR_SIZE || blk_size > PAGE_SIZE) 709 - __virtio_clear_bit(vdev, VIRTIO_BLK_F_BLK_SIZE); 710 - 711 - return 0; 712 - } 713 - 714 692 static int virtblk_probe(struct virtio_device *vdev) 715 693 { 716 694 struct virtio_blk *vblk; ··· 699 721 u16 min_io_size; 700 722 u8 physical_block_exp, alignment_offset; 701 723 unsigned int queue_depth; 724 + 725 + if (!vdev->config->get) { 726 + dev_err(&vdev->dev, "%s failure: config access disabled\n", 727 + __func__); 728 + return -EINVAL; 729 + } 702 730 703 731 err = ida_simple_get(&vd_index_ida, 0, minor_to_index(1 << MINORBITS), 704 732 GFP_KERNEL); ··· 819 835 blk_queue_logical_block_size(q, blk_size); 820 836 else 821 837 blk_size = queue_logical_block_size(q); 822 - 823 - if (blk_size < SECTOR_SIZE || blk_size > PAGE_SIZE) { 824 - dev_err(&vdev->dev, 825 - "block size is changed unexpectedly, now is %u\n", 826 - blk_size); 827 - err = -EINVAL; 828 - goto out_cleanup_disk; 829 - } 830 838 831 839 /* Use topology information if available */ 832 840 err = virtio_cread_feature(vdev, VIRTIO_BLK_F_TOPOLOGY, ··· 985 1009 .driver.name = KBUILD_MODNAME, 986 1010 .driver.owner = THIS_MODULE, 987 1011 .id_table = id_table, 988 - .validate = virtblk_validate, 989 1012 .probe = virtblk_probe, 990 1013 .remove = virtblk_remove, 991 1014 .config_changed = virtblk_config_changed,
+5 -5
drivers/vhost/vdpa.c
··· 173 173 if (status != 0 && (ops->get_status(vdpa) & ~status) != 0) 174 174 return -EINVAL; 175 175 176 + if ((status_old & VIRTIO_CONFIG_S_DRIVER_OK) && !(status & VIRTIO_CONFIG_S_DRIVER_OK)) 177 + for (i = 0; i < nvqs; i++) 178 + vhost_vdpa_unsetup_vq_irq(v, i); 179 + 176 180 if (status == 0) { 177 181 ret = ops->reset(vdpa); 178 182 if (ret) ··· 187 183 if ((status & VIRTIO_CONFIG_S_DRIVER_OK) && !(status_old & VIRTIO_CONFIG_S_DRIVER_OK)) 188 184 for (i = 0; i < nvqs; i++) 189 185 vhost_vdpa_setup_vq_irq(v, i); 190 - 191 - if ((status_old & VIRTIO_CONFIG_S_DRIVER_OK) && !(status & VIRTIO_CONFIG_S_DRIVER_OK)) 192 - for (i = 0; i < nvqs; i++) 193 - vhost_vdpa_unsetup_vq_irq(v, i); 194 186 195 187 return 0; 196 188 } ··· 322 322 struct eventfd_ctx *ctx; 323 323 324 324 cb.callback = vhost_vdpa_config_cb; 325 - cb.private = v->vdpa; 325 + cb.private = v; 326 326 if (copy_from_user(&fd, argp, sizeof(fd))) 327 327 return -EFAULT; 328 328
+11
drivers/virtio/virtio.c
··· 239 239 driver_features_legacy = driver_features; 240 240 } 241 241 242 + /* 243 + * Some devices detect legacy solely via F_VERSION_1. Write 244 + * F_VERSION_1 to force LE config space accesses before FEATURES_OK for 245 + * these when needed. 246 + */ 247 + if (drv->validate && !virtio_legacy_is_little_endian() 248 + && device_features & BIT_ULL(VIRTIO_F_VERSION_1)) { 249 + dev->features = BIT_ULL(VIRTIO_F_VERSION_1); 250 + dev->config->finalize_features(dev); 251 + } 252 + 242 253 if (device_features & (1ULL << VIRTIO_F_VERSION_1)) 243 254 dev->features = driver_features & device_features; 244 255 else