- 论坛徽章:
- 0
|
在xen user's manual中有如下叙述:
5.3 Driver Domain Configuration (Domain 驱动配置)
5.3.1 PCI
Individual PCI devices can be assigned to a given domain to allow that domain direct access to the PCI hardware. To use this functionality, ensure that the PCI Backend is compiled in to a privileged domain (e.g. domain 0) and that the domains which will be assigned PCI devices have the PCI Frontend compiled in. In XenLinux, the PCI Backend is available under the Xen configuration section while the PCI Frontend is under the architecture-specific "Bus Options" section. You may compile both the backend and the frontend into the same kernel; they will not affect each other.
The PCI devices you wish to assign to unprivileged domains must be "hidden" from your backend domain (usually domain 0) so that it does not load a driver for them. Use the pciback.hide kernel parameter which is specified on the kernel command-line and is configurable through GRUB (see Section 2.5). Note that devices are not really hidden from the backend domain. The PCI Backend ensures that no other device driver loads for those devices. PCI devices are identified by hexadecimal slot/funciton numbers (on Linux, use lspci to determine slot/funciton numbers of your devices) and can be specified with or without the PCI domain:
(bus:slot.func) example (02:1d.3)
(domain:bus:slot.func) example (0000:02:1d.3)
An example kernel command-line which hides two PCI devices might be:
root=/dev/sda4 ro console=tty0 pciback.hide=(02:01.f)(0000:04:1d.0)
To configure a domU to receive a PCI device:
Command-line:
Use the pci command-line flag. For multiple devices, use the option multiple times.
xm create netcard-dd pci=01:00.0 pci=02:03.0
Flat Format configuration file:
Specify all of your PCI devices in a python list named pci.
pci=['01:00.0','02:03.0']
SXP Format configuration file:
Use a single PCI device section for all of your devices (specify the numbers in hexadecimal with the preceding '0x'). Note that domain here refers to the PCI domain, not a virtual machine within Xen.
(device (pci
(dev (domain 0x0)(bus 0x3)(slot 0x1a)(func 0x1)
(dev (domain 0x0)(bus 0x1)(slot 0x5)(func 0x0)
)
There are a number of security concerns associated with PCI Driver Domains that you can read about in Section 9.2
也就是说dom0中的一个pci可以被domu使用. 而显卡也是一个pci设备.
没有用过这么高级的特性 |
|