Skip to contentSkip to conversation

virtio and lguest

GIT PULL Rusty Russell 3 participants 4 messages Jan 12, 2012 – Jan 13, 2012 virtio core

lore
Share & tools
lore
#0 lore raw

(I called the tag to-linus. I think it worked).

To [email protected]:rustyrussell/linux.git
+ 3ed0016...b6c96c0 master -> master (forced update)
+ 815645d...f8e8df5 to-linus -> to-linus (forced update)
+ git request-pull remotes/origin/master git://github.com/rustyrussell/linux.git
The following changes since commit e343a895a9f342f239c5e3c5ffc6c0b1707e6244:

Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost (2012-01-10 18:04:27 -0800)

are available in the git repository at:

git://github.com/rustyrussell/linux.git master

Amit Shah (12):
virtio: pci: switch to new PM API
virtio: pci: add PM notification handlers for restore, freeze, thaw, poweroff
virtio: console: Move vq and vq buf removal into separate functions
virtio: console: Add freeze and restore handlers to support S4
virtio: console: Disable callbacks for virtqueues at start of S4 freeze
virtio: blk: Move vq initialization to separate function
virtio: blk: Add freeze, restore handlers to support S4
virtio: net: Move vq initialization into separate function
virtio: net: Move vq and vq buf removal into separate function
virtio: net: Add freeze, restore handlers to support S4
virtio: balloon: Move vq initialization into separate function
virtio: balloon: Add freeze, restore handlers to support S4

Davidlohr Bueso (1):
lguest: move the lguest tool to the tools directory

Jacek Galowicz (1):
lguest: switch segment-voodoo-numbers to readable symbols

Michael S. Tsirkin (1):
virtio_blk: fix config handler race

Rusty Russell (7):
virtio: harsher barriers for rpmsg.
virtio: document functions better.
virtio: rename virtqueue_add_buf_gfp to virtqueue_add_buf
virtio: support unlocked queue kick
virtio: avoid modulus operation.
virtio: expose added descriptors immediately.
virtio: add debugging if driver doesn't kick.

Sasha Levin (1):
virtio-balloon: Trivial cleanups

Stratos Psomadakis (1):
lguest: Make sure interrupt is allocated ok by lguest_setup_irq

 arch/x86/lguest/boot.c                             |   21 +-
 drivers/block/virtio_blk.c                         |   87 +++++++-
 drivers/char/hw_random/virtio-rng.c                |    2 +-
 drivers/char/virtio_console.c                      |  140 +++++++++---
 drivers/lguest/Makefile                            |    2 +-
 drivers/lguest/lguest_device.c                     |   18 +-
 drivers/lguest/segments.c                          |   28 ++-
 drivers/net/virtio_net.c                           |  125 ++++++++---
 drivers/s390/kvm/kvm_virtio.c                      |    2 +-
 drivers/virtio/virtio_balloon.c                    |  108 +++++++--
 drivers/virtio/virtio_mmio.c                       |    4 +-
 drivers/virtio/virtio_pci.c                        |  110 +++++++++-
 drivers/virtio/virtio_ring.c                       |  245 +++++++++++++++++---
 include/linux/virtio.h                             |   75 ++-----
 include/linux/virtio_ring.h                        |    1 +
 net/9p/trans_virtio.c                              |    6 +-
 {Documentation/virtual => tools}/lguest/.gitignore |    0
 {Documentation/virtual => tools}/lguest/Makefile   |    0
 {Documentation/virtual => tools}/lguest/extract    |    0
 {Documentation/virtual => tools}/lguest/lguest.c   |    2 +-
 {Documentation/virtual => tools}/lguest/lguest.txt |    0
 tools/virtio/linux/virtio.h                        |   22 +--
 tools/virtio/virtio_test.c                         |    6 +-
 23 files changed, 757 insertions(+), 247 deletions(-)
 rename {Documentation/virtual => tools}/lguest/.gitignore (100%)
 rename {Documentation/virtual => tools}/lguest/Makefile (100%)
 rename {Documentation/virtual => tools}/lguest/extract (100%)
 rename {Documentation/virtual => tools}/lguest/lguest.c (99%)
 rename {Documentation/virtual => tools}/lguest/lguest.txt (100%)
