WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH RFC 0/3] Virtio draft II

To: virtualization <virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH RFC 0/3] Virtio draft II
From: Rusty Russell <rusty@xxxxxxxxxxxxxxx>
Date: Thu, 07 Jun 2007 22:02:41 +1000
Cc: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>, Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx>, Xen Mailing List <xen-devel@xxxxxxxxxxxxxxxxxxx>, "jmk@xxxxxxxxxxxxxxxxxxx" <jmk@xxxxxxxxxxxxxxxxxxx>, Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>, kvm-devel <kvm-devel@xxxxxxxxxxxxxxxxxxxxx>, Avi Kivity <avi@xxxxxxxxxxxx>, Christian Borntraeger <cborntra@xxxxxxxxxx>, Latchesar Ionkov <lionkov@xxxxxxxx>, Suzanne McIntosh <skranjac@xxxxxxxxxx>, Martin Schwidefsky <schwidefsky@xxxxxxxxxx>
Delivery-date: Thu, 07 Jun 2007 05:01:53 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi again all,

        It turns out that networking really wants ordered requests, which the
previous patches didn't allow.  This patch changes it to a callback
mechanism; kudos to Avi.

        The downside is that locking is more complicated, and after a few dead
ends I implemented the simplest solution: the struct virtio_device
contains the spinlock to use, and it's held when your callbacks get
called.

Core changes:
1) struct virtio_device has a "lock" and "priv" fields (the latter for
the driver to use, esp from callbacks).
2) add_outbuf and add_inbuf take a cb function ptr and void *, rather
than a used pointer.
3) lengths of buffers must now fit in an unsigned int, not long.
4) the virtio_sync wrapper is gone.

Block driver changes (+30 lines)
1) Convert to callbacks not interrupt.
2) Ensure both outbuf & inbuf have been used up before finishing
request.  This avoids potential remote access to freed memory.

Net driver changes (+6 lines)
1) Convert to callbacks.
2) Store id in skb->cb, not array.
3) Remove NET_BUFS limit: we queue packets until virtio chokes.
4) Locking should now be correct, thanks mainly to virtio changes.

BTW, the lguest implementations (very rough) are in the lguest patch
repo for your viewing pleasure:

Implementation over dumb read/write interface:
http://lguest.ozlabs.org/patches/?file/tip/new-io-lguest-readwrite.patch
Implementation using descriptors (assuming host can access guest mem):
http://lguest.ozlabs.org/patches/?file/tip/new-io-lguest-desc.patch

Cheers,
Rusty.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel