[Bug 229852] [PATCH] bhyve: IOMMU (Intel VTd) PCI passthrough attempt locks up some systems

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Wed Jul 18 02:02:23 UTC 2018


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=229852

            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 at FreeBSD.org
          Reporter: callum at aitchison.org

Created attachment 195225
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=195225&action=edit
Patch for VT-d capability detection on chipsets that have multiple translation
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 stops
working entirely. This issue occurs on the E3-1275 v5 processor on C236 chipset
and has also been encountered by others on the forums with different hardware
in the Skylake series.

The chipset has two VT-d translation units. The issue is caused by an attempt
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. Only
the capabilities of the first unit are checked and are assumed to be the same
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 made
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 hardware
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 Ordoban
for their help.

The attached patch applies to 11.2-RELEASE and the current 11-STABLE. It will
also apply to 12.0-CURRENT since the only difference in source at present is 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-CURRENT.

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


More information about the freebsd-bugs mailing list