git: 9ad289155872 - main - vmm.4: Add ppt device detach example

From: Christos Margiolis <christos_at_FreeBSD.org>
Date: Fri, 18 Oct 2024 08:45:13 UTC
The branch main has been updated by christos:

URL: https://cgit.FreeBSD.org/src/commit/?id=9ad2891558729b1c1ad4ba02377b157e404a3da2

commit 9ad2891558729b1c1ad4ba02377b157e404a3da2
Author:     Christos Margiolis <christos@FreeBSD.org>
AuthorDate: 2024-10-18 08:42:05 +0000
Commit:     Christos Margiolis <christos@FreeBSD.org>
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