From nobody Fri Oct 18 08:45:13 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XVJDn3MBjz5YwkR; Fri, 18 Oct 2024 08:45:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XVJDn2ML4z4mbW; Fri, 18 Oct 2024 08:45:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729241113; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1bFdvRYfRqwefGqxd4Zf/bcvyCOM7T422Fs5Kq90yEU=; b=YFAx5N83AX/HXE+uUndcFT0T/Iu/FaZeTLdkFz65BDmEr2ezVWoIpdMRvwQ/H5EZ5I2J2G 7ZkHSqLec0r62ri30EPEaA18s8E9mHlOVrppmNo1FWB7pg1uycTUg+EWBtM/B9XI8KEL44 1fRcOFqpy+GxOEx/5fZVDp6eI2kR9m4TEYRjhEEk721UltxT+fOb8xaMsKfWs7L0CaBvRo cP11/Ou7O3sNXVSIzT0KZe9xaCZv+9aJH0jOAyhBuIvxM8/72Y7euhOikkvDhQjaFcdFbu 7fd5EkDMloco3NkWimTT5jueb9c3ucHUVax4aBnhmNQxha5KO6m2rQxGNCxHMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729241113; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1bFdvRYfRqwefGqxd4Zf/bcvyCOM7T422Fs5Kq90yEU=; b=Rr1sxl/RDD1sND+6i4rSQi5uhAA4nmEWenl9RRbL05+TFNso5jGFGRhMTRq+Us7xudm54N /S9OyD7Zbb7ogGQbLISD9EfrDn0Y2TG09FaETKZsA6pYjD8y/PSpo71DC4+OuFg8Y08Zz4 dic5dwB7yYgbW6VcFSIco6SaGhB2PQdbOIvBdTd13cL7291hESRhNgYCHcdh8eSs7TjDfd PHhDRHTit21XZXYHA7Us+f6DsDlvsbmBvjmB3npX2JQToFgxJRvrx6sQQ9Iv0Ju2abz4tS mX4OjBvQasmVczNYaOGCfZwnPf0Q6H+fy0Olb4t6t7UuMMYyKuo2VDj3Ykj4Eg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729241113; a=rsa-sha256; cv=none; b=JNPF5q3aVQQxKDVPAODTLSZMKLHcQsDz5mJllwzYAcU+6ZwsBZrvoCuZhpPUGDnc2+ik42 NjHZ5nxO6FzOFsQIl6ZHmwYd2AsGNYegz3ZGMcbY7+qbiZDAePWAzO46Rd8q8nDKE4APev 0F3/HXQktOHKVF1GchtvpGKtotA8YWrzjdL42e30dt8Nyzwz5Bv8ZqH57oQuJFfYvR29cd GFQzSSBffbl8FVuCvZm284jDoeCHG+cEuh3K21E/HN+TIiJkxdFsP/8esT16qWXpUO84nO Ky1gOrrapUl383jXH1L5jCq1HmSpokE131tfNkj8mcVqb6NL2cGkS25e1EJ/bQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XVJDn1zS7zR3S; Fri, 18 Oct 2024 08:45:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49I8jDPg088683; Fri, 18 Oct 2024 08:45:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49I8jD3u088680; Fri, 18 Oct 2024 08:45:13 GMT (envelope-from git) Date: Fri, 18 Oct 2024 08:45:13 GMT Message-Id: <202410180845.49I8jD3u088680@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 9ad289155872 - main - vmm.4: Add ppt device detach example List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9ad2891558729b1c1ad4ba02377b157e404a3da2 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=9ad2891558729b1c1ad4ba02377b157e404a3da2 commit 9ad2891558729b1c1ad4ba02377b157e404a3da2 Author: Christos Margiolis AuthorDate: 2024-10-18 08:42:05 +0000 Commit: Christos Margiolis CommitDate: 2024-10-18 08:42:05 +0000 vmm.4: Add ppt device detach example Showcase how to detach ppt from a PCI device and attach a host driver, and vice-versa. MFC after: 2 days Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D46811 --- share/man/man4/vmm.4 | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/share/man/man4/vmm.4 b/share/man/man4/vmm.4 index dfd7ad26fb98..7e4c9050021a 100644 --- a/share/man/man4/vmm.4 +++ b/share/man/man4/vmm.4 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd March 6, 2024 +.Dd September 27, 2024 .Dt VMM 4 .Os .Sh NAME @@ -108,11 +108,36 @@ bus 6 slot 5 function 0, and bus 6 slot 5 function 1. .Bd -literal -offset indent pptdevs="10/0/0 6/5/0 6/5/1" .Ed +.Pp +It is possible to detach +.Va ppt +from a PCI device without rebooting the host machine and then attach a host +driver, using the +.Xr devctl 8 +utility. +Suppose +.Va ppt +is currently attached to +.Va pci0:0:1:0 +and we want the host's +.Xr xhci 4 +driver to be attached instead: +.Bd -literal -offset indent +# devctl set driver -f pci0:0:1:0 xhci +.Ed +.Pp +The same can be applied to attach +.Va ppt +back: +.Bd -literal -offset indent +# devctl set driver -f pci0:0:1:0 ppt +.Ed .Sh SEE ALSO .Xr bhyve 4 , .Xr loader.conf 5 , .Xr bhyve 8 , .Xr bhyveload 8 , +.Xr devctl 8 , .Xr kldload 8 .Sh HISTORY .Nm vmm.ko