[xen master] pci: treat class 0 devices as endpoints

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[xen master] pci: treat class 0 devices as endpoints

patchbot
commit 7495a5b6aa1c741964baf18a1cbdb8b8d71cce98
Author:     Roger Pau Monne <[hidden email]>
AuthorDate: Tue May 8 11:33:00 2018 +0200
Commit:     Jan Beulich <[hidden email]>
CommitDate: Thu Jun 28 09:29:38 2018 +0200

    pci: treat class 0 devices as endpoints
   
    Class 0 devices are legacy pre PCI 2.0 devices that didn't have a
    class code. Treat them as endpoints, so that they can be handled by
    the IOMMU and properly passed-through to the hardware domain.
   
    Such device has been seen on a Super Micro server, lspci -vv reports:
   
    00:13.0 Non-VGA unclassified device: Intel Corporation Device a135 (rev 31)
            Subsystem: Super Micro Computer Inc Device 0931
            Flags: bus master, fast devsel, latency 0, IRQ 11
            Memory at df222000 (64-bit, non-prefetchable) [size=4K]
            Capabilities: [80] Power Management version 3
   
    Arguably this is not a legacy device (since this is a new server), but
    in any case Xen needs to deal with it.
   
    Suggested-by: Andrew Cooper <[hidden email]>
    Signed-off-by: Roger Pau Monné <[hidden email]>
    Acked-by: Jan Beulich <[hidden email]>
---
 xen/drivers/passthrough/pci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 1db69d5b99..c4890a4295 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -927,10 +927,11 @@ enum pdev_type pdev_type(u16 seg, u8 bus, u8 devfn)
     case PCI_CLASS_BRIDGE_HOST:
         return DEV_TYPE_PCI_HOST_BRIDGE;
 
-    case 0x0000: case 0xffff:
+    case 0xffff:
         return DEV_TYPE_PCI_UNKNOWN;
     }
 
+    /* NB: treat legacy pre PCI 2.0 devices (class_device == 0) as endpoints. */
     return pos ? DEV_TYPE_PCIe_ENDPOINT : DEV_TYPE_PCI;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


_______________________________________________
Xen-changelog mailing list
[hidden email]
https://lists.xenproject.org/xen-changelog