view docs/misc/vtd.txt @ 18673:687601e21055

Update cpufreq statistic protection

For struct pm_px, there are 3 pointer: pxpt, pt, trans_pt.
Partly free pointer 'pt' and 'trans_pt' will result in little memory
leak, and what is more, will result in protection issue when user
access px statistic info through libxc.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Oct 21 09:48:56 2008 +0100 (2008-10-21)
parents 1f89af507e62
children 97f8d6453fda
line source
1 Title : How to do PCI Passthrough with VT-d
2 Authors : Allen Kay <allen.m.kay@intel.com>
3 Weidong Han <weidong.han@intel.com>
4 Yuji Shimada <shimada-yxb@necst.nec.co.jp>
5 Created : October-24-2007
6 Updated : September-09-2008
8 How to turn on VT-d in Xen
9 --------------------------
11 1 ) cd xen-unstable.hg
12 2 ) make install
13 3 ) make linux-2.6-xen-config CONFIGMODE=menuconfig
14 4 ) change XEN->"PCI-device backend driver" from "M" to "*".
15 5 ) make linux-2.6-xen-build
16 6 ) make linux-2.6-xen-install
17 7 ) depmod
18 8 ) mkinitrd -v -f --with=ahci --with=aacraid --with=sd_mod --with=scsi_mod initrd-2.6.18-xen.img
19 9 ) cp initrd-2.6.18-xen.img /boot
20 10) lspci - select the PCI BDF you want to assign to guest OS
21 11) "hide" pci device from dom0 as following sample grub entry:
23 title Xen-Fedora Core (2.6.18-xen)
24 root (hd0,0)
25 kernel /boot/xen.gz com1=115200,8n1 console=com1 iommu=1
26 module /boot/vmlinuz- root=LABEL=/ ro xencons=ttyS console=tty0 console=ttyS0, pciback.hide=(01:00.0)(03:00.0)
27 module /boot/initrd-2.6.18-xen.img
29 12) reboot system
30 13) add "pci" line in /etc/xen/hvm.conf for to assigned devices
31 pci = [ '01:00.0', '03:00.0' ]
32 15) start hvm guest and use "lspci" to see the passthru device and
33 "ifconfig" to see if IP address has been assigned to NIC devices.
36 Enable MSI/MSI-x for assigned devices
37 -------------------------------------
38 Add "msi=1" option in kernel line of host grub.
41 Caveat on Conventional PCI Device Passthrough
42 ---------------------------------------------
44 VT-d spec specifies that all conventional PCI devices behind a
45 PCIe-to-PCI bridge have to be assigned to the same domain.
47 PCIe devices do not have this restriction.
50 VT-d Works on OS:
51 -----------------
53 1) Host OS: PAE, 64-bit
54 2) Guest OS: 32-bit, PAE, 64-bit
57 Combinations Tested:
58 --------------------
60 1) 64-bit host: 32/PAE/64 Linux/XP/Win2003/Vista guests
61 2) PAE host: 32/PAE Linux/XP/Win2003/Vista guests
64 VTd device hotplug:
65 -------------------
67 2 virtual PCI slots (6~7) are reserved in HVM guest to support VTd hotplug. If you have more VTd devices, only 2 of them can support hotplug. Usage is simple:
69 1. List the VTd device by dom. You can see a VTd device 0:2:0.0 is inserted in the HVM domain's PCI slot 6. '''lspci''' inside the guest should see the same.
71 [root@vt-vtd ~]# xm pci-list HVMDomainVtd
72 VSlt domain bus slot func
73 0x6 0x0 0x02 0x00 0x0
75 2. Detach the device from the guest by the physical BDF. Then HVM guest will receive a virtual PCI hot removal event to detach the physical device
77 [root@vt-vtd ~]# xm pci-detach HVMDomainVtd 0:2:0.0
79 3. Attach a PCI device to the guest by the physical BDF and desired virtual slot(optional). Following command would insert the physical device into guest's virtual slot 7
81 [root@vt-vtd ~]# xm pci-attach HVMDomainVtd 0:2:0.0 7
83 VTd hotplug usage model:
84 ------------------------
86 * For live migration: As you know, VTd device would break the live migration as physical device can't be save/restored like virtual device. With hotplug, live migration is back again. Just hot remove all the VTd devices before live migration and hot add new VTd devices on target machine after live migration.
88 * VTd hotplug for device switch: VTd hotplug can be used to dynamically switch physical device between different HVM guest without shutdown.
91 VT-d Enabled Systems
92 --------------------
94 1) For VT-d enabling work on Xen, we have been using development
95 systems using following Intel motherboards:
96 - DQ35MP
97 - DQ35JO
99 2) As far as we know, following OEM systems also has vt-d enabled.
100 Feel free to add others as they become available.
102 - Dell: Optiplex 755
103 http://www.dell.com/content/products/category.aspx/optix?c=us&cs=555&l=en&s=biz
105 - HP Compaq: DC7800
106 http://h10010.www1.hp.com/wwpc/us/en/en/WF04a/12454-12454-64287-321860-3328898.html
108 For more information, pls refer to http://wiki.xensource.com/xenwiki/VTdHowTo.
111 Assigning devices to HVM domains
112 --------------------------------
114 Most device types such as NIC, HBA, EHCI and UHCI can be assigned to
115 an HVM domain.
117 But some devices have design features which make them unsuitable for
118 assignment to an HVM domain. Examples include:
120 * Device has an internal resource, such as private memory, which is
121 mapped to memory address space with BAR (Base Address Register).
122 * Driver submits command with a pointer to a buffer within internal
123 resource. Device decodes the pointer (address), and accesses to the
124 buffer.
126 In an HVM domain, the BAR is virtualized, and host-BAR value and
127 guest-BAR value are different. The addresses of internal resource from
128 device's view and driver's view are different. Similarly, the
129 addresses of buffer within internal resource from device's view and
130 driver's view are different. As a result, device can't access to the
131 buffer specified by driver.
133 Such devices assigned to HVM domain currently do not work.