<div>Hi All ,</div>
<div> </div>
<div>I  have tried the same  using dell R710  server and RHEL6.1 after enabled the VT-D option enabled . and checked it was not working with my enviromment ..</div>
<div> </div>
<div>any body tested below on Dell server ...If i have missed  anything ..</div>
<div> </div>
<div> </div>
<div><strong><font color="#a00000" size="6">PCI passthrough</font></strong> <span style="FONT-SIZE:10pt"><br>This chapter covers using PCI passthrough with KVM.</span> <span style="FONT-SIZE:10pt"><br>Certain hardware platforms allow virtualized guests to directly access various hardware devices and</span> <span style="FONT-SIZE:10pt"><br>
components. This process in virtualization is known as <i>passthrough</i>. Passthrough is known as <i>device</i></span> <i><span style="FONT-SIZE:10pt"><br>assignment </span></i><span style="FONT-SIZE:10pt">in some of the KVM documentation and the KVM code.</span> <span style="FONT-SIZE:10pt"><br>
The KVM hypervisor supports attaching PCI devices on the host system to virtualized guests.</span> <span style="FONT-SIZE:10pt"><br>PCI passthrough allows guests to have exclusive access to PCI devices for a range of tasks. PCI</span> <span style="FONT-SIZE:10pt"><br>
passthrough allows PCI devices to appear and behave as if they were physically attached to the guest</span> <span style="FONT-SIZE:10pt"><br>operating system. PCI passthrough can improve the I/O performance of devices attached to virtualized</span> <span style="FONT-SIZE:10pt"><br>
guests.</span> <span style="FONT-SIZE:10pt"><br>Almost all PCI and PCI Express devices that support passthrough, except for graphics cards, can be</span> <span style="FONT-SIZE:10pt"><br>directly attached to virtualized guests with PCI passthrough.</span> <span style="FONT-SIZE:10pt"><br>
PCI passthrough is only available on hardware platforms supporting either Intel VT-d or AMD IOMMU.</span> <span style="FONT-SIZE:10pt"><br>These Intel VT-d or AMD IOMMU extensions must be enabled in BIOS for PCI passthrough to</span> <span style="FONT-SIZE:10pt"><br>
function.</span> <span style="FONT-SIZE:10pt"><br>Red Hat Enterprise Linux 6.0 and newer supports hot plugging PCI passthrough devices into</span> <span style="FONT-SIZE:10pt"><br>virtualized guests.</span> <span style="FONT-SIZE:10pt"><br>
Out of the 32 available PCI devices for a guest 4 are not removable. This means there are only 28</span> <span style="FONT-SIZE:10pt"><br>PCI slots available for additional devices per guest. Every para-virtualized network or block device</span> <span style="FONT-SIZE:10pt"><br>
uses one slot. Each guest can use up to 28 additional devices made up of any combination of paravirtualized</span> <span style="FONT-SIZE:10pt"><br>network, para-virtualized disk devices, or other PCI devices using VT-d.</span> <span style="COLOR:#a00000;FONT-SIZE:10pt"><br>
Procedure 12.1. Preparing an Intel system for PCI passthrough</span> <span style="FONT-SIZE:10pt"><br>1. <b>Enable the Intel VT-d extensions</b></span> <span style="FONT-SIZE:10pt"><br>The Intel VT-d extensions provides hardware support for directly assigning a physical devices to</span> <span style="FONT-SIZE:10pt"><br>
guest.</span> <span style="FONT-SIZE:10pt"><br>The VT-d extensions are required for PCI passthrough with Red Hat Enterprise Linux. The</span> <span style="FONT-SIZE:10pt"><br>extensions must be enabled in the BIOS. Some system manufacturers disable these extensions</span> <span style="FONT-SIZE:10pt"><br>
by default.</span> <span style="FONT-SIZE:10pt"><br>These extensions are often called various terms in BIOS which differ from manufacturer to</span> <span style="FONT-SIZE:10pt"><br>manufacturer. Consult your system manufacturer's documentation.</span> <span style="FONT-SIZE:10pt"><br>
2. <b>Activate Intel VT-d in the kernel</b></span> <span style="FONT-SIZE:10pt"><br>Activate Intel VT-d in the kernel by appending the <i>intel_iommu=on </i>parameter to the kernel line</span> <span style="FONT-SIZE:10pt"><br>
of the kernel line in the <b>/boot/grub/grub.conf </b>file.</span> <span style="FONT-SIZE:10pt"><br>The example below is a modified <b>grub.conf </b>file with Intel VT-d activated.</span> <span style="FONT-SIZE:7.5pt"><br>
default=0</span> <span style="FONT-SIZE:7.5pt"><br>timeout=5</span> <span style="FONT-SIZE:7.5pt"><br>splashimage=(hd0,0)/grub/splash.xpm.gz</span> <span style="FONT-SIZE:7.5pt"><br>hiddenmenu</span> <span style="FONT-SIZE:7.5pt"><br>
title Red Hat Enterprise Linux Server (2.6.32-36.x86-645)</span> <span style="FONT-SIZE:7.5pt"><br>root (hd0,0)</span> <span style="FONT-SIZE:7.5pt"><br>kernel /vmlinuz-2.6.32-36.x86-64 ro root=/dev/VolGroup00/LogVol00 rhgb</span> <span style="FONT-SIZE:7.5pt"><br>
quiet <i>intel_iommu=on</i></span> <span style="FONT-SIZE:7.5pt"><br>initrd /initrd-2.6.32-36.x86-64.img</span> <b><span style="FONT-SIZE:10pt"><br>Chapter 12. PCI passthrough</span></b> <span style="FONT-SIZE:10pt"><br>108</span> <span style="FONT-SIZE:10pt"><br>
3. <b>Ready to use</b></span> <span style="FONT-SIZE:10pt"><br>Reboot the system to enable the changes. Your system is now PCI passthrough capable.</span> <span style="COLOR:#a00000;FONT-SIZE:10pt"><br>Procedure 12.2. Preparing an AMD system for PCI passthrough</span> <span style="FONT-SIZE:10pt"><br>
• <b>Enable AMD IOMMU extensions</b></span> <span style="FONT-SIZE:10pt"><br>The AMD IOMMU extensions are required for PCI passthrough with Red Hat Enterprise Linux.</span> <span style="FONT-SIZE:10pt"><br>The extensions must be enabled in the BIOS. Some system manufacturers disable these</span> <span style="FONT-SIZE:10pt"><br>
extensions by default.</span> <span style="FONT-SIZE:10pt"><br>AMD systems only require that the IOMMU is enabled in the BIOS. The system is ready for PCI</span> <span style="FONT-SIZE:10pt"><br>passthrough once the IOMMU is enabled.</span> <b><span style="COLOR:#a00000;FONT-SIZE:13.5pt"><br>
12.1. Adding a PCI device with virsh</span></b> <span style="FONT-SIZE:10pt"><br>These steps cover adding a PCI device to a virtualized guest on a KVM hypervisor using hardwareassisted</span> <span style="FONT-SIZE:10pt"><br>
PCI passthrough.</span> <span style="FONT-SIZE:10pt"><br>This example uses a USB controller device with the PCI identifier code, <b>pci_8086_3a6c</b>, and a fully</span> <span style="FONT-SIZE:10pt"><br>virtualized guest named <i>win2k3</i>.</span> <span style="FONT-SIZE:10pt"><br>
1. <b>Identify the device</b></span> <span style="FONT-SIZE:10pt"><br>Identify the PCI device designated for passthrough to the guest. The <b>virsh nodedev-list</b></span> <span style="FONT-SIZE:10pt"><br>command lists all devices attached to the system. The <b>--tree </b>option is useful for identifying</span> <span style="FONT-SIZE:10pt"><br>
devices attached to the PCI device (for example, disk controllers and USB controllers).</span> <span style="FONT-SIZE:7.5pt"><br># virsh nodedev-list --tree</span> <span style="FONT-SIZE:10pt"><br>For a list of only PCI devices, run the following command:</span> <span style="FONT-SIZE:7.5pt"><br>
# virsh nodedev-list | grep pci</span> <span style="FONT-SIZE:10pt"><br>In the output from this command, each PCI device is identified by a string, as shown in the</span> <span style="FONT-SIZE:10pt"><br>following example output:</span> <span style="FONT-SIZE:7.5pt"><br>
pci_0000_00_00_0</span> <span style="FONT-SIZE:7.5pt"><br>pci_0000_00_02_0</span> <span style="FONT-SIZE:7.5pt"><br>pci_0000_00_02_1</span> <span style="FONT-SIZE:7.5pt"><br>pci_0000_00_03_0</span> <span style="FONT-SIZE:7.5pt"><br>
pci_0000_00_03_2</span> <span style="FONT-SIZE:7.5pt"><br>pci_0000_00_03_3</span> <span style="FONT-SIZE:7.5pt"><br>pci_0000_00_19_0</span> <span style="FONT-SIZE:7.5pt"><br>pci_0000_00_1a_0</span> <span style="FONT-SIZE:7.5pt"><br>
pci_0000_00_1a_1</span> <span style="FONT-SIZE:7.5pt"><br>pci_0000_00_1a_2</span> <span style="FONT-SIZE:7.5pt"><br>pci_0000_00_1a_7</span> <span style="FONT-SIZE:7.5pt"><br>pci_0000_00_1b_0</span> <span style="FONT-SIZE:7.5pt"><br>
pci_0000_00_1c_0</span> <b><span style="COLOR:#ffe1dc"><br>Tip: determining the PCI device</span></b> <span style="FONT-SIZE:10pt"><br>Comparing <b>lspci </b>output to <b>lspci -n </b>(which turns off name resolution) output can assist in</span> <span style="FONT-SIZE:10pt"><br>
deriving which device has which device identifier code.</span> <span style="FONT-SIZE:10pt"><br>Adding a PCI device with virsh</span> <span style="FONT-SIZE:10pt"><br>109</span> <span style="FONT-SIZE:10pt"><br>Record the PCI device number; the number is needed in other steps.</span> <span style="FONT-SIZE:10pt"><br>
2. Information on the domain, bus and function are available from output of the <b>virsh nodedevdumpxml</b></span> <span style="FONT-SIZE:10pt"><br>command:</span> <span style="FONT-SIZE:7.5pt"><br># virsh nodedev-dumpxml pci_8086_3a6c</span> <span style="FONT-SIZE:7.5pt"><br>
<device></span> <span style="FONT-SIZE:7.5pt"><br><name>pci_8086_3a6c</name></span> <span style="FONT-SIZE:7.5pt"><br><parent>computer</parent></span> <span style="FONT-SIZE:7.5pt"><br><capability type='pci'></span> <span style="FONT-SIZE:7.5pt"><br>
<domain>0</domain></span> <span style="FONT-SIZE:7.5pt"><br><bus>0</bus></span> <span style="FONT-SIZE:7.5pt"><br><slot>26</slot></span> <span style="FONT-SIZE:7.5pt"><br><function>7</function></span> <span style="FONT-SIZE:7.5pt"><br>
<id='0x3a6c'>82801JD/DO (ICH10 Family) USB2 EHCI Controller #2</product></span> <span style="FONT-SIZE:7.5pt"><br><vendor id='0x8086'>Intel Corporation</vendor></span> <span style="FONT-SIZE:7.5pt"><br>
</capability></span> <span style="FONT-SIZE:7.5pt"><br></device></span> <span style="FONT-SIZE:10pt"><br>3. Detach the device from the system. Attached devices cannot be used and may cause various</span> <span style="FONT-SIZE:10pt"><br>
errors if connected to a guest without detaching first.</span> <span style="FONT-SIZE:7.5pt"><br># virsh nodedev-dettach pci_8086_3a6c</span> <span style="FONT-SIZE:7.5pt"><br>Device pci_8086_3a6c dettached</span> <span style="FONT-SIZE:10pt"><br>
4. Convert slot and function values to hexadecimal values (from decimal) to get the PCI bus</span> <span style="FONT-SIZE:10pt"><br>addresses. Append "0x" to the beginning of the output to tell the computer that the value is a</span> <span style="FONT-SIZE:10pt"><br>
hexadecimal number.</span> <span style="FONT-SIZE:10pt"><br>For example, if bus = 0, slot = 26 and function = 7 run the following:</span> <span style="FONT-SIZE:7.5pt"><br>$ printf %x 0</span> <span style="FONT-SIZE:7.5pt"><br>
0</span> <span style="FONT-SIZE:7.5pt"><br>$ printf %x 26</span> <span style="FONT-SIZE:7.5pt"><br>1a</span> <span style="FONT-SIZE:7.5pt"><br>$ printf %x 7</span> <span style="FONT-SIZE:7.5pt"><br>7</span> <span style="FONT-SIZE:10pt"><br>
The values to use:</span> <span style="FONT-SIZE:7.5pt"><br>bus='0x00'</span> <span style="FONT-SIZE:7.5pt"><br>slot='0x1a'</span> <span style="FONT-SIZE:7.5pt"><br>function='0x7'</span> <span style="FONT-SIZE:10pt"><br>
5. Run <b>virsh edit </b>(or virsh attach device) and added a device entry in the <b><devices> </b>section to</span> <span style="FONT-SIZE:10pt"><br>attach the PCI device to the guest.</span> <span style="FONT-SIZE:7.5pt"><br>
# virsh edit <i>win2k3</i></span> <span style="FONT-SIZE:7.5pt"><br><hostdev mode='subsystem' type='pci' managed='yes'></span> <span style="FONT-SIZE:7.5pt"><br><source></span> <span style="FONT-SIZE:7.5pt"><br>
<address domain='0x0000' bus='0x00' slot='0x1a' function='0x7'/></span> <span style="FONT-SIZE:7.5pt"><br></source></span> <span style="FONT-SIZE:7.5pt"><br></hostdev></span> <span style="FONT-SIZE:10pt"><br>
6. Once the guest system is configured to use the PCI address, the host system must be configured</span> <span style="FONT-SIZE:10pt"><br>to stop using the device. The <b>ehci </b>driver is loaded by default for the USB PCI controller.</span> <b><span style="FONT-SIZE:10pt"><br>
Chapter 12. PCI passthrough</span></b> <span style="FONT-SIZE:10pt"><br>110</span> <span style="FONT-SIZE:7.5pt"><br>$ readlink /sys/bus/pci/devices/0000\:00\:1a.7/driver</span> <span style="FONT-SIZE:7.5pt"><br>../../../bus/pci/drivers/ehci_hcd</span> <span style="FONT-SIZE:10pt"><br>
7. Detach the device:</span> <span style="FONT-SIZE:7.5pt"><br>$ virsh nodedev-dettach pci_8086_3a6c</span> <span style="FONT-SIZE:10pt"><br>8. Verify it is now under the control of pci_stub:</span> <span style="FONT-SIZE:7.5pt"><br>
$ readlink /sys/bus/pci/devices/0000\:00\:1d.7/driver</span> <span style="FONT-SIZE:7.5pt"><br>../../../bus/pci/drivers/pci-stub</span> <span style="FONT-SIZE:10pt"><br>9. Set a sebool to allow the management of the PCI device from the guest:</span> <span style="FONT-SIZE:7.5pt"><br>
$ setsebool -P virt_manage_sysfs 1</span> <span style="FONT-SIZE:10pt"><br>10. Start the guest system :</span> <span style="FONT-SIZE:7.5pt"><br># virsh start <i>win2k3</i></span> <span style="FONT-SIZE:10pt"><br>The PCI device should now be successfully attached to the guest and accessible to the g</span><span style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt">uest   </span><br>
<br><br><br><br></div>
<div class="gmail_quote">On Mon, Mar 5, 2012 at 9:47 PM, Eric Blake <span dir="ltr"><<a href="mailto:eblake@redhat.com">eblake@redhat.com</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT:#ccc 1px solid;MARGIN:0px 0px 0px 0.8ex;PADDING-LEFT:1ex" class="gmail_quote">[top-posting on technical lists tends to be frowned on]<br>
<div class="im"><br>On 03/05/2012 09:06 AM, Daniel Gonzalez wrote:<br>> Thanks Eric,<br>><br>> Does this also apply for PCI express?<br><br></div>If the kernel presents PCI express devices to user space in the same way<br>
as it presents traditional PCI devices, then the answer is yes - PCI<br>device passthrough in both cases is a matter of using kernel passthrough<br>to let the qemu user space process control that device, so that the<br>guest OS in turn can manage the device as it would in a bare metal<br>
situation.<br>
<div class="HOEnZb">
<div class="h5"><br>--<br>Eric Blake   <a href="mailto:eblake@redhat.com">eblake@redhat.com</a>    +1-919-301-3266<br>Libvirt virtualization library <a href="http://libvirt.org/" target="_blank">http://libvirt.org</a><br>
<br></div></div><br>_______________________________________________<br>libvirt-users mailing list<br><a href="mailto:libvirt-users@redhat.com">libvirt-users@redhat.com</a><br><a href="https://www.redhat.com/mailman/listinfo/libvirt-users" target="_blank">https://www.redhat.com/mailman/listinfo/libvirt-users</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>With Best Regards,<br>Nitin Kumar <br>Sr. System Engineer-Unix (CSC India Pvt. Ltd,  Noida )<br>+91-9999706444<br>