Re: [Qemu-devel] [PATCH 0/2] virtio: reset all qbuses too when writing to the status field

2012-12-17 Thread Paolo Bonzini
Il 16/12/2012 22:15, Michael S. Tsirkin ha scritto: A PCI bus reset (or FLR) calls pci_device_reset which does this void pci_device_reset(PCIDevice *dev) { int r; qdev_reset_all(dev-qdev); ... } This is exactly how a PCI bus reset clears pending MSIX vectors. Paolo Yes

Re: [Qemu-devel] [PATCH 0/2] virtio: reset all qbuses too when writing to the status field

2012-12-17 Thread Michael S. Tsirkin
On Sun, Dec 16, 2012 at 08:31:16PM +0100, Paolo Bonzini wrote: Il 16/12/2012 18:04, Michael S. Tsirkin ha scritto: On Thu, Dec 13, 2012 at 09:54:23AM +0100, Paolo Bonzini wrote: Il 12/12/2012 22:27, Michael S. Tsirkin ha scritto: Maybe it's obvious to you that qdev_reset_all(x) does a

Re: [Qemu-devel] [PATCH 0/2] virtio: reset all qbuses too when writing to the status field

2012-12-17 Thread Paolo Bonzini
Il 17/12/2012 11:40, Michael S. Tsirkin ha scritto: How about the following? Then we can put reset in generic code where it belongs. It's untested - really kind of pseudo code - and s390 is still to be updated. Posting to see what does everyone thinks. I'm not (yet) sure how that helps my

Re: [Qemu-devel] [PATCH 0/2] virtio: reset all qbuses too when writing to the status field

2012-12-17 Thread Michael S. Tsirkin
On Mon, Dec 17, 2012 at 04:14:00PM +0100, Paolo Bonzini wrote: Il 17/12/2012 11:40, Michael S. Tsirkin ha scritto: How about the following? Then we can put reset in generic code where it belongs. It's untested - really kind of pseudo code - and s390 is still to be updated. Posting to

Re: [Qemu-devel] [PATCH 0/2] virtio: reset all qbuses too when writing to the status field

2012-12-17 Thread Paolo Bonzini
Il 17/12/2012 16:24, Michael S. Tsirkin ha scritto: On Mon, Dec 17, 2012 at 04:14:00PM +0100, Paolo Bonzini wrote: Il 17/12/2012 11:40, Michael S. Tsirkin ha scritto: How about the following? Then we can put reset in generic code where it belongs. It's untested - really kind of pseudo code -

Re: [Qemu-devel] [PATCH 0/2] virtio: reset all qbuses too when writing to the status field

2012-12-17 Thread Michael S. Tsirkin
On Mon, Dec 17, 2012 at 04:37:36PM +0100, Paolo Bonzini wrote: Il 17/12/2012 16:24, Michael S. Tsirkin ha scritto: On Mon, Dec 17, 2012 at 04:14:00PM +0100, Paolo Bonzini wrote: Il 17/12/2012 11:40, Michael S. Tsirkin ha scritto: How about the following? Then we can put reset in generic

Re: [Qemu-devel] [PATCH 0/2] virtio: reset all qbuses too when writing to the status field

2012-12-17 Thread Paolo Bonzini
Il 17/12/2012 17:01, Michael S. Tsirkin ha scritto: On Mon, Dec 17, 2012 at 04:37:36PM +0100, Paolo Bonzini wrote: Il 17/12/2012 16:24, Michael S. Tsirkin ha scritto: On Mon, Dec 17, 2012 at 04:14:00PM +0100, Paolo Bonzini wrote: Il 17/12/2012 11:40, Michael S. Tsirkin ha scritto: How about

Re: [Qemu-devel] [PATCH 0/2] virtio: reset all qbuses too when writing to the status field

2012-12-16 Thread Michael S. Tsirkin
On Thu, Dec 13, 2012 at 09:54:23AM +0100, Paolo Bonzini wrote: Il 12/12/2012 22:27, Michael S. Tsirkin ha scritto: Maybe it's obvious to you that qdev_reset_all(x) does a soft reset and what soft reset means for each bus type We can define soft reset to be *independent* of the bus type.

Re: [Qemu-devel] [PATCH 0/2] virtio: reset all qbuses too when writing to the status field

2012-12-16 Thread Paolo Bonzini
Il 16/12/2012 18:04, Michael S. Tsirkin ha scritto: On Thu, Dec 13, 2012 at 09:54:23AM +0100, Paolo Bonzini wrote: Il 12/12/2012 22:27, Michael S. Tsirkin ha scritto: Maybe it's obvious to you that qdev_reset_all(x) does a soft reset and what soft reset means for each bus type We can define

Re: [Qemu-devel] [PATCH 0/2] virtio: reset all qbuses too when writing to the status field

2012-12-16 Thread Michael S. Tsirkin
On Sun, Dec 16, 2012 at 08:31:16PM +0100, Paolo Bonzini wrote: Il 16/12/2012 18:04, Michael S. Tsirkin ha scritto: On Thu, Dec 13, 2012 at 09:54:23AM +0100, Paolo Bonzini wrote: Il 12/12/2012 22:27, Michael S. Tsirkin ha scritto: Maybe it's obvious to you that qdev_reset_all(x) does a

Re: [Qemu-devel] [PATCH 0/2] virtio: reset all qbuses too when writing to the status field

2012-12-13 Thread Paolo Bonzini
Il 12/12/2012 22:27, Michael S. Tsirkin ha scritto: Maybe it's obvious to you that qdev_reset_all(x) does a soft reset and what soft reset means for each bus type We can define soft reset to be *independent* of the bus type. As you said, you access it with a device register. I think qemu

[Qemu-devel] [PATCH 0/2] virtio: reset all qbuses too when writing to the status field

2012-12-12 Thread Paolo Bonzini
virtio devices are not performing a full reset when zero is written to the status field, because the reset does not propagate down the qdev bus hierarchy. These patches fix this problem by calling qdev_reset_all when zero is written to the status field. Paolo Bonzini (2): virtio-pci: reset all

Re: [Qemu-devel] [PATCH 0/2] virtio: reset all qbuses too when writing to the status field

2012-12-12 Thread Michael S. Tsirkin
On Wed, Dec 12, 2012 at 03:26:34PM +0100, Paolo Bonzini wrote: virtio devices are not performing a full reset when zero is written to the status field, because the reset does not propagate down the qdev bus hierarchy. These patches fix this problem by calling qdev_reset_all when zero is

Re: [Qemu-devel] [PATCH 0/2] virtio: reset all qbuses too when writing to the status field

2012-12-12 Thread Michael S. Tsirkin
On Wed, Dec 12, 2012 at 05:38:21PM +0100, Paolo Bonzini wrote: Il 12/12/2012 16:38, Michael S. Tsirkin ha scritto: These patches fix this problem by calling qdev_reset_all when zero is written to the status field. Looks like this is a virtio-scsi thing - others don't have a hierarchy.

Re: [Qemu-devel] [PATCH 0/2] virtio: reset all qbuses too when writing to the status field

2012-12-12 Thread Paolo Bonzini
Il 12/12/2012 16:38, Michael S. Tsirkin ha scritto: These patches fix this problem by calling qdev_reset_all when zero is written to the status field. Looks like this is a virtio-scsi thing - others don't have a hierarchy. virtio-serial does, and is doing the same walk manually. Let's just