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] Yet Another PCI passthrough question

On Thu, 2011-09-01 at 13:17 -0500, Beasley, Julien wrote:
> Thank you very much, James, that worked! I'm going to post exactly what I did 
> for future people that encounter the same problem.
> 
> // first check that nothing shows in lsmod
> # lsmod | grep pciback
> # 
> 
> // now type modprobe
> # modprobe pciback
> 
> // now try the lsmod again. Note I had to wait a minute or so.. at first 
> nothing was showing up
> # lsmod | grep pciback
> pciback                50301  0 
> xenbus_be               4261  5 pciback,usbbk,netbk,blkbk,blktap
> 
> // now do the step James suggested
> # echo -n "0000:04:00.0" > "/sys/bus/pci/drivers/pciback/new_slot"
> 
> # echo -n "0000:04:00.0" > "/sys/bus/pci/drivers/pciback/bind"
> 
> // check that lspci shows pciback in use
> # lspci -v
> 04:00.0 Display controller: ATI Technologies Inc Device 671d
>       Subsystem: ATI Technologies Inc Device 1b2a
>       Flags: fast devsel, IRQ 24
>       Memory at d0000000 (64-bit, prefetchable) [disabled] [size=256M]
>       Memory at fe6e0000 (64-bit, non-prefetchable) [disabled] [size=128K]
>       I/O ports at e000 [disabled] [size=256]
>       Expansion ROM at fe6c0000 [disabled] [size=128K]
>       Capabilities: [50] Power Management version 3
>       Capabilities: [58] Express Legacy Endpoint, MSI 00
>       Capabilities: [a0] MSI: Enable- Count=1/1 Maskable- 64bit+
>       Capabilities: [100] Vendor Specific Information: ID=0001 Rev=1 Len=010 
> <?>
>       Capabilities: [150] Advanced Error Reporting
>       Kernel driver in use: pciback
> 
> 
> // so far this works, and I can see the kernel driver in pciback. Good!
> 
> // Xen wiki says to check this and not proceed if empty
> # xm pci-list-assignable-devices
> 
> // that was still empty... but let's keep going anyways
> 
> 
> // edit the config to pass the pci device
> # vi /etc/xen/vm/windowsvistax64
> ...
> pci= [ '04:00.0' ]
> 
> 
> // check that nothing is assigned to the pci list for that VM
> # xm pci-list windowsvistax64
> 
> // now create the VM
> # xm create windowsvistax64
> 
> // checkt hat something is assigned to the vm now
> xm pci-list windowsvistax64
> VSlt VFn domain bus  slot func
> 0x05 0x0 0x0000 0x04 0x00 0x0
> 
> 
> // then I opened the VM graphics console, and it indeed saw my card. Thank 
> you James for your help!
> 
> Julien
> _______________________________________________
> Xen-users mailing list
> Xen-users@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-users

I just came across a problem after updating some sles11sp1 servers with
pci passthrough. Apparently the way we are doing it, and the way I
shared here, is a combination of early and late binding, which might
cause some issues. 

Here's how we fixed it. "xm pci-list-assignable-devices" also works
after we did these changes. 

1- Make sure all the stuff is commented out in after.local
 
2-  Modify  /etc/sysconfig/kernel and add pciback:
INITRD_MODULES="thermal cciss hpsa pciback mptsas ata_piix ata_generic 
ide_pci_generic processor fan jbd ext3 edd mptspi hpahcisr mptbase mptscsih"

Note:  Make sure pciback is up towards the front as in this example

Then run "mkintrd" to build it into the init ram disk so it is available
for the kernel load line parameters.  You may see some dependency errors
about it....but disregard.
 
3-  Then add the pci stuff back into the kernel module load line.  Run
lspci first to make sure the PCI identifiers  are still the same with
the new kernel. I don't think they'll be different.
 
For example:
module /boot/vmlinuz-2.6.32.12-0.7-xen root=/dev/cciss/c0d0p2 
resume=/dev/cciss/c0d0p1 splash=silent showopts vga=0x317 pciback.permissive 
pciback.hide=(0e:04.0)(0e:04.1) pci=resource_alignment=0e:04.0;0e:04.1 
 
4-  Then re-boot and check "xm pci-list-assignable-devices" to see if
they show up.  

5. Assign devices to VM as you wish. 

This is actually a little bit cleaner as you don't need anything in
after.local. Be aware that after a kernel update you need to make sure
you add the PCI stuff back to the module line in menu.lst.

James



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