[PATCH 1/5] virtio: document functions better.

2011-11-03 Thread Rusty Russell
The old documentation is left over from when we used a structure with strategy pointers. Signed-off-by: Rusty Russell --- include/linux/virtio.h | 130 - 1 file changed, 87 insertions(+), 43 deletions(-) diff --git a/include/linux/virtio.h b/incl

[PATCH 5 of 5] virtio: expose added descriptors immediately

2011-11-03 Thread Rusty Russell
A virtio driver does virtqueue_add_buf() multiple times before finally calling virtqueue_kick(); previously we only exposed the added buffers in the virtqueue_kick() call. This means we don't need a memory barrier in virtqueue_add_buf(), but it reduces concurrency as the device (ie. host) can't se

[PATCH 4 of 5] virtio: avoid modulus operation

2011-11-03 Thread Rusty Russell
Since we know vq->vring.num is a power of 2, modulus is lazy (it's asserted in vring_new_virtqueue()). Signed-off-by: Rusty Russell --- drivers/virtio/virtio_ring.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c --

[PATCH 2 of 5] virtio: rename virtqueue_add_buf_gfp to virtqueue_add_buf

2011-11-03 Thread Rusty Russell
Remove wrapper functions. This makes the allocation type explicit in all callers; I used GPF_KERNEL where it seemed obvious, left it at GFP_ATOMIC otherwise. Signed-off-by: Rusty Russell diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c --- a/drivers/block/virtio_blk.c +++ b/d

[PATCH 1 of 5] virtio: document functions better

2011-11-03 Thread Rusty Russell
The old documentation is left over from when we used a structure with strategy pointers. Signed-off-by: Rusty Russell --- include/linux/virtio.h | 130 - 1 file changed, 87 insertions(+), 43 deletions(-) diff --git a/include/linux/virtio.h b/incl

[PATCH 3 of 5] virtio: support unlocked queue kick

2011-11-03 Thread Rusty Russell
Based on patch by Christoph for virtio_blk speedup: Split virtqueue_kick to be able to do the actual notification outside the lock protecting the virtqueue. This patch was originally done by Stefan Hajnoczi, but I can't find the original one anymore and had to recr

Re: [PATCH 1 of 5] virtio: document functions better

2011-11-03 Thread Christoph Hellwig
On Thu, Nov 03, 2011 at 06:12:49PM +1030, Rusty Russell wrote: > The old documentation is left over from when we used a structure with > strategy pointers. Looks good, Reviewed-by: Christoph Hellwig ___ Virtualization mailing list Virtualization@lists.

Re: [PATCH 2 of 5] virtio: rename virtqueue_add_buf_gfp to virtqueue_add_buf

2011-11-03 Thread Christoph Hellwig
On Thu, Nov 03, 2011 at 06:12:50PM +1030, Rusty Russell wrote: > Remove wrapper functions. This makes the allocation type explicit in > all callers; I used GPF_KERNEL where it seemed obvious, left it at > GFP_ATOMIC otherwise. Looks good, Reviewed-by: Christoph Hellwig __

Re: [PATCH 3 of 5] virtio: support unlocked queue kick

2011-11-03 Thread Christoph Hellwig
On Thu, Nov 03, 2011 at 06:12:51PM +1030, Rusty Russell wrote: > Based on patch by Christoph for virtio_blk speedup: Please credit it to Stefan - he also sent a pointer to his original version in reply to the previous thread. Also shouldn't virtqueue_kick have kerneldoc comments? I also notices

[PATCH] virtio-balloon: Trivial cleanups

2011-11-03 Thread Sasha Levin
Trivial changes to remove forgotten junk, format comments, and correct names. Cc: Rusty Russell Cc: "Michael S. Tsirkin" Cc: virtualization@lists.linux-foundation.org Signed-off-by: Sasha Levin --- drivers/virtio/virtio_balloon.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)

Re: virtio-pci new configuration proposal

2011-11-03 Thread Sasha Levin
On Thu, 2011-11-03 at 12:28 +1030, Rusty Russell wrote: > On Wed, 02 Nov 2011 20:49:27 +0200, Sasha Levin > wrote: > > This is a proposal for a new layout of the virtio-pci config space. > > > > We will separate the current configuration into two: A virtio-pci common > > configuration and a dev

Re: [PATCH RFC] virtio-pci: flexible configuration layout

2011-11-03 Thread Michael S. Tsirkin
On Thu, Nov 03, 2011 at 02:19:03AM +0200, Sasha Levin wrote: > Hi Michael, > > On Thu, 2011-11-03 at 01:31 +0200, Michael S. Tsirkin wrote: > > Add a flexible mechanism to specify virtio configuration layout, using > > pci vendor-specific capability. A separate capability is used for each > > of

Re: [PATCH RFC] virtio-pci: flexible configuration layout

2011-11-03 Thread Avi Kivity
On 11/03/2011 01:31 AM, Michael S. Tsirkin wrote: > Add a flexible mechanism to specify virtio configuration layout, using > pci vendor-specific capability. A separate capability is used for each > of common, device specific and data-path accesses. > > How about posting the spec change instead of

