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
Unknown Object (File)
Mon, Mar 4, 6:01 AM
Unknown Object (File)
Mon, Mar 4, 6:00 AM
Unknown Object (File)
Mon, Mar 4, 5:57 AM
Unknown Object (File)
Sun, Mar 3, 3:38 AM
Unknown Object (File)
Dec 20 2023, 3:00 AM
Unknown Object (File)
Dec 11 2023, 12:41 AM
Unknown Object (File)
Nov 22 2023, 12:28 PM
Unknown Object (File)
Nov 22 2023, 12:28 PM
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
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.