Page MenuHomeFreeBSD

Add NO_LEGACY_PCIB kernel option to i386, amd64
ClosedPublic

Authored by cperciva on Jul 13 2022, 12:46 AM.
Tags
None
Referenced Files
F106226466: D35798.diff
Fri, Dec 27, 12:36 PM
Unknown Object (File)
Sun, Dec 8, 12:29 AM
Unknown Object (File)
Nov 26 2024, 10:01 AM
Unknown Object (File)
Nov 25 2024, 10:04 PM
Unknown Object (File)
Nov 23 2024, 9:20 PM
Unknown Object (File)
Nov 22 2024, 11:35 PM
Unknown Object (File)
Nov 22 2024, 6:48 AM
Unknown Object (File)
Nov 21 2024, 8:08 AM
Subscribers

Details

Summary

On systems without a PCI bus, legacy_pcib_identify by default creates
one anyway:

legacy_pcib_identify: no bridge found, adding pcib0 anyway

This commit adds a kernel option NO_LEGACY_PCIB which disables this,
allowing systems to be fully PCI-free.

Sponsored by: https://www.patreon.com/cperciva

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 46398
Build 43287: arc lint + arc unit

Event Timeline

though maybe just remove it entirely?
Or fix the test to not make it when there's pcie in the system?

This revision is now accepted and ready to land.Jul 13 2022, 12:55 AM

I wasn't sure if this code was needed any more, so I figured adding an option to hide it was better than removing it entirely.

Simply turning it off when we have PCIE is a non-starter: The same system where I don't have a PCI bridge (running inside the Firecracker VM) also doesn't have PCIE.

jrtc27 added inline comments.
sys/x86/pci/pci_bus.c
491

Why not ifndef out the if and comment? Leaving the comment outside the ifndef, and an empty block, makes it seem like something is still done in the legacy pcib case.

sys/x86/pci/pci_bus.c
491

If I remove the if then the compiler complains that found is being set but not used I figured this was cleaner than sprinkling more ifndefs throughout the function.