Re: [PATCH 4 of 5] virtio: avoid modulus operation

2011-11-03 Thread Rusty Russell
On Thu, 3 Nov 2011 09:51:15 +0200, Pekka Enberg wrote: > On Thu, Nov 3, 2011 at 9:42 AM, Rusty Russell wrote: > > Since we know vq->vring.num is a power of 2, modulus is lazy (it's asserted > > in vring_new_virtqueue()). > > > > Signed-off-by: Rusty Russell > > --- > >  drivers/virtio/virtio_rin

Re: virtio-pci new configuration proposal

2011-11-03 Thread Michael S. Tsirkin
On Thu, Nov 03, 2011 at 12:28:46PM +1030, Rusty Russell wrote: > 3) If we're changing the queue layout, it's a chance to fix a >longstanding bug: let the guest notify the host of preferred >queue size and alignment. With device config split from the common one, we can just tuck new fields

Re: [PATCH] virtio-balloon: Trivial cleanups

2011-11-03 Thread Michael S. Tsirkin
On Thu, Nov 03, 2011 at 10:20:04AM +0200, Sasha Levin wrote: > Trivial changes to remove forgotten junk, format comments, and correct names. > > Cc: Rusty Russell > Cc: "Michael S. Tsirkin" > Cc: virtualization@lists.linux-foundation.org > Signed-off-by: Sasha Levin Acked-by: Michael S. Tsirki

Re: [PATCH RFC] virtio-pci: flexible configuration layout

2011-11-03 Thread Sasha Levin
On Thu, 2011-11-03 at 12:33 +0200, Michael S. Tsirkin wrote: > On Thu, Nov 03, 2011 at 02:19:03AM +0200, Sasha Levin wrote: > > Hi Michael, > > > > On Thu, 2011-11-03 at 01:31 +0200, Michael S. Tsirkin wrote: > > > Add a flexible mechanism to specify virtio configuration layout, using > > > pci ve

Re: [PATCH RFC] virtio-pci: flexible configuration layout

2011-11-03 Thread Michael S. Tsirkin
On Thu, Nov 03, 2011 at 01:09:51PM +0200, Sasha Levin wrote: > On Thu, 2011-11-03 at 12:33 +0200, Michael S. Tsirkin wrote: > > On Thu, Nov 03, 2011 at 02:19:03AM +0200, Sasha Levin wrote: > > > Hi Michael, > > > > > > On Thu, 2011-11-03 at 01:31 +0200, Michael S. Tsirkin wrote: > > > > Add a flex

Re: [PATCH (repost) RFC 2/2] virtio-pci: recall and return msix notifications on ISR read

2011-11-03 Thread Jan Kiszka
On 2011-11-02 21:11, Michael S. Tsirkin wrote: > MSIX spec requires that device can be operated with > all vectors masked, by polling pending bits. > Add APIs to recall an msix notification, and make polling > mode possible in virtio-pci by clearing the > pending bits and setting ISR appropriately

Re: [PATCH (repost) RFC 2/2] virtio-pci: recall and return msix notifications on ISR read

2011-11-03 Thread Michael S. Tsirkin
On Thu, Nov 03, 2011 at 12:42:55PM +0100, Jan Kiszka wrote: > On 2011-11-02 21:11, Michael S. Tsirkin wrote: > > MSIX spec requires that device can be operated with > > all vectors masked, by polling pending bits. > > Add APIs to recall an msix notification, and make polling > > mode possible in vi

Re: [PATCH RFC] virtio-pci: flexible configuration layout

2011-11-03 Thread Michael S. Tsirkin
On Thu, Nov 03, 2011 at 12:37:04PM +0200, Avi Kivity wrote: > On 11/03/2011 01:31 AM, Michael S. Tsirkin wrote: > > Add a flexible mechanism to specify virtio configuration layout, using > > pci vendor-specific capability. A separate capability is used for each > > of common, device specific and d

Re: [PATCH] VirtioConsole support.

2011-11-03 Thread Christian Borntraeger
On 02/11/11 23:02, Rusty Russell wrote: > Ben, Christian, can you figure out what's going on? Is it time for a > complete rewrite? You are talking about hvc console? Yes it has so many users that it is now something like a console/tty layer extension, but it was never designed to be one. I thin

Re: virtio-pci new configuration proposal

2011-11-03 Thread Michael S. Tsirkin
On Thu, Nov 03, 2011 at 10:33:23AM +0200, Sasha Levin wrote: > On Thu, 2011-11-03 at 12:28 +1030, Rusty Russell wrote: > > On Wed, 02 Nov 2011 20:49:27 +0200, Sasha Levin > > wrote: > > > This is a proposal for a new layout of the virtio-pci config space. > > > > > > We will separate the curren

Re: virtio-pci new configuration proposal

2011-11-03 Thread Sasha Levin
On Thu, 2011-11-03 at 14:46 +0200, Michael S. Tsirkin wrote: > On Thu, Nov 03, 2011 at 10:33:23AM +0200, Sasha Levin wrote: > > On Thu, 2011-11-03 at 12:28 +1030, Rusty Russell wrote: > > > On Wed, 02 Nov 2011 20:49:27 +0200, Sasha Levin > > > wrote: > > > > This is a proposal for a new layout o

Re: [PATCH RFC] virtio-pci: flexible configuration layout

2011-11-03 Thread Michael S. Tsirkin
> 2. Move device specific features into the device specific region. > Currently the features field is a mix between virtio-pci and device > specific features. A single feature field with bits partitioned to transport specific and device specific fields is a generic virtio thing. So there's relativ

Re: [PATCH RFC] virtio-pci: flexible configuration layout

2011-11-03 Thread Avi Kivity
On 11/03/2011 02:11 PM, Michael S. Tsirkin wrote: > On Thu, Nov 03, 2011 at 12:37:04PM +0200, Avi Kivity wrote: > > On 11/03/2011 01:31 AM, Michael S. Tsirkin wrote: > > > Add a flexible mechanism to specify virtio configuration layout, using > > > pci vendor-specific capability. A separate capabi

Re: virtio-pci new configuration proposal

2011-11-03 Thread Michael S. Tsirkin
On Thu, Nov 03, 2011 at 03:19:01PM +0200, Sasha Levin wrote: > On Thu, 2011-11-03 at 14:46 +0200, Michael S. Tsirkin wrote: > > On Thu, Nov 03, 2011 at 10:33:23AM +0200, Sasha Levin wrote: > > > On Thu, 2011-11-03 at 12:28 +1030, Rusty Russell wrote: > > > > On Wed, 02 Nov 2011 20:49:27 +0200, Sas

Re: [PATCH RFC] virtio-pci: flexible configuration layout

2011-11-03 Thread Michael S. Tsirkin
On Thu, Nov 03, 2011 at 03:37:42PM +0200, Avi Kivity wrote: > On 11/03/2011 02:11 PM, Michael S. Tsirkin wrote: > > On Thu, Nov 03, 2011 at 12:37:04PM +0200, Avi Kivity wrote: > > > On 11/03/2011 01:31 AM, Michael S. Tsirkin wrote: > > > > Add a flexible mechanism to specify virtio configuration la

Re: [PATCH] VirtioConsole support.

2011-11-03 Thread Konrad Rzeszutek Wilk
On Thu, Nov 03, 2011 at 01:38:15PM +0100, Christian Borntraeger wrote: > On 02/11/11 23:02, Rusty Russell wrote: > > Ben, Christian, can you figure out what's going on? Is it time for a > > complete rewrite? > > You are talking about hvc console? Yes it has so many users that it is now > somethin

Re: [Qemu-devel] [PATCH] virtio: Add PCI memory BAR in addition to PIO BAR

2011-11-03 Thread Michael S. Tsirkin
On Thu, Nov 03, 2011 at 08:49:31AM -0500, Anthony Liguori wrote: > On 11/03/2011 08:45 AM, Avi Kivity wrote: > >On 11/03/2011 03:38 PM, Anthony Liguori wrote: > >>> > We could use a better agreement on the processor for making virtio > changes. Should it go (1) virtio spec (2) kernel (3) qe

Re: [Qemu-devel] [PATCH] virtio: Add PCI memory BAR in addition to PIO BAR

2011-11-03 Thread Anthony Liguori
On 11/03/2011 09:31 AM, Michael S. Tsirkin wrote: On Thu, Nov 03, 2011 at 08:49:31AM -0500, Anthony Liguori wrote: On 11/03/2011 08:45 AM, Avi Kivity wrote: On 11/03/2011 03:38 PM, Anthony Liguori wrote: We could use a better agreement on the processor for making virtio changes. Should it go

Re: [Qemu-devel] [PATCH] virtio: Add PCI memory BAR in addition to PIO BAR

2011-11-03 Thread Avi Kivity
On 11/03/2011 04:37 PM, Anthony Liguori wrote: > >> 2. Proposed spec patch, kernel change, qemu change >> 3. Buy-ins from spec maintainer, kernel driver maintainer, qemu >> device >> maintainer (only regarding the ABI, not the code) > > I don't think this is how it's working

Re: [PATCH RFC] virtio-pci: flexible configuration layout

2011-11-03 Thread Jesse Barnes
On Thu, 3 Nov 2011 01:31:11 +0200 "Michael S. Tsirkin" wrote: > Add a flexible mechanism to specify virtio configuration layout, using > pci vendor-specific capability. A separate capability is used for each > of common, device specific and data-path accesses. > > Warning: compiled only. > This

Re: [PATCH (repost) RFC 2/2] virtio-pci: recall and return msix notifications on ISR read

2011-11-03 Thread Jan Kiszka
On 2011-11-03 13:07, Michael S. Tsirkin wrote: > On Thu, Nov 03, 2011 at 12:42:55PM +0100, Jan Kiszka wrote: >> On 2011-11-02 21:11, Michael S. Tsirkin wrote: >>> MSIX spec requires that device can be operated with >>> all vectors masked, by polling pending bits. >>> Add APIs to recall an msix noti