From owner-svn-src-all@freebsd.org Fri Aug 26 23:18:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42FDBB76B3E; Fri, 26 Aug 2016 23:18:20 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2478BFA3; Fri, 26 Aug 2016 23:18:20 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 11868B953; Fri, 26 Aug 2016 19:18:19 -0400 (EDT) From: John Baldwin 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 Date: Fri, 26 Aug 2016 13:18:43 -0700 Message-ID: <1696735.VsWPYRr5di@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.3-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201608262015.u7QKFNTS077409@repo.freebsd.org> References: <201608262015.u7QKFNTS077409@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 26 Aug 2016 19:18:19 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 23:18:20 -0000 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 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