Skip to content

Commit 3bf6a9e

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,vdpa,qemu_fw_cfg: features, cleanups, and fixes. - partial support for < MAX_ORDER - 1 granularity for virtio-mem - driver_override for vdpa - sysfs ABI documentation for vdpa - multiqueue config support for mlx5 vdpa - and misc fixes, cleanups" * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: (42 commits) vdpa/mlx5: Fix tracking of current number of VQs vdpa/mlx5: Fix is_index_valid() to refer to features vdpa: Protect vdpa reset with cf_mutex vdpa: Avoid taking cf_mutex lock on get status vdpa/vdpa_sim_net: Report max device capabilities vdpa: Use BIT_ULL for bit operations vdpa/vdpa_sim: Configure max supported virtqueues vdpa/mlx5: Report max device capabilities vdpa: Support reporting max device capabilities vdpa/mlx5: Restore cur_num_vqs in case of failure in change_num_qps() vdpa: Add support for returning device configuration information vdpa/mlx5: Support configuring max data virtqueue vdpa/mlx5: Fix config_attr_mask assignment vdpa: Allow to configure max data virtqueues vdpa: Read device configuration only if FEATURES_OK vdpa: Sync calls set/get config/status with cf_mutex vdpa/mlx5: Distribute RX virtqueues in RQT object vdpa: Provide interface to read driver features vdpa: clean up get_config_size ret value handling virtio_ring: mark ring unused on error ...
2 parents 46a10fc + b03fc43 commit 3bf6a9e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+578
-237
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
What: /sys/bus/vdpa/driver_autoprobe
2+
Date: March 2020
3+
Contact: virtualization@lists.linux-foundation.org
4+
Description:
5+
This file determines whether new devices are immediately bound
6+
to a driver after the creation. It initially contains 1, which
7+
means the kernel automatically binds devices to a compatible
8+
driver immediately after they are created.
9+
10+
Writing "0" to this file disable this feature, any other string
11+
enable it.
12+
13+
What: /sys/bus/vdpa/driver_probe
14+
Date: March 2020
15+
Contact: virtualization@lists.linux-foundation.org
16+
Description:
17+
Writing a device name to this file will cause the kernel binds
18+
devices to a compatible driver.
19+
20+
This can be useful when /sys/bus/vdpa/driver_autoprobe is
21+
disabled.
22+
23+
What: /sys/bus/vdpa/drivers/.../bind
24+
Date: March 2020
25+
Contact: virtualization@lists.linux-foundation.org
26+
Description:
27+
Writing a device name to this file will cause the driver to
28+
attempt to bind to the device. This is useful for overriding
29+
default bindings.
30+
31+
What: /sys/bus/vdpa/drivers/.../unbind
32+
Date: March 2020
33+
Contact: virtualization@lists.linux-foundation.org
34+
Description:
35+
Writing a device name to this file will cause the driver to
36+
attempt to unbind from the device. This may be useful when
37+
overriding default bindings.
38+
39+
What: /sys/bus/vdpa/devices/.../driver_override
40+
Date: November 2021
41+
Contact: virtualization@lists.linux-foundation.org
42+
Description:
43+
This file allows the driver for a device to be specified.
44+
When specified, only a driver with a name matching the value
45+
written to driver_override will have an opportunity to bind to
46+
the device. The override is specified by writing a string to the
47+
driver_override file (echo vhost-vdpa > driver_override) and may
48+
be cleared with an empty string (echo > driver_override).
49+
This returns the device to standard matching rules binding.
50+
Writing to driver_override does not automatically unbind the
51+
device from its current driver or make any attempt to
52+
automatically load the specified driver. If no driver with a
53+
matching name is currently loaded in the kernel, the device will
54+
not bind to any driver. This also allows devices to opt-out of
55+
driver binding using a driver_override name such as "none".
56+
Only a single driver may be specified in the override, there is
57+
no support for parsing delimiters.

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20377,6 +20377,7 @@ M: "Michael S. Tsirkin" <mst@redhat.com>
2037720377
M: Jason Wang <jasowang@redhat.com>
2037820378
L: virtualization@lists.linux-foundation.org
2037920379
S: Maintained
20380+
F: Documentation/ABI/testing/sysfs-bus-vdpa
2038020381
F: Documentation/devicetree/bindings/virtio/
2038120382
F: drivers/block/virtio_blk.c
2038220383
F: drivers/crypto/virtio/

arch/um/drivers/virt-pci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ static void um_pci_virtio_remove(struct virtio_device *vdev)
616616
int i;
617617

618618
/* Stop all virtqueues */
619-
vdev->config->reset(vdev);
619+
virtio_reset_device(vdev);
620620
vdev->config->del_vqs(vdev);
621621

622622
device_set_wakeup_enable(&vdev->dev, false);

drivers/block/virtio_blk.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,7 @@ static void virtblk_remove(struct virtio_device *vdev)
976976
mutex_lock(&vblk->vdev_mutex);
977977

978978
/* Stop all the virtqueues. */
979-
vdev->config->reset(vdev);
979+
virtio_reset_device(vdev);
980980

981981
/* Virtqueues are stopped, nothing can use vblk->vdev anymore. */
982982
vblk->vdev = NULL;
@@ -995,7 +995,7 @@ static int virtblk_freeze(struct virtio_device *vdev)
995995
struct virtio_blk *vblk = vdev->priv;
996996

997997
/* Ensure we don't receive any more interrupts */
998-
vdev->config->reset(vdev);
998+
virtio_reset_device(vdev);
999999

10001000
/* Make sure no work handler is accessing the device. */
10011001
flush_work(&vblk->config_work);

drivers/bluetooth/virtio_bt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ static void virtbt_remove(struct virtio_device *vdev)
367367
struct hci_dev *hdev = vbt->hdev;
368368

369369
hci_unregister_dev(hdev);
370-
vdev->config->reset(vdev);
370+
virtio_reset_device(vdev);
371371

372372
hci_free_dev(hdev);
373373
vbt->hdev = NULL;

drivers/char/hw_random/virtio-rng.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,9 @@ static void remove_common(struct virtio_device *vdev)
179179
vi->data_avail = 0;
180180
vi->data_idx = 0;
181181
complete(&vi->have_data);
182-
vdev->config->reset(vdev);
183182
if (vi->hwrng_register_done)
184183
hwrng_unregister(&vi->hwrng);
184+
virtio_reset_device(vdev);
185185
vdev->config->del_vqs(vdev);
186186
ida_simple_remove(&rng_index_ida, vi->index);
187187
kfree(vi);

drivers/char/virtio_console.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1958,7 +1958,7 @@ static void virtcons_remove(struct virtio_device *vdev)
19581958
spin_unlock_irq(&pdrvdata_lock);
19591959

19601960
/* Disable interrupts for vqs */
1961-
vdev->config->reset(vdev);
1961+
virtio_reset_device(vdev);
19621962
/* Finish up work that's lined up */
19631963
if (use_multiport(portdev))
19641964
cancel_work_sync(&portdev->control_work);
@@ -2148,7 +2148,7 @@ static int virtcons_freeze(struct virtio_device *vdev)
21482148

21492149
portdev = vdev->priv;
21502150

2151-
vdev->config->reset(vdev);
2151+
virtio_reset_device(vdev);
21522152

21532153
if (use_multiport(portdev))
21542154
virtqueue_disable_cb(portdev->c_ivq);

drivers/crypto/virtio/virtio_crypto_core.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ static int virtcrypto_probe(struct virtio_device *vdev)
404404
free_engines:
405405
virtcrypto_clear_crypto_engines(vcrypto);
406406
free_vqs:
407-
vcrypto->vdev->config->reset(vdev);
407+
virtio_reset_device(vdev);
408408
virtcrypto_del_vqs(vcrypto);
409409
free_dev:
410410
virtcrypto_devmgr_rm_dev(vcrypto);
@@ -436,7 +436,7 @@ static void virtcrypto_remove(struct virtio_device *vdev)
436436

437437
if (virtcrypto_dev_started(vcrypto))
438438
virtcrypto_dev_stop(vcrypto);
439-
vdev->config->reset(vdev);
439+
virtio_reset_device(vdev);
440440
virtcrypto_free_unused_reqs(vcrypto);
441441
virtcrypto_clear_crypto_engines(vcrypto);
442442
virtcrypto_del_vqs(vcrypto);
@@ -456,7 +456,7 @@ static int virtcrypto_freeze(struct virtio_device *vdev)
456456
{
457457
struct virtio_crypto *vcrypto = vdev->priv;
458458

459-
vdev->config->reset(vdev);
459+
virtio_reset_device(vdev);
460460
virtcrypto_free_unused_reqs(vcrypto);
461461
if (virtcrypto_dev_started(vcrypto))
462462
virtcrypto_dev_stop(vcrypto);
@@ -492,7 +492,7 @@ static int virtcrypto_restore(struct virtio_device *vdev)
492492
free_engines:
493493
virtcrypto_clear_crypto_engines(vcrypto);
494494
free_vqs:
495-
vcrypto->vdev->config->reset(vdev);
495+
virtio_reset_device(vdev);
496496
virtcrypto_del_vqs(vcrypto);
497497
return err;
498498
}

drivers/firmware/arm_scmi/virtio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ static void scmi_vio_remove(struct virtio_device *vdev)
452452
* outstanding message on any vqueue to be ignored by complete_cb: now
453453
* we can just stop processing buffers and destroy the vqueues.
454454
*/
455-
vdev->config->reset(vdev);
455+
virtio_reset_device(vdev);
456456
vdev->config->del_vqs(vdev);
457457
/* Ensure scmi_vdev is visible as NULL */
458458
smp_store_mb(scmi_vdev, NULL);

drivers/gpio/gpio-virtio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ static void virtio_gpio_request_vq(struct virtqueue *vq)
450450

451451
static void virtio_gpio_free_vqs(struct virtio_device *vdev)
452452
{
453-
vdev->config->reset(vdev);
453+
virtio_reset_device(vdev);
454454
vdev->config->del_vqs(vdev);
455455
}
456456

0 commit comments

Comments
 (0)