From owner-svn-src-head@freebsd.org Tue Sep 6 21:29:53 2016 Return-Path: Delivered-To: svn-src-head@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 06588BCD4F8; Tue, 6 Sep 2016 21:29:53 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (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 D7AD2BB9; Tue, 6 Sep 2016 21:29:52 +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 mail.baldwin.cx (Postfix) with ESMTPSA id 4BF3710AF39; Tue, 6 Sep 2016 17:29:45 -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: r305502 - in head: share/man/man9 sys/amd64/vmm/io sys/dev/pci Date: Tue, 06 Sep 2016 14:29:40 -0700 Message-ID: <1571206.j1ezrSnmG7@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-PRERELEASE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201609062115.u86LFZaU030916@repo.freebsd.org> References: <201609062115.u86LFZaU030916@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.4.3 (mail.baldwin.cx); Tue, 06 Sep 2016 17:29:45 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Sep 2016 21:29:53 -0000 On Tuesday, September 06, 2016 09:15:35 PM John Baldwin wrote: > Author: jhb > Date: Tue Sep 6 21:15:35 2016 > New Revision: 305502 > URL: https://svnweb.freebsd.org/changeset/base/305502 > > Log: > Reset PCI pass through devices via PCI-e FLR during VM start and end. > > Add routines to trigger a function level reset (FLR) of a PCI-express > device via the PCI-express device control register. This also includes > support routines to wait for pending transactions to complete as well > as calculating the maximum completion timeout permitted by a device. > > Change the ppt(4) driver to reset pass through devices before attaching > to a VM during startup and before detaching from a VM during shutdown. With the recent fixes, it should (in theory) be safe to do something like: kldload vmm iovctl -C -f /path/to/iovctl.conf devctl set driver ppt vmrun.sh -p And have it work correctly, including if you hotplug or create new VFs after an initial VM is running/has run, or you delete a VF, etc. FLR should (in theory) make VMs with pass through devices a bit more robust if they do not cleanly shutdown the device hardware. I also have some thoughts (still kicking around in my head) about adding a 'devctl reset' command. In particular the trickier case is what to do for attached devices (I think we suspend / resume devices around reset perhaps). Also, there are different ways you can trigger a PCI reset that we should eventually support. -- John Baldwin