#1 lore raw
Quoted 3 lines · Rusty Russell

Amit Shah (12):
     virtio: pci: switch to new PM API

Hmm. Afaik, this is broken, or at least not complete.

Sure, it switches to the new PM API, but it still does the PCI ops itself.

It should not need to - the PCI layer will do the power state and standard PCI device state saving. And setting the PCI_D3hot state when shared interrupts can still happen at suspend time is just a bad idea.

So I think you're doing extra work and introducing bugs by doing so - the default PCI bus operations should already do all you do, just do it better. And then you can use the SIMPLE_DEV_PM_OPS() to build the dev_pm_ops structure and get all the normal cases right automatically.

I don't know if there is any particularly good example of this, but you can see some of the network drivers for examples of this. Notice how they don't need to worry about PCI power states etc at all, they just need to worry about the actual chip suspend/resume (and for a network driver, you'd do the netif_device_detach/netif_device_attach etc)

Linus

#2 lore raw
Quoted 18 lines · Linus Torvalds
Quoted 3 lines · Rusty Russell

Amit Shah (12):
     virtio: pci: switch to new PM API

Hmm. Afaik, this is broken, or at least not complete.

Sure, it switches to the new PM API, but it still does the PCI ops itself.

It should not need to - the PCI layer will do the power state and standard PCI device state saving. And setting the PCI_D3hot state when shared interrupts can still happen at suspend time is just a bad idea.

So I think you're doing extra work and introducing bugs by doing so - the default PCI bus operations should already do all you do, just do it better. And then you can use the SIMPLE_DEV_PM_OPS() to build the dev_pm_ops structure and get all the normal cases right automatically.

Quoted 6 lines

I don't know if there is any particularly good example of this, but you can see some of the network drivers for examples of this. Notice how they don't need to worry about PCI power states etc at all, they just need to worry about the actual chip suspend/resume (and for a network driver, you'd do the netif_device_detach/netif_device_attach etc)

Ok, I'll confess complete ignorance, and wait for Amit to respond. I must admit that PM for virtual devices is not a personal priority...

Thanks,
Rusty.
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

#3 lore raw
In reply to Linus Torvalds

Hi,

Quoted 5 lines · Linus Torvalds
Quoted 3 lines · Rusty Russell

Amit Shah (12):
     virtio: pci: switch to new PM API

Quoted 7 lines

Hmm. Afaik, this is broken, or at least not complete.

Sure, it switches to the new PM API, but it still does the PCI ops itself.

It should not need to - the PCI layer will do the power state and standard PCI device state saving. And setting the PCI_D3hot state when shared interrupts can still happen at suspend time is just a bad idea.

The idea behind this patchset is to get S4 working properly. There's no change to the way S3 was/is being done, and the state-setting is done only in the S3 PM callbacks.

Quoted 2 lines

So I think you're doing extra work and introducing bugs by doing so - the default PCI bus operations should already do all you do, just do

For S4, we need some driver-specific (not just virtio-specific) work to be done on the freeze/restore callbacks...

Quoted 2 lines

it better. And then you can use the SIMPLE_DEV_PM_OPS() to build the dev_pm_ops structure and get all the normal cases right automatically.

... and we also have separate stuff to be done in thaw/restore/freeze callbacks for different drivers. So using the *_PM_OPS() macros wouldn't have worked.

Quoted 6 lines

I don't know if there is any particularly good example of this, but you can see some of the network drivers for examples of this. Notice how they don't need to worry about PCI power states etc at all, they just need to worry about the actual chip suspend/resume (and for a network driver, you'd do the netif_device_detach/netif_device_attach etc)

I think your concern is with the way S3 is being done, and I volunteer to look at improving the situation there. Might take a while, though.

Amit