virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 00/25] virtio: fix spec compliance issues
@ 2014-10-12 11:46 Michael S. Tsirkin
  2014-10-12 11:46 ` [PATCH v3 01/25] virtio_pci: fix virtio spec compliance on restore Michael S. Tsirkin
                   ` (24 more replies)
  0 siblings, 25 replies; 28+ messages in thread
From: Michael S. Tsirkin @ 2014-10-12 11:46 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-s390, kvm, linux-scsi, Christian Borntraeger, netdev,
	virtualization, Paolo Bonzini, Amit Shah, v9fs-developer,
	David S. Miller

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(-)

-- 
MST

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2014-10-13  7:35 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-12 11:46 [PATCH v3 00/25] virtio: fix spec compliance issues Michael S. Tsirkin
2014-10-12 11:46 ` [PATCH v3 01/25] virtio_pci: fix virtio spec compliance on restore Michael S. Tsirkin
2014-10-12 11:46 ` [PATCH v3 02/25] virtio: unify config_changed handling Michael S. Tsirkin
2014-10-12 11:46 ` [PATCH v3 03/25] virtio-pci: move freeze/restore to virtio core Michael S. Tsirkin
2014-10-12 11:46 ` [PATCH v3 04/25] virtio: defer config changed notifications Michael S. Tsirkin
2014-10-12 11:46 ` [PATCH v3 05/25] virtio_blk: drop config_enable Michael S. Tsirkin
2014-10-12 11:46 ` [PATCH v3 06/25] virtio-blk: drop config_mutex Michael S. Tsirkin
2014-10-12 11:47 ` [PATCH v3 07/25] virtio_net: drop config_enable Michael S. Tsirkin
2014-10-12 11:47 ` [PATCH v3 08/25] virtio-net: drop config_mutex Michael S. Tsirkin
2014-10-12 11:47 ` [PATCH v3 09/25] virtio_net: minor cleanup Michael S. Tsirkin
2014-10-12 11:47 ` [PATCH v3 10/25] virtio: add API to enable VQs early Michael S. Tsirkin
2014-10-13  6:52   ` Rusty Russell
2014-10-13  7:35     ` Michael S. Tsirkin
2014-10-12 11:47 ` [PATCH v3 11/25] virtio_net: " Michael S. Tsirkin
2014-10-12 11:47 ` [PATCH v3 12/25] virtio_blk: " Michael S. Tsirkin
2014-10-12 11:47 ` [PATCH v3 13/25] virtio_console: " Michael S. Tsirkin
2014-10-12 11:47 ` [PATCH v3 14/25] 9p/trans_virtio: " Michael S. Tsirkin
2014-10-12 11:47 ` [PATCH v3 15/25] virtio_net: fix use after free on allocation failure Michael S. Tsirkin
2014-10-12 11:47 ` [PATCH v3 16/25] virtio_scsi: move kick event out from virtscsi_init Michael S. Tsirkin
2014-10-12 11:47 ` [PATCH v3 17/25] virtio_blk: enable VQs early on restore Michael S. Tsirkin
2014-10-12 11:48 ` [PATCH v3 18/25] virtio_scsi: " Michael S. Tsirkin
2014-10-12 11:48 ` [PATCH v3 19/25] virtio_console: " Michael S. Tsirkin
2014-10-12 11:48 ` [PATCH v3 20/25] virtio_net: " Michael S. Tsirkin
2014-10-12 11:48 ` [PATCH v3 21/25] virito_scsi: use freezable WQ for events Michael S. Tsirkin
2014-10-12 11:48 ` [PATCH v3 22/25] virtio_scsi: fix race on device removal Michael S. Tsirkin
2014-10-12 11:48 ` [PATCH v3 23/25] virtio_balloon: enable VQs early on restore Michael S. Tsirkin
2014-10-12 11:48 ` [PATCH v3 24/25] virtio_scsi: drop scan callback Michael S. Tsirkin
2014-10-12 11:48 ` [PATCH v3 25/25] virtio-rng: refactor probe error handling Michael S. Tsirkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).