From nobody Sun Oct 20 11:21:52 2024 X-Original-To: dev-commits-src-all@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 4XWbcc3S0Rz5Yvp0; Sun, 20 Oct 2024 11:21:52 +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 4XWbcc1tcXz4XSb; Sun, 20 Oct 2024 11:21:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729423312; 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=m1G29NWlXfgf5iLMDi1nLgapP78GuDPNULu+ZKGWXBY=; b=gvSgOgYogDqr/bgfrwB/tdpnihFQNSU4bA5zxc/JkV7wrpDcRyljJpsL3gsFTapWJghrga 2XcUxJwywovb8NMOeAUJdTrtYTiJKtdYcP+UiehD0MbDSpLjzTV7A0DQwVXZxbzBIpD1da Hh38M2f+MaLDfTH6+zIQCQag1/FKyMsxztNUb+GytPJ+YsgalumSSwBOR73VcnwNyFT9JK uJh3Z/VWdzUFfPXMVnv5bSGthm7q/NzEsB6k2L/8fck9Igdes9LggwQf2WpsPM8OqnTIsQ KRMccwOcCosQ+quMuUQZ9Jrd3sC8DOggzlmkEywm5KNLocaD/cRs2mczV9O0Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729423312; 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=m1G29NWlXfgf5iLMDi1nLgapP78GuDPNULu+ZKGWXBY=; b=oFQZUSHT4Sbh596pEt9zY9bCo9PRlykaTxOQaG8PNUB2neH8LRNo4HJSAwRkSY7sFBH3V6 wCNDnfOJYLIVdjS4Eqx0vnzqDziX71858DS9f3p3VxXZ0FPhWuC+q2ke2+v7hmeEvCspmW q9xFbRe4y+5/9yUn63pPcD6eBWtLXscLAj3EZzYfWE5RjFKs6sH+GfhY+iyrIv7QliKD/E rOuQUhmHkaQwlUeiLuTNKoq02VK5EedsH7++KIGpolYV6esXtwjVZOO2nLzUln4h1C4SN+ p4B2HrK7axQkcACuqC9j0rYZ/L6kiov4KSS/JH66WwpcEPCR/QaeOLEvvyugdQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729423312; a=rsa-sha256; cv=none; b=cStm3kmwkQ5Ir+Lnz9mxW6CdrD7EksaWrdAv8Ike7090mn7Yc3KHiA4jd4vDgvbBKSD81C Ms2iefx4OQkacKXEXRaHZu4epWjnFD5Q8cdMGrtEDgaw4wz3/j2gItWC6WALXNV4e4iJ/Q 3iW7g5mG7D46CqhmriesNpdHrmroC04m7R16JkRGYatgUiewjJ1Nc1jRQqHxnGRRYOlrIt e9TVrPQwmMnpn2/4IbxPIdTJNoIgeXb8XbLn54a5BdYMDdgjIaPkItU2jCrudH2fmyzCZ4 sjjr6e2+MLnl/8KKfalFOfBpeNrtjyNIHnmC/1QZ1d5bv+ifR3GKyLh4rlpyBA== 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 4XWbcc1W0Kz103G; Sun, 20 Oct 2024 11:21:52 +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 49KBLq21064398; Sun, 20 Oct 2024 11:21:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49KBLqgM064395; Sun, 20 Oct 2024 11:21:52 GMT (envelope-from git) Date: Sun, 20 Oct 2024 11:21:52 GMT Message-Id: <202410201121.49KBLqgM064395@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 1a8cd08d8ae6 - stable/14 - vmm.4: Add ppt device detach example List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 1a8cd08d8ae6ad40405c2c0fd4199c01d9e9353b Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=1a8cd08d8ae6ad40405c2c0fd4199c01d9e9353b commit 1a8cd08d8ae6ad40405c2c0fd4199c01d9e9353b Author: Christos Margiolis AuthorDate: 2024-10-18 08:42:05 +0000 Commit: Christos Margiolis CommitDate: 2024-10-20 11:21:06 +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 (cherry picked from commit 9ad2891558729b1c1ad4ba02377b157e404a3da2) --- 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