virtio: fix spec compliance issues
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest25 patches 20 repliesIn review
- v325 patches 2 repliesSuperseded
- v215 patches 15 repliesSuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 | 16 patches | 28 replies | Superseded |
Changes from v4 from the cover letter
rename virtio_enable_vqs_early() to virtio_device_ready()
Note: Rusty requested we add a BUG_ON in the virtio_ring code.
This can be done by a separate patch on top. Good for bisectability in case BUG_ON starts triggering :)
Patches in v4 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/25 | virtio_pci: fix virtio spec compliance on restoredrivers/ | +30 | 0 replies | |
| 2/25 | virtio: unify config_changed handlingdrivers/ drivers/ drivers/ +4 more | +17 | 0 replies | |
| 3/25 | virtio-pci: move freeze/restore to virtio coredrivers/ drivers/ include/ | +62 | 2 replies | |
| 4/25 | virtio: defer config changed notificationsdrivers/ include/ | +54 | 2 replies | |
| 5/25 | virtio_blk: drop config_enabledrivers/ | +4 | 0 replies | |
| 6/25 | virtio-blk: drop config_mutexdrivers/ | +0 | 0 replies | |
| 7/25 | virtio_net: drop config_enabledrivers/ | +4 | 0 replies | |
| 8/25 | virtio-net: drop config_mutexdrivers/ | +1 | 0 replies | |
| 8/25 | virtio-net: drop config_mutexdrivers/ | +1 | 0 replies | |
| 9/25 | virtio_net: minor cleanupdrivers/ | +2 | 0 replies | |
| 10/25 | virtio: add API to enable VQs earlyinclude/ | +17 | 3 replies | |
| 10/25 | virtio: add API to enable VQs earlyinclude/ | +17 | 0 replies | |
| 11/25 | virtio_net: enable VQs earlydrivers/ | +2 | 0 replies | |
| 12/25 | virtio_blk: enable VQs earlydrivers/ | +2 | 0 replies | |
| 12/25 | virtio_blk: enable VQs earlydrivers/ | +2 | 0 replies | |
| 13/25 | virtio_console: enable VQs earlydrivers/ | +2 | 17 replies | |
| 13/25 | virtio_console: enable VQs earlydrivers/ | +2 | 0 replies | |
| 14/25 | 9p/trans_virtio: enable VQs earlynet/ | +2 | 0 replies | |
| 15/25 | virtio_net: fix use after free on allocation failuredrivers/ | +2 | 0 replies | |
| 16/25 | virtio_scsi: move kick event out from virtscsi_initdrivers/ | +11 | 0 replies | |
| 16/25 | virtio_scsi: move kick event out from virtscsi_initdrivers/ | +11 | 0 replies | |
| 17/25 | virtio_blk: enable VQs early on restoredrivers/ | +6 | 0 replies | |
| 17/25 | virtio_blk: enable VQs early on restoredrivers/ | +6 | 0 replies | |
| 18/25 | virtio_scsi: enable VQs early on restoredrivers/ | +2 | 0 replies | |
| 18/25 | virtio_scsi: enable VQs early on restoredrivers/ | +2 | 0 replies | |
| 19/25 | virtio_console: enable VQs early on restoredrivers/ | +2 | 0 replies | |
| 20/25 | virtio_net: enable VQs early on restoredrivers/ | +2 | 0 replies | |
| 20/25 | virtio_net: enable VQs early on restoredrivers/ | +2 | 0 replies | |
| 21/25 | virito_scsi: use freezable WQ for eventsdrivers/ | +1 | 0 replies | |
| 21/25 | virito_scsi: use freezable WQ for eventsdrivers/ | +1 | 0 replies | |
| 22/25 | virtio_scsi: fix race on device removaldrivers/ | +10 | 0 replies | |
| 23/25 | virtio_balloon: enable VQs early on restoredrivers/ | +2 | 0 replies | |
| 23/25 | virtio_balloon: enable VQs early on restoredrivers/ | +2 | 0 replies | |
| 24/25 | virtio_scsi: drop scan callbackdrivers/ | +7 | 0 replies | |
| 24/25 | virtio_scsi: drop scan callbackdrivers/ | +7 | 0 replies | |
| 25/25 | virtio-rng: refactor probe error handlingdrivers/ | +9 | 0 replies | |
| 25/25 | virtio-rng: refactor probe error handlingdrivers/ | +9 | 0 replies |
Reviews trailers per patch
19 of 37 patches have a Reviewed-by or Acked-by.
| Patch | Cornelia Huck | Michael S. Tsirkin | Josh Boyer |
|---|---|---|---|
| 1/25 | |||
| 2/25 | R-b | ||
| 3/25 | R-b | ||
| 4/25 | R-b | ||
| 5/25 | R-b | ||
| 6/25 | R-b | ||
| 7/25 | R-b | ||
| 8/25 | R-b R-b | ||
| 8/25 | R-b R-b | ||
| 9/25 | A-b | ||
| 10/25 | R-b R-b | ||
| 10/25 | R-b R-b | ||
| 11/25 | R-b | ||
| 12/25 | R-b R-b | ||
| 12/25 | R-b R-b | ||
| 13/25 | R-b R-b T-b A-b A-b T-b | T-b | |
| 13/25 | R-b R-b T-b A-b A-b T-b | T-b | |
| 14/25 | |||
| 15/25 | R-b | ||
| 16/25 | |||
| 16/25 | |||
| 17/25 | |||
| 17/25 | |||
| 18/25 | |||
| 18/25 | |||
| 19/25 | |||
| 20/25 | R-b R-b | ||
| 20/25 | R-b R-b | ||
| 21/25 | |||
| 21/25 | |||
| 22/25 | |||
| 23/25 | |||
| 23/25 | |||
| 24/25 | |||
| 24/25 | |||
| 25/25 | |||
| 25/25 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.
Cover letter [PATCH v4 00/25] virtio: fix spec compliance issues
Changes from v4:
rename virtio_enable_vqs_early() to virtio_device_ready()
Note: Rusty requested we add a BUG_ON in the virtio_ring code.
This can be done by a separate patch on top. Good for bisectability in case BUG_ON starts triggering :)
Rusty, please review this, and consider for this merge window.
This fixes the following virtio spec compliance issues:
1. on restore, drivers use device before setting ACKNOWLEDGE and DRIVER bits
2. on probe, drivers aren't prepared to handle config interrupts arriving before probe returns
3. on probe, drivers use device before DRIVER_OK it set
Note that 1 is a clear violation of virtio spec 0.9 and 1.0, so I am proposing the fix for stable. OTOH 2 is against 1.0 rules but is a known documented bug in many drivers, so let's fix it going forward, but it does not seem to be worth it to backport the changes.
An error handling bugfix for virtio-net and a fix for a theoretical race condition in virtio scsi is also included.
2 is merely a theoretical race condition, but it seems important to address to make sure that changes to address 3 do not introduce instability.
I also included patch to drop scan callback use from virtio
scsi: using this callback creates asymmetry between probe and resume, and we actually had to add code comments so people can figure out the flow. Code flow becomes clearer with the new API.
After this change, the only user of the scan callback is virtio rng. It's possible to modify it trivially and then drop scan callback from core, but I'm rather inclined to look at ways to make some rng core changes so that we don't need to
have so many variables tracking device state.
So this is deferred for now.
Michael S. Tsirkin (24):
virtio_pci: fix virtio spec compliance on restore
virtio: unify config_changed handling
virtio-pci: move freeze/restore to virtio core
virtio: defer config changed notifications
virtio_blk: drop config_enable
virtio-blk: drop config_mutex
virtio_net: drop config_enable
virtio-net: drop config_mutex
virtio_net: minor cleanup
virtio: add API to enable VQs early
virtio_net: enable VQs early
virtio_blk: enable VQs early
virtio_console: enable VQs early 9p/trans_virtio: enable VQs early
virtio_net: fix use after free on allocation failure
virtio_scsi: move kick event out from virtscsi_init
virtio_blk: enable VQs early on restore
virtio_scsi: enable VQs early on restore
virtio_console: enable VQs early on restore
virtio_net: enable VQs early on restore
virtio_scsi: fix race on device removal
virtio_balloon: enable VQs early on restore
virtio_scsi: drop scan callback
virtio-rng: refactor probe error handling
Paolo Bonzini (1):
virito_scsi: use freezable WQ for events
include/linux/virtio.h | 14 +++++ include/linux/virtio_config.h | 17 ++++++ drivers/block/virtio_blk.c | 40 ++++---------- drivers/char/hw_random/virtio-rng.c | 15 +++--- drivers/char/virtio_console.c | 4 ++ drivers/misc/mic/card/mic_virtio.c | 6 +-- drivers/net/virtio_net.c | 44 +++++----------- drivers/s390/kvm/kvm_virtio.c | 9 +--- drivers/s390/kvm/virtio_ccw.c | 6 +-- drivers/scsi/virtio_scsi.c | 42 +++++++++------ drivers/virtio/virtio.c | 102 ++++++++++++++++++++++++++++++++++++ drivers/virtio/virtio_balloon.c | 2 + drivers/virtio/virtio_mmio.c | 7 +-- drivers/virtio/virtio_pci.c | 33 ++---------- net/9p/trans_virtio.c | 2 + 15 files changed, 206 insertions(+), 137 deletions(-)
Signature · 1 line
MST