Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Jul 2018 02:02:21 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 229852] [PATCH] bhyve: IOMMU (Intel VTd) PCI passthrough attempt locks up some systems
Message-ID:  <bug-229852-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D229852

            Bug ID: 229852
           Summary: [PATCH] bhyve: IOMMU (Intel VTd) PCI passthrough
                    attempt locks up some systems
           Product: Base System
           Version: 11.2-RELEASE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: callum@aitchison.org

Created attachment 195225
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D195225&action=
=3Dedit
Patch for VT-d capability detection on chipsets that have multiple translat=
ion
units with differing capabilities

When an attempt is made to passthrough a PCI device to a bhyve VM (causing
initialisation of IOMMU) on certain Intel chipsets using VT-d the PCI bus s=
tops
working entirely. This issue occurs on the E3-1275 v5 processor on C236 chi=
pset
and has also been encountered by others on the forums with different hardwa=
re
in the Skylake series.

The chipset has two VT-d translation units. The issue is caused by an attem=
pt
to use the VT-d device-IOTLB capability that is supported by only the first
unit for devices attached to the second unit which lacks that capability. O=
nly
the capabilities of the first unit are checked and are assumed to be the sa=
me
for all units.

Attached is a patch to rectify this issue by determining which unit is
responsible for the device being added to a domain and then checking that
unit's device-IOTLB capability. In addition to this a few fixes have been m=
ade
to other instances where the first unit's capabilities are assumed for all
units for domains they share. In these cases a mutual set of capabilities is
determined. The patch should hopefully fix any bugs for current/future hard=
ware
with multiple translation units supporting different capabilities.

A description is on the forums at
https://forums.freebsd.org/threads/pci-passthrough-bhyve-usb-xhci.65235
The thread includes observations by other users of the bug occurring, and
description as well as confirmation of the fix. I'd also like to thank Ordo=
ban
for their help.

The attached patch applies to 11.2-RELEASE and the current 11-STABLE. It wi=
ll
also apply to 12.0-CURRENT since the only difference in source at present i=
s an
extra 2 lines of licensing comment. Although I have personally only tested =
the
patch on 11.2-RELEASE there's no reason results should differ on 12.0-CURRE=
NT.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-229852-227>