prepopulate_bars(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay bestie, welcome to prepopulate_bars(9) from the Kernel API Manual β€” the page where we fill in BARs with defaults, and honestly it’s giving β€œmake the PCI core happy” energy πŸ’…βœ¨

πŸ’– NAME πŸ’–

prepopulate_bars - Fill in BARs with defaults 🌸

✨ SYNOPSIS ✨

void prepopulate_bars (struct hv_pcibus_device *hbus );

πŸŽ€ ARGUMENTS πŸŽ€

  • hbus β€” Root PCI bus, as understood by this driver 🫢

🌸 DESCRIPTION 🌸

okay so here’s the vibe: the core PCI driver code seems much, much happier if the BARs for a device have values upon first scan. So we fill them in. no cap, that’s the assignment πŸ’œ

The algorithm below works down from large sizes to small, attempting to pack the assignments optimally β€” it’s lowkey doing a little packing puzzle 🧩✨

And here’s the assumption, enforced in other parts of the code: the beginning of the memory-mapped I/O space will be aligned on the largest BAR size. periodt. Don’t forget it, bestie πŸ’…

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file: ./drivers/pci/controller/pci-hyperv.c β€” here’s the whole friend group, iykyk:


πŸ’… final sign-off: this page’s source/version is ./drivers/pci/controller, the date is October 2026, and the manual page is prepopulate_bars(9). bye bestie, go fill those BARs 🫢✨

πŸ“¦ where this page comes from