Page MenuHomeFreeBSD

bhyve: Use PCIOCGETCONF to find the host LPC bridge
ClosedPublic

Authored by markj on Jan 23 2026, 10:31 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Feb 24, 6:32 PM
Unknown Object (File)
Sun, Feb 22, 4:44 AM
Unknown Object (File)
Sat, Feb 21, 6:27 PM
Unknown Object (File)
Tue, Feb 17, 5:34 AM
Unknown Object (File)
Sat, Feb 7, 6:47 PM
Unknown Object (File)
Tue, Feb 3, 2:37 AM
Unknown Object (File)
Sat, Jan 31, 8:16 AM
Unknown Object (File)
Fri, Jan 30, 5:28 PM
Subscribers

Details

Summary

pci_host_read_config() requires write access to /dev/pci so cannot be
used with unprivileged bhyve. The lpc init code uses it to find the
host system's LPC bridge device and so was generating warnings with
bhyve running as a non-root user.

Refactor the implementation to use PCIOCGETCONF instead, which doesn't
require any special privileges. This isn't formally necessary, as we
only care about copying the host system's identifiers in order to
support Intel GPU passthrough (see commit f4ceaff56ddaa), but it's
straightforward and lets an unprivileged user run bhyve without seeing
warnings about failing to open /dev/pci with write permissions.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable