]> xenbits.xensource.com Git - xen.git/commitdiff
xen/vtd: enable USB device assignment
authorTiejun Chen <tiejun.chen@intel.com>
Wed, 22 Jul 2015 01:39:58 +0000 (01:39 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Thu, 23 Jul 2015 12:45:26 +0000 (13:45 +0100)
USB RMRR may conflict with guest BIOS region. In such case, identity
mapping setup is simply skipped in previous implementation. Now we
can handle this scenario cleanly with new policy mechanism so previous
hack code can be removed now.

CC: Yang Zhang <yang.z.zhang@intel.com>
CC: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
xen/drivers/passthrough/vtd/dmar.h
xen/drivers/passthrough/vtd/iommu.c
xen/drivers/passthrough/vtd/utils.c

index af1feef2d96f78e39aa721cbc02116ca69dae1b2..af205f519848e76256e2a5a7467fc02fdf392b75 100644 (file)
@@ -129,7 +129,6 @@ do {                                                \
 
 int vtd_hw_check(void);
 void disable_pmr(struct iommu *iommu);
-int is_usb_device(u16 seg, u8 bus, u8 devfn);
 int is_igd_drhd(struct acpi_drhd_unit *drhd);
 
 #endif /* _DMAR_H_ */
index a2f3a66ca0a9ea2140b4fa9c0c25f85555d0b2b7..8a8d7630298706cab2b21fcae631e676355abf88 100644 (file)
@@ -2242,11 +2242,9 @@ static int reassign_device_ownership(
     /*
      * If the device belongs to the hardware domain, and it has RMRR, don't
      * remove it from the hardware domain, because BIOS may use RMRR at
-     * booting time. Also account for the special casing of USB below (in
-     * intel_iommu_assign_device()).
+     * booting time.
      */
-    if ( !is_hardware_domain(source) &&
-         !is_usb_device(pdev->seg, pdev->bus, pdev->devfn) )
+    if ( !is_hardware_domain(source) )
     {
         const struct acpi_rmrr_unit *rmrr;
         u16 bdf;
@@ -2299,13 +2297,8 @@ static int intel_iommu_assign_device(
     if ( ret )
         return ret;
 
-    /* FIXME: Because USB RMRR conflicts with guest bios region,
-     * ignore USB RMRR temporarily.
-     */
     seg = pdev->seg;
     bus = pdev->bus;
-    if ( is_usb_device(seg, bus, pdev->devfn) )
-        return 0;
 
     /* Setup rmrr identity mapping */
     for_each_rmrr_device( rmrr, bdf, i )
index bd14c02827da537a95b4e1d24bc2660d528d9f5f..b8a077feb7049a5675b25c39ee8412ebd489f989 100644 (file)
 #include "extern.h"
 #include <asm/io_apic.h>
 
-int is_usb_device(u16 seg, u8 bus, u8 devfn)
-{
-    u16 class = pci_conf_read16(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
-                                PCI_CLASS_DEVICE);
-    return (class == 0xc03);
-}
-
 /* Disable vt-d protected memory registers. */
 void disable_pmr(struct iommu *iommu)
 {