Page MenuHomeFreeBSD

vmm.4: Add ppt device detach example
ClosedPublic

Authored by christos on Sep 27 2024, 10:52 AM.
Tags
None
Referenced Files
F101994680: D46811.diff
Wed, Nov 6, 7:59 AM
Unknown Object (File)
Sun, Nov 3, 7:39 PM
Unknown Object (File)
Fri, Oct 25, 7:44 PM
Unknown Object (File)
Wed, Oct 23, 5:55 AM
Unknown Object (File)
Fri, Oct 18, 3:43 PM
Unknown Object (File)
Fri, Oct 18, 8:47 AM
Unknown Object (File)
Oct 2 2024, 5:44 AM
Unknown Object (File)
Oct 2 2024, 1:08 AM
Subscribers

Details

Summary

Showcase how to detach a PCI device from the hypervisor and attach it to
a host driver, and vice-versa.

MFC after: 2 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 59664
Build 56551: arc lint + arc unit

Event Timeline

share/man/man4/vmm.4
118

I would avoid mentioning "hypervisor", it's a bit confusing IMO. If you are swapping drivers like this, then no VMs can be using the device.

I would just note that you can detach a device from its host driver (e.g., xhci) and attach ppt instead, without rebooting. You can also set pptdevs hints after booting, using kenv(8).

share/man/man4/vmm.4
118

The main motivation behind this example is to show how to detach a device from ppt and attach it to a host driver, so I will keep the example as is, but improve the wording.

share/man/man4/vmm.4
118

To add to my comment: What the Wiki page on PCI-passthrough (https://wiki.freebsd.org/bhyve/pci_passthru), as well as the vmm(4) man page suggest, is to set "pptdevs" in loader.conf so that the PCI device is attached to ppt on boot. While this works fine, it is quite tedious to have to reboot in order to bring the device back to the host, hence why this example focuses on how to detach from ppt, instead of to ppt.

Looks ok, just a couple of nits.

share/man/man4/vmm.4
113
123

In FreeBSD terminology, it's the driver that attaches to the device, not the other way around.

christos marked 3 inline comments as done.

Address Mark's comments.

markj added inline comments.
share/man/man4/vmm.4
114
This revision is now accepted and ready to land.Oct 1 2024, 7:44 AM
This revision was automatically updated to reflect the committed changes.