Page MenuHomeFreeBSD

bhyve: Use PCIOCGETCONF to find the host LPC bridge
ClosedPublic

Authored by markj on Fri, Jan 23, 10:31 PM.
Tags
None
Referenced Files
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
Unknown Object (File)
Mon, Jan 26, 2:21 AM
Unknown Object (File)
Sun, Jan 25, 6:25 PM
Unknown Object (File)
Sun, Jan 25, 12:47 PM
Unknown Object (File)
Sun, Jan 25, 11:24 AM
Unknown Object (File)
Sun, Jan 25, 7:04 AM
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