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-users

Re: [Xen-users] pci passthrough how to that works?

To: Brian Krusic <brian@xxxxxxxxxx>
Subject: Re: [Xen-users] pci passthrough how to that works?
From: Matthias Reif <mattreif@xxxxxxxxxxxxx>
Date: Thu, 7 Jan 2010 14:31:50 +1100
Cc: Xen Users <xen-users@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 06 Jan 2010 19:32:51 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <CFD554FF-9A49-44A5-B25E-820038B00834@xxxxxxxxxx>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx



> On Jan 6, 2010, at 2:57 PM, Matthias Reif wrote:

>
>
>
> xen-users-bounces@xxxxxxxxxxxxxxxxxxx wrote on 07/01/2010 09:32:23 AM:
>
> > Hi,
> >
> > I'm running Centos 5.3 for dom0 and domUs and using Xen 3.4.1 (AMD V  
> > enabled Sun box).
> >
> > Using lspci, I see that my device I wished ignored by dom0 so that I  
> > can use it for 1 of my domUs is;
> >
> > 07:00.0
> >
> > In grub.conf, I added this to my module line;
> >
> > pciback.permissive pciback.hide (07:00.0)
> >
> > Upon reboot, lspci on dom0 still shows that pci device.
> >
> > I've also modded my modprob.conf;
> >
> > options pciback hide=(07:00.0)
> >
> > Any ideas how I can get pci passthrough to work?
> >
> > - Brian
> >
>
> The pciback module needs to be loaded into initrd, so it can seize
> the device at boot time.
> Your boot log should confirm this if it says something like "unknwon
> kernel option pciback.hide
> ignoring."
>
> Try something like this:
>
> mkinitrd -f --preload=pciback /boot/initrd-$(uname -r).img $(uname -r)
>
> Also, pciback has to be loaded before the driver for your device.
> This is not always the case.
> I tried to seize a SCSI controller to pass a tape drive to a domU,
> but its driver had to be loaded
> first to get access to the disks where the initrd etc is stored (I
> presume). When pciback was loaded
> the driver had already taken control of the device.
> If that's the case, late binding may be an option for you, where you
> unbind the driver from the
> device after the system has booted and then bind it to pciback prior
> to starting your domU.
>
> Eg.
> # echo -n 0000:07:00.0 > /sys/bus/pci/drivers/<your_driver_name>/unbind
> # echo -n 0000:07:00.0 > /sys/bus/pci/drivers/pciback/new_slot
> # echo -n 0000:07:00.0 > /sys/bus/pci/drivers/pciback/bind
>
>
> Matthias
>
>
>
>
Brian Krusic <brian@xxxxxxxxxx> wrote on 07/01/2010 12:26:27 PM:

> Hi Matthias,

>
> Heres what I did;

>
> mkinitrd -f –preload=pciback /boot/initrd-$(uname -r).img $(uname -r)

>
> Then added this line to modprob.conf

>
> options pciback hide=(07:00.0)

>
> After a reboot, I still see the device under lspci, is this normal?

>
> I went ahead and added this to the file xend-pci-permissive.sxp;

>
> (unconstrained_dev_ids

> #(’0123:4567:89AB:CDEF’)
> (’10de:042f’)
> )
>
> I got the 10de:042f from doing this;

>
> lspci -n

>
> Which gave;

>
> 07:00.00 0300: 10de:042f (rev a1)

>
> The next step is to assign this PCI device to domU.  In normal
> syntax I would simply edit domU config file and add;

>
> pci = [ "07:00.0"]

>
> But my domU configs are now using config.sxp which is this new
> bloody XML format.

>
> How do I put pci = [ "07:00.0"] in this XML format?

>
>  

> - Brian
>


First make sure that the new initrd that you built with pciback included is
also referred to in your /boot/grub/grub.conf

Secondly I would put the pciback module options also into grub.conf. I am not
sure whether modprobe.conf is actually used at boot time.

Eg.
title CentOS (2.6.18-128.4.1.el5xen) Hypervisor 3.4.1 CentOS dom0
        root (hd0,0)
        kernel /xen.gz-3.4.1
        module /vmlinuz-2.6.18-128.4.1.el5xen ro root=/dev/md1 pciback.hide=(07:00.0)
        module /initrd-2.6.18-128.4.1.el5xen.img


Then check dmesg to confirm that pciback is loaded and is trying to seize the device.

If dmesg indicates that it is ignoring the pciback.hide kernel parameter then there
is still something wrong.

Matthias



SOUTH PACIFIC SEEDS
PO Box 934, GRIFFITH N.S.W. 2680. AUSTRALIA
Phone:
02 6962 7333      Fax: 02 6964 1311

CAUTION: The information contained in this e-mail is privileged and confidential. If you are reading this message and you are not the intended recipient, you are hereby notified that any use, dissemination, distribution or reproduction of all or part of the contents is prohibited. If you receive this message in error, please notify the sender immediately. Any opinions or views expressed in this message are those of the individual sender and may not represent those of their employer.

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