passthough: MSI-INTx translation documentation
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 8 Jan 2009 11:27:11 +0000 (11:27 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 8 Jan 2009 11:27:11 +0000 (11:27 +0000)
Signed-off-by: Qing He <qing.he@intel.com>
docs/misc/vtd.txt
tools/examples/xmexample.hvm

index bd6fd104ccdd79a85adf12d41c282bed7964ffcb..c49d1511ca43f5379f5a7b87f55f213ba6a7e4d1 100644 (file)
@@ -38,6 +38,30 @@ Enable MSI/MSI-x for assigned devices
 Add "msi=1" option in kernel line of host grub.
 
 
+MSI-INTx translation for passthrough devices in HVM
+---------------------------------------------------
+
+If the assigned device uses a physical IRQ that is shared by more than
+one device among multiple domains, there may be significant impact on
+device performance. Unfortunately, this is quite a common case if the
+IO-APIC (INTx) IRQ is used. MSI can avoid this issue, but was only
+available if the guest enables it.
+
+With MSI-INTx translation turned on, Xen enables device MSI if it's
+available, regardless of whether the guest uses INTx or MSI. If the
+guest uses INTx IRQ, Xen will inject a translated INTx IRQ to guest's
+virtual ioapic whenever an MSI message is received. This reduces the
+interrupt sharing of the system. If the guest OS enables MSI or MSI-X,
+the translation is automatically turned off.
+
+To enable or disable MSI-INTx translation globally, add "pci_msitranslate"
+in the config file:
+       pci_msitranslate = 1         (default is 1)
+
+To override for a specific device:
+       pci = [ '01:00.0,msitranslate=0', '03:00.0' ]
+
+
 Caveat on Conventional PCI Device Passthrough
 ---------------------------------------------
 
@@ -80,6 +104,11 @@ VTd device hotplug:
 
        [root@vt-vtd ~]# xm pci-attach HVMDomainVtd 0:2:0.0 7
 
+    To specify options for the device, use -o or --options=. Following command would disable MSI-INTx translation for the device
+
+       [root@vt-vtd ~]# xm pci-attach -o msitranslate=0 0:2:0.0 7
+
+
 VTd hotplug usage model:
 ------------------------
 
index aa014b529b935aa65b90c9ccd12edb2383082063..b4d849f72f346b302591bec04de082d620a65127 100644 (file)
@@ -288,6 +288,39 @@ serial='pty'
 #  'x' -> we don't care (do not check)
 #  's' -> the bit must be the same as on the host that started this VM
 
+#-----------------------------------------------------------------------------
+#   Configure passthrough PCI{,-X,e} devices:
+#
+#   pci=[ '[SSSS:]BB:DD.F[,option1[,option2[...]]]', ... ]
+#
+#   [SSSS]:BB:DD.F  "bus segment:bus:device.function"(1) of the device to
+#                   be assigned, bus segment is optional. All fields are
+#                   in hexadecimal and no field should be longer than that
+#                   as shown in the pattern. Successful assignment may need
+#                   certain hardware support and additional configurations
+#                   (e.g. VT-d, see docs/misc/vtd.txt for more details).
+#
+#       (1) bus segment is sometimes also referred to as the PCI "domain",
+#           not to be confused with Xen domain.
+#
+#
+#   optionN         per-device options in "key=val" format. Current
+#                   available options are:
+#                   - msitranslate=0|1
+#                      per-device overriden of pci_msitranslate, see below
+#
+#pci=[ '07:00.0', '07:00.1' ]
+
+#   MSI-INTx translation for MSI capable devices:
+#
+#   If it's set, Xen will enable MSI for the device that supports it even
+# if the guest don't use MSI. In the case, an IO-APIC type interrupt will
+# be injected to the guest every time a corresponding MSI message is
+# received.
+#   If the guest enables MSI or MSI-X, the translation is automatically
+# turned off.
+# 
+#pci_msitranslate=1
 
 #-----------------------------------------------------------------------------
 #   Configure PVSCSI devices: