Re: [PATCH RFC 2/5] vringfd base/offset

2008-04-05 Thread Rusty Russell
On Sunday 06 April 2008 03:18:59 Anthony Liguori wrote: > Rusty Russell wrote: > > - if (unlikely(get_user(head, &vr->ring.avail->ring[head]) != 0)) > > + > > + if (unlikely(get_user(head, &vr->ring.avail->ring[vr->last_avail > > + % vr->ring.

Re: [PATCH RFC 1/5] vringfd syscall

2008-04-05 Thread Rusty Russell
On Sunday 06 April 2008 03:13:41 Anthony Liguori wrote: > > + void *buf = calloc(vring_size(256, getpagesize()), 0); > > Shouldn't this be calloc(1, vring_size(256, getpagesize()));? Heh, yes... spot the last minute change from malloc to calloc. > > + if (r != 0) > > + err(1, "poll

Re: [PATCH RFC 2/5] vringfd base/offset

2008-04-05 Thread Rusty Russell
On Saturday 05 April 2008 22:44:33 Avi Kivity wrote: > Rusty Russell wrote: > > It turns out the lguest (and possibly kvm) want the addresses in the > > ring buffer to only cover a certain part of memory, and be offset. > > > > > > +0xA

Re: [PATCH RFC 3/5] tun: vringfd receive support.

2008-04-05 Thread Anthony Liguori
Rusty Russell wrote: > This patch modifies tun to allow a vringfd to specify the receive > buffer. Because we can't copy to userspace in bh context, we queue > like normal then use the "pull" hook to actually do the copy. > > More thought needs to be put into the possible races with ring > regist

Re: [PATCH RFC 2/5] vringfd base/offset

2008-04-05 Thread Anthony Liguori
Rusty Russell wrote: > It turns out the lguest (and possibly kvm) want the addresses in the > ring buffer to only cover a certain part of memory, and be offset. > > It makes sense that this be an ioctl. > > Signed-off-by: Rusty Russell <[EMAIL PROTECTED]> > > @@ -208,12 +232,15 @@ int vring_ge

Re: [PATCH RFC 1/5] vringfd syscall

2008-04-05 Thread Anthony Liguori
Rusty Russell wrote: > For virtualization, we've developed virtio_ring for efficient communication. > This would also work well for userspace-kernel communication, particularly > for things like the tun device. By using the same ABI, we can join guests > to the host kernel trivially. > > These pa

Re: kernel BUG at drivers/virtio/virtio_ring.c:218!

2008-04-05 Thread Balaji Rao
On Friday 04 April 2008 01:46:21 pm Balaji Rao wrote: > Hi Rusty, > > I hit a bug in virtio_ring.c:218 when I was stressing virtio_net using kvm > with -smp 4. > > static void vring_disable_cb(struct virtqueue *_vq) > { > struct vring_virtqueue *vq = to_vvq(_vq); > > START_USE(v

Re: [PATCH RFC 2/5] vringfd base/offset

2008-04-05 Thread Avi Kivity
Rusty Russell wrote: > It turns out the lguest (and possibly kvm) want the addresses in the > ring buffer to only cover a certain part of memory, and be offset. > > > +0xAE 00-01 linux/vring.h > Another virtualization subs

[PATCH RFC 3/5] tun: vringfd receive support.

2008-04-05 Thread Rusty Russell
This patch modifies tun to allow a vringfd to specify the receive buffer. Because we can't copy to userspace in bh context, we queue like normal then use the "pull" hook to actually do the copy. More thought needs to be put into the possible races with ring registration and a simultaneous close,

[PATCH RFC 5/5] lguest support

2008-04-05 Thread Rusty Russell
This is how lguest uses the vringfd tun support. It needs more cleanup, but it seems to basically work. Signed-off-by: Rusty Russell <[EMAIL PROTECTED]> diff -r 6979348a6ece Documentation/lguest/lguest.c --- a/Documentation/lguest/lguest.c Sat Apr 05 22:02:28 2008 +1100 +++ b/Documentation/l

[PATCH RFC 1/5] vringfd syscall

2008-04-05 Thread Rusty Russell
For virtualization, we've developed virtio_ring for efficient communication. This would also work well for userspace-kernel communication, particularly for things like the tun device. By using the same ABI, we can join guests to the host kernel trivially. These patches are fairly alpha; I've seen

[PATCH RFC 4/5] tun: vringfd xmit support.

2008-04-05 Thread Rusty Russell
This patch modifies tun to allow a vringfd to specify the send buffer. The user does a write to push out packets from the buffer. Again, more thought needs to be put into the possible races with ring registration. Again we use the 'struct virtio_net_hdr' to allow userspace to send GSO packets.

[PATCH RFC 2/5] vringfd base/offset

2008-04-05 Thread Rusty Russell
It turns out the lguest (and possibly kvm) want the addresses in the ring buffer to only cover a certain part of memory, and be offset. It makes sense that this be an ioctl. Signed-off-by: Rusty Russell <[EMAIL PROTECTED]> diff -r 08fb00b8acab Documentation/ioctl-number.txt --- a/Documentation/i