pci: treat class 0 devices as endpoints
PATCH 1/1 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.
---
Cc: Jan Beulich <[email protected]>
--- xen/drivers/passthrough/pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
xen/drivers/passthrough/pci.c +2 -1
@@ -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 ; }
Signature · 7 lines
2.17.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 12 lines · Roger Pau Monne
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 atdf222000(64-bit, non-prefetchable) [size=4K]
Capabilities: [80] Power Management version 3
Quoted 5 lines
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 <[email protected]>Signed-off-by Roger Pau Monné <[email protected]>
FWIW, An updated lspci reports:
00:13.0 Non-VGA unclassified device: Intel Corporation Sunrise Point-H Integrated Sensor Hub (rev 31)
Subsystem: Super Micro Computer Inc Device 0931
~Andrew
Quoted 13 lines
---
Cc: Jan Beulich <[email protected]>--- xen/drivers/passthrough/pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)xen/drivers/passthrough/pci.c +0
-0@@ -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 ;
xen/drivers/passthrough/pci.c enum pdev_type pdev_type(u16 seg, u8 bus, u8 devfn) · line 937
Quoted 10 lines
xen/drivers/passthrough/pci.c +2
-1-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 ; }
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 08.05.18 at 11:33, <[email protected]> wrote:
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:
Quoted 8 lines
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 atdf222000(64-bit, non-prefetchable) [size=4K]
Capabilities: [80] Power Management version 3Arguably this is not a legacy device (since this is a new server), but in any case Xen needs to deal with it.
Well, it's a two fold argument: On one hand I agree we ought to be dealing with class 0. Otoh this particular device is an example to the contrary - we should try to avoid passing through broken devices: If their designers don't even get the class code right, what other flaws do we have to expect? Anyway, this is no objection to the actual code change, I'm merely unconvinced that the argumentation is plausible.
Quoted 2 lines
Suggested-by Andrew Cooper <[email protected]>Signed-off-by Roger Pau Monné <[email protected]>
Jan
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 23 lines · Jan Beulich
Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 08.05.18 at 11:33, <[email protected]> wrote:
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:
Quoted 8 lines
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 atdf222000(64-bit, non-prefetchable) [size=4K]
Capabilities: [80] Power Management version 3Arguably this is not a legacy device (since this is a new server), but in any case Xen needs to deal with it.
Well, it's a two fold argument: On one hand I agree we ought to be dealing with class 0. Otoh this particular device is an example to the contrary - we should try to avoid passing through broken devices: If their designers don't even get the class code right, what other flaws do we have to expect? Anyway, this is no objection to the actual code change, I'm merely unconvinced that the argumentation is plausible.
Quoted 4 lines
Quoted 2 lines
Suggested-by Andrew Cooper <[email protected]>Signed-off-by Roger Pau Monné <[email protected]>Acked-by Jan Beulich <[email protected]>
Thanks.
Since I also have another patch already Acked, I guess I will maintain my for-4.12 branch until the tree opens again.
Roger.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel