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)
Dec 15 2022, 4:18 PM
Unknown Object (File)
Dec 15 2022, 7:35 AM
Unknown Object (File)
Dec 13 2022, 11:02 AM
Unknown Object (File)
Dec 13 2022, 10:47 AM
Unknown Object (File)
Dec 13 2022, 10:42 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
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.