Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Aug 2016 13:18:43 -0700
From:      John Baldwin <jhb@freebsd.org>
To:        src-committers@freebsd.org
Cc:        svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r304858 - in head/sys/amd64/vmm: . io
Message-ID:  <1696735.VsWPYRr5di@ralph.baldwin.cx>
In-Reply-To: <201608262015.u7QKFNTS077409@repo.freebsd.org>
References:  <201608262015.u7QKFNTS077409@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Friday, August 26, 2016 08:15:23 PM John Baldwin wrote:
> Author: jhb
> Date: Fri Aug 26 20:15:22 2016
> New Revision: 304858
> URL: https://svnweb.freebsd.org/changeset/base/304858
> 
> Log:
>   Enable I/O MMU when PCI pass through is first used.
>   
>   Rather than enabling the I/O MMU when the vmm module is loaded,
>   defer initialization until the first attempt to pass a PCI device
>   through to a guest.  If the I/O MMU fails to initialize or is not
>   present, than fail the attempt to pass a PCI device through to a
>   guest.
>   
>   The hw.vmm.force_iommu tunable has been removed since the I/O MMU is
>   no longer enabled during boot.  However, the I/O MMU support can be
>   disabled by setting the hw.vmm.iommu.enable tunable to 0 to prevent
>   use of the I/O MMU on any systems where it is buggy.
>   
>   Reviewed by:	grehan
>   MFC after:	1 week
>   Differential Revision:	https://reviews.freebsd.org/D7448

Forgot 'Sponsored by: Chelsio Communications'

Previously if you did the following:

# kldload vmm
# devctl set driver <some pci device> ppt

And then started a virtual machine that used ppt0 as a PCI
pass through device, the I/O MMU was never enabled.  The result
was that DMA requests for the PCI device weren't translated.  This
would cause the driver to not work in the guest and possibly trash
memory in either the guest or host.  Now the I/O MMU is always
enabled before passing a device to a guest, and if the I/O MMU
doesn't work for some reason, bhyve will fail to start the
guest.

-- 
John Baldwin



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