Changes between Version 22 and Version 23 of xen


Ignore:
Timestamp:
Feb 23, 2008, 7:01:02 PM (10 years ago)
Author:
jrollins
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • xen

    v22 v23  
    9696}}}
    9797
    98 You have to first find the pci device id of the devices you want to pass to the domU.  This is most easily done with '''lspci'''.  The id is given in the first column, usually of form "bus:slot.func" (eg. "00:0a.0"), refered to as "PCIDEV?" below.  Sometimes the device needs to be referred to by it's full address form "domain:bus:slot.func" (eg. "0000:00:0a.0"), referred to as "DPCIDEV?" below.
     98You have to first find the pci device id of the devices you want to pass to the domU.  This is most easily done with `lspci`.  The id is given in the first column, usually of form "bus:slot.func" (eg. "00:0a.0"), refered to as "PCIDEV?" below.  Sometimes the device needs to be referred to by it's full address form "domain:bus:slot.func" (eg. "0000:00:0a.0"), referred to as "DPCIDEV?" below.
    9999
    100100Before passing a pci device to a domU, it must first be hidden from dom0.  You can remove the pci devices manually from the dom0 kernel:
    101101{{{
    102102# remove the device from the kernel module controlling it
    103 DRIVER=$(dirname $(find /sys/bus/pci/drivers -iname "$PCIDEV"))
    104 echo -n $DPCIDEV > "$DRIVER"/unbind
     103DRIVER=$(dirname $(find /sys/bus/pci/drivers -iname "$DPCIDEV0"))
     104echo -n $DPCIDEV0 > "$DRIVER"/unbind
    105105}}}
    106106and then add the devices to to the pciback list:
    107107{{{
    108 echo -n $DPCIDEV > /sys/bus/pci/drivers/pciback/new_slot
    109 echo -n $DPCIDEV > /sys/bus/pci/drivers/pciback/bind
     108echo -n $DPCIDEV0 > /sys/bus/pci/drivers/pciback/new_slot
     109echo -n $DPCIDEV0 > /sys/bus/pci/drivers/pciback/bind
    110110}}}
    111 To have this happen automatially at boot, first tell the dom0 initramfs to include the "pciback" module.  On Debian, this is easily done by adding "pciback" to /etc/initramfs-tools/modules and then updating the initramfs:
    112 {{{
    113 echo pciback >> /etc/initramfs-tools/modules
    114 update-initramfs -u -k $(uname -r)
    115 }}}
    116 There are pciback kernel parameters that tell the kernel which pci devices to ignore.  With GRUB, this is best done by adding the needed parameters to the "xenkopt" config line in the grub menu.lst:
     111To have this happen automatically at boot, you just need to pass some pciback kernel parameters to the dom0.  With grub, this is best done by adding the needed parameters to the "xenkopt" config line in the grub menu.lst:
    117112{{{
    118113## Xen Linux kernel options to use with the default Xen boot option               
    119 # xenkopt=pciback.permissive pciback.hide=(PCIDEV0 PCIDEV1 ...) pciback.verbose_request=1
     114# xenkopt=pciback.hide=(PCIDEV0)(PCIDEV1)... pciback.verbose_request=1
    120115}}}
    121 Don't forget to run '''update-grub'''.  Reboot the machine and make sure the changes take effect. 
     116Don't forget to run `update-grub`.  Reboot the machine and make sure the changes take effect. 
    122117
    123118Now add the pci devices to the domU config with a "pci=[...]" line:
     
    125120pci=['PCIDEV0', 'PCIDEV1', ...]
    126121}}}
    127 After creating the domU, lspci should show the passed through devices.
     122After creating the domU, `lspci` on the domU should show the passed through devices.
    128123
    129124references: