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

Re: [Xen-devel] questions about xen device pass-through.

To: Jean Guyader <jean.guyader@xxxxxxxxx>
Subject: Re: [Xen-devel] questions about xen device pass-through.
From: Dushmanta Mohapatra <dushmanta.mohapatra@xxxxxxxxx>
Date: Tue, 23 Aug 2011 18:02:49 -0400
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 23 Aug 2011 15:07:17 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=pm32VTINtEikydjWXNh4QHzsJkjNXawW2j9OBLv+INk=; b=OlUXnz272AxbWteJEaGRhegwprGtFaW8sRNukD7fcbFhPvY9sqrxpjDL6emHBweFbg T3r7CzqFchShtIlMWXdqxyvDk3AT373lTUt6CVpk1JYi67lKspNBHmicPnXf5YtaTvkd 4gl+ldQpHgVHpDrja4EwuqN8bBpLDovP33Q8E=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <CAEBdQ938-rSaivUn6CnNwhEwV_7VqtdE_T1EmDoqLfpRku7jBg@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: <CA+PhxFd5Svh-KWNw2X23XRSZnZ8cOE3FWzoWBBw64uOV2e_-wA@xxxxxxxxxxxxxx> <CAEBdQ938-rSaivUn6CnNwhEwV_7VqtdE_T1EmDoqLfpRku7jBg@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thanks Jean.I got it resolved.

But now I am facing an issue at the next step. After I assign the device back to Dom0,
there is an issue in DomU reverting back to the virtual mode.

Initially I start an Windows 7 HVM DomU and give it virtualized access to various devices.
After that I unbind some devices (Ethernet in this case), assign them to pciback  and attach them to DomU (using xm pci-attach). At this stage DomU recognizes the hotplugging and I get passthrough IO. Afterwards I detach the device from DomU (using xm pci-detach). At this stage the device gets assigned to pciback. So I unbind it from pciback and bind the device back to Dom0 using sysfs mechanisms. So Dom0 gets direct access to the device. Dom0 network works fine after this.

But after this DomU does not revert back to the virtual interface it was using earlier. In case of ethernet, I can still see a vif1.0 interface if I do a ifconfig in Dom0. But there is no network access in DomU. I tried to reconfigure the network/connection etc. inside Windows7 DomU, but could not get it working.

Please tell me I am missing some thing or should be doing it some other way.  
Let me know if I need to give some more information.

(I am just testing for ethernet right now..I am planning to try this for other kinds of devices also like VGA,USB, Wireless etc.)
 
Thanks,
Dushmanta


On Wed, Aug 17, 2011 at 6:27 PM, Jean Guyader <jean.guyader@xxxxxxxxx> wrote:
On 17 August 2011 20:55, Dushmanta Mohapatra
<dushmanta.mohapatra@xxxxxxxxx> wrote:
> Hello,
>
> I have some doubts/questions regarding device passthrough support in Xen.
> I will really appreciate some help/suggestions.
>
> (I am using a Intel Core i5 vPro based Lenovo thinkpad T520 (Intel graphics
> adapter).
> I am running Xen 4.1.1 and PVOPS based Linux 2.6.32.41 kernel as Dom0. I use
> Windows XP
> and Windows 7 as my HVM Domus. lspci details are attached.)
>
> I am trying to achieve the following: Initially allow
> direct access to the primary devices (graphics/ethernet/wireless/USB) to an
> HVM DomU. After wards,
> depending on the need I want to re-assign the direct access of these devices
> back to Dom0 and
> have the DomU access the devices in a virtual manner.
>
> So my question is: Is it possible to do it? Is it possible for VGA/
> graphics?
>
> I have tried a few things and following is what I am being able to do:
>
> I am being able to provide direct access to devices
> (wireless/ethernet/graphics etc) to HVM DomUs.
> And also I am being able to dynamically change the direct access to these
> devices between
> the various HVM DomUs (tested with WinXP and Windows 7) in case of
> ethernet/USB etc. I am being
> able to detach it from one DomU and attach it to another. (This is not
> working with VGA direct access
> though.)
>
> But I am not being able to reattach these devices back to Dom0. I have tried
> the sysfs way and initial
> boot time passthrough.
>
> I have also tried the stubdomain way, but when I do not hide the devices
> from Dom0 (at boot time) and later try to assign them to stubdomain, my Dom0
> gets rebooted automatically. I am following
> the steps mentioned in:
> http://mirror.choon.net/xen/xen-unstable.hg/docs/misc/vtd.txt
>
> So could some one  tell me if these behaviors are expected or
> if I might be doing something wrong.
>
> I will really appreciate any help. Please let me know if more information is
> needed from my side.
>

Hi,

If you detach a pass through device from a domU it gets reassigned to
dom0 automatically.
The problem you are having is that pciback in dom0 still own the
device that why it looks like
the device isn't working in dom0.

You'll have to manually unbind the device from picback and bind it to
another driver in dom0.
That can be done through the sysfs driver nodes "bind" and "unbind".

Jean

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>