Annotated edit history of
XenPciPassthrough version 5, including all changes.
View license author blame.
Rev |
Author |
# |
Line |
5 |
KonradRzeszutekWilk |
1 |
Xen has a feature which lets you pass a [PCI] device through to an unprivileged domain. Only the unprivileged domain has access to this specific [PCI] device – the privileged domain binds to the [PCI] device with a dummy drive that stops the dom0 from accessing it as well. |
1 |
DanielLawson |
2 |
|
2 |
AristotlePagaltzis |
3 |
This could be used for passing a [SCSI] controller or [NIC] through to one domain, eg. for a file server or FireWall domU. |
1 |
DanielLawson |
4 |
|
|
|
5 |
!! What you'll need |
|
|
6 |
|
3 |
GreigMcGill |
7 |
You'll have to compile in the right [PCI] backend driver for [Xen]. |
|
|
8 |
|
|
|
9 |
<verbatim> |
|
|
10 |
CONFIG_XEN_PCIDEV_FRONTEND=y (for DomU kernels) |
|
|
11 |
CONFIG_XEN_PCIDEV_BACKEND=y (for Dom0 kernels) |
|
|
12 |
</verbatim> |
1 |
DanielLawson |
13 |
|
2 |
AristotlePagaltzis |
14 |
You'll also need the [PCI] ID of the device in question, in the <tt>xx:xx:x</tt> notation displayed by lspci(8). Note that the formatting is important – don't drop or add leading 0's! |
1 |
DanielLawson |
15 |
|
5 |
KonradRzeszutekWilk |
16 |
For most recent version of Xen (http://wiki.xensource.com/xenwiki/XenParavirtOps), the [PCI] backend command line parameters have changed. |
1 |
DanielLawson |
17 |
|
5 |
KonradRzeszutekWilk |
18 |
Earlier to Linux 2.6.31, it was in some cases required to set the <tt>pciback.permissive</tt> option – this is for drivers which need to write to registers on the [PCI] device itself. Apparently some [NIC]s will fail to operate without this, and from what I've read it doesn't hurt to have it enabled regardless. |
|
|
19 |
In 2.6.31 and further the option is now <tt> pci=resource_alignment=xx:xx:x</tt>. |
1 |
DanielLawson |
20 |
!! Kernel options |
|
|
21 |
|
5 |
KonradRzeszutekWilk |
22 |
In <tt>grub.conf</tt>, add something like the following to your <tt>module</tt> line corresponding to the dom0 kernel (this is for kernels prior to 2.6.31): |
1 |
DanielLawson |
23 |
|
|
|
24 |
<verbatim> |
|
|
25 |
pciback.permissive pciback.hide=(03:00.0) |
5 |
KonradRzeszutekWilk |
26 |
</verbatim> |
|
|
27 |
|
|
|
28 |
Linux kernel 2.6.31 and further: |
|
|
29 |
<verbatim> |
|
|
30 |
pci=resource_alignment=03:00.0 xen-pciback.hide=(03:00.0) |
1 |
DanielLawson |
31 |
</verbatim> |
|
|
32 |
|
2 |
AristotlePagaltzis |
33 |
This assumes the device we are passing through has a [PCI] ID of <tt>03:00.0</tt>. |
|
|
34 |
|
|
|
35 |
!! [Xen] config file |
1 |
DanielLawson |
36 |
|
2 |
AristotlePagaltzis |
37 |
In your [Xen] config file for the domain, add a line that looks like the following, again assuming a [PCI] ID of <tt>03:00.0</tt>: |
1 |
DanielLawson |
38 |
|
|
|
39 |
<verbatim> |
|
|
40 |
pci = ['03:00.0'] |
|
|
41 |
</verbatim> |
|
|
42 |
|
2 |
AristotlePagaltzis |
43 |
Note that if this is a network interface, it will come up in addition to any you specify with your <tt>vif</tt> config option. |
1 |
DanielLawson |
44 |
|
|
|
45 |
---- |
|
|
46 |
Part of CategoryXen |