Page MenuHomeFreeBSD

bhyve: Don't log a warning when we fail to open /dev/pci
AbandonedPublic

Authored by markj on Fri, Jan 16, 4:29 PM.
Tags
None
Referenced Files
F143522647: D54739.diff
Fri, Jan 30, 8:10 PM
Unknown Object (File)
Sun, Jan 25, 6:19 PM
Unknown Object (File)
Sun, Jan 25, 11:21 AM
Unknown Object (File)
Sun, Jan 25, 11:21 AM
Unknown Object (File)
Sun, Jan 25, 10:17 AM
Unknown Object (File)
Sun, Jan 25, 8:21 AM
Unknown Object (File)
Sun, Jan 25, 6:40 AM
Unknown Object (File)
Wed, Jan 21, 9:24 PM

Details

Reviewers
bnovkov
Group Reviewers
bhyve
Summary

When running as an unprivileged user, we can't open /dev/pci for writing.
This isn't critical for bhyve operation, but there are many places where we
try to open it, so to avoid logging some scary-looking warnings, just silence
it in this case.

Diff Detail

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

Event Timeline

I did an initial smoke test for this phab stack and it worked for me..got a couple questions though

usr.sbin/bhyve/pci_passthru.c
198–201

hmm..wonder if this will break the gpu passthru bits?

host_read_config() proxies through ioctl(PCIOCREAD)..and PCIOCREAD requires a writable descriptor...

it appears the the existing gpu passthru bits rely on pci_host_read_config()

curious if the gpu bits should leverage passthru_read_config() using the global pcifd descriptor instead?

for what its worth i haven't experimented with gpu passthru yet

usr.sbin/bhyve/pci_passthru.c
198–201

Thanks for testing... you're right, for some reason I had convinced myself that PCIOCREAD was in the list of ioctls that pci_ioctl() explicitly lists as not requiring FWRITE. I'll retest and update the revision.

Always open /dev/pci read-write.

markj retitled this revision from bhyve: Open /dev/pci read-only when possible to bhyve: Don't log a warning when we fail to open /dev/pci.Mon, Jan 19, 2:21 PM
markj edited the summary of this revision. (Show Details)
markj marked an inline comment as done.

This isn't needed with D54851.