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/
Home Products Support Community News


[Xen-devel] VPIO device model for Xen guests

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] VPIO device model for Xen guests
From: Sameer Niphadkar <dspn2012@xxxxxxxxx>
Date: Thu, 30 Apr 2009 11:57:34 -0400
Delivery-date: Thu, 30 Apr 2009 08:58:35 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=s4ts+rTh09owydLZFtfEteBj/M87SOYdB4wY65VamII=; b=pPzf3318dwf2Vl2ARQtYdHA8tVU2Hxk2tub+2aPb33YRdQLpLQPWTI4pINweuYem/W Gu21FoXg2KPHAeSIF8KxS5ZrcHfkCLT/xXE1YiOQxgaN2y/w4GBZr4GIepbZFrPJHu36 rY1y+7aYXailCANuTASTzQm9Zf3/Blv7X5kVI=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=Ykl3lVV3du1x8RRdYz+yTx6CAH2KQ95+U0PnfKEJKDhH7qaDiDFCaAMUt6c+b6ZzA5 tPM7dFcoNBlrkyU+qgTpOG92zXwsZVFP2WXe5TFJocq7pu5KWE9HADMVvytywnfZGoo8 G9rd9VD2IAaQlDue5mQ1CpScQ7hoDpZK7e1hM=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <6e28a01d0904271501g23308df3w3f35d45bc7d2e025@xxxxxxxxxxxxxx>
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <6e28a01d0904271501g23308df3w3f35d45bc7d2e025@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
I don't think..my mail was received - so resending it.

---------- Forwarded message ----------
From: Sameer Niphadkar <dspn2012@xxxxxxxxx>
Date: Mon, Apr 27, 2009 at 6:01 PM
Subject: VPIO device model for Xen guests
To: xen-devel@xxxxxxxxxxxxxxxxxxx

Hello all,

For our research we are trying to come up with a Virtual - passthrough
model of device drivers in  PV guests. We are looking for 2 separate
implementations : 1 for transmitting and the other for receiving the
packets in the guest OS. We are relying on IOMMU to ensure isolation.

We need to add  these new hypercalls for communication between the
guest device driver and the hypervisor. The guest device drivers use
these hypercalls to read the state of the current physical device and
also request the ownership of the device. We need following

HYPERVISOR_device_op, get device state. Before the device driver
accesses the device, it first issues this hypercall to check the state
of the device. The state could be “idle” or “busy”. “Idle” means no
other guest is currently using the device. “busy” means other guest is
using the device. We may use just one char or int value to denote the

Note: it might be better implement using shareinfo_page of Xen. Then
the performance will be better.

HYPERVISOR_device_op, grab the device. This should be called after the
device driver checked the state of the device, and the state is
“idle”. In this case, the guest device driver issues this hypercall to
actually grab the device. If the device is “busy” and the guest does
this hypercall, the return value should indicate an error. Also, there
may be multiple guest OSes trying to grab the device at the same time,
the hypervisor should then be fair to all of them.  It may also be
possible that “HYPERVISOR_device_op, get device state” returns “idle”
but “HYPERVISOR_device_op, grab the device” fails. This happens when
multiple guest OSes compete for the same device.

Note that the hypervisor should also maintain an ownership filed for
the device and the device driver should maintain a state to indicate
if it holds the device or not. Also, the implementation details for
the above hypercalls can be re-designed for easy implementation.

We also need an upcall to let the hypervisor notify the guest device
driver when it used up all its time slice. At that time, the upcall
tells the guest device driver that it should stop using the device.
The guest device driver should then stop the device  usage as soon as
possible. The hypervisor should keep a timeout for this operation. If
a malicious driver ignores this upcall, the hypervisor should
forcibly stop the current guest OS and context switch to another guest
OS. The current guest OS may lose some data or crash. This is more
desirable than letting one guest OS keeping the device forever to

It would be great to know if there are any such resembling Hypercalls
in use ? I was going through the macro defined Hypercalls in
 and xen/arch/x86/platform_hypercall.c but was not sure where to
begin..any pointers would be appreciated.



Xen-devel mailing list

<Prev in Thread] Current Thread [Next in Thread>