Skip to content

RFC virtio: Support for hibernation (S4)

Amit Shah virtualization 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest8 patches 10 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8virtio: pci: switch to new PM APIdrivers/virtio/virtio_pci.c+13 -40 replies
2/8virtio-pci: add PM notification handlers for restore, freeze, thaw, poweroffdrivers/virtio/virtio_pci.c include/linux/virtio.h+38 -00 replies
3/8virtio-pci: save/restore config space across S4drivers/virtio/virtio_pci.c+6 -02 replies
4/8virtio: console: Ignore port name update request if name already setdrivers/char/virtio_console.c+7 -03 replies
5/8virtio: console: Use wait_event_freezable instead of _interruptibledrivers/char/virtio_console.c+5 -40 replies
6/8virtio: console: Add freeze and restore handlers to support S4drivers/char/virtio_console.c+71 -00 replies
7/8virtio: block: Add freeze, restore handlers to support S4drivers/block/virtio_blk.c+24 -00 replies
8/8virtio: net: Add freeze, restore handlers to support S4drivers/net/virtio_net.c+51 -04 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/8] virtio: Support for hibernation (S4)

Hello,

These patches are an initial attempt at supporting hibernation for virtio drivers.

The default configuration of event_index=on doesn't work; i.e. restore from a hibernated image only works if the devices have event_index support turned off. I have not yet dug into this, but is most likely due to some state not being sync'ed. This could be related to the hack that is patch 3.

Each virtio driver has to be modified to add support for the freeze/restore callbacks to delete and then re-add the vqs just before and after hibernation.

Testing:

I've not tested S3 (suspend).

For virtio-net, ping continues working across hibernate (lost one packet in sole testing).

For virtio-blk, disk activity continues working.

For virtio-console, port IO continues working.

Amit Shah (8):
virtio: pci: switch to new PM API
virtio-pci: add PM notification handlers for restore, freeze, thaw,
poweroff
virtio-pci: save/restore config space across S4
virtio: console: Ignore port name update request if name already set
virtio: console: Use wait_event_freezable instead of _interruptible
virtio: console: Add freeze and restore handlers to support S4
virtio: block: Add freeze, restore handlers to support S4
virtio: net: Add freeze, restore handlers to support S4

 drivers/block/virtio_blk.c    |   24 +++++++++++
 drivers/char/virtio_console.c |   87 +++++++++++++++++++++++++++++++++++++++--
 drivers/net/virtio_net.c      |   51 ++++++++++++++++++++++++
 drivers/virtio/virtio_pci.c   |   57 +++++++++++++++++++++++++--
 include/linux/virtio.h        |    4 ++
 5 files changed, 215 insertions(+), 8 deletions(-)
Signature · 1 line
1.7.6