Page 1 of 1

PCI wiki

Posted: Sat Feb 06, 2021 5:05 pm
by 8infy
Hi, I have a few questions about PCI and the wiki article about it.

1. The wiki says
If it is a multifunction device, then bus 0, device 0, function 0 will be the PCI host controller responsible for bus 0; bus 0, device 0, function 1 will be the PCI host controller
responsible for bus 1, etc (up to the number of functions supported).
Does this imply there can only be at most 8 host controllers? Since there can only be 8 functions. Or is this completely wrong?

2. Have you ever seen a computer where there's multiple host controllers?
3. Let's imagine we have host controller function 0 and host controller function 1, (so bus 0 and 1) and we do recursive scan on both. Is it possible
that we would find a pci-to-pci bridge that leads to one of the busses already covered by a different host controller? In other words can we
encounter the same bus twice?
4. For PCIe, could different segment groups also have multiple host controllers? How bad can it get?

I tried downloading the official PCI/PCIe spec but it's behind a paywall :(

Thanks :D

Re: PCI wiki

Posted: Sat Feb 06, 2021 5:49 pm
by wxwisiasdf
Yes, as im aware, a multifunction root device: each functions represents a bus; same with bridges.

Yes those computers exist, mostly servers.

PCIe: I have personally not messed with x86 but i can assume that each segment can have multiple multifunction root devices.

If you need the spec it's here https://web.archive.org/web/20180517113 ... on_3.0.pdf

Edit: each segment can have it's own root device

Re: PCI wiki

Posted: Sat Feb 06, 2021 10:29 pm
by nullplan
8infy wrote:How bad can it get?
Every combination of segment, bus, device, and function can have a device attached. You get the valid segments and valid root buses from ACPI, and can find more buses by enumerating bridges. You have to search through the devices, though, and the functions, too, should a device claim to be multifunction. I would counsel against initializing PCI bridges: BIOS must already do this, and do this correctly, so no need for you to get involved. You just read the bus numbers from their configuration. Unless you have need of the VGA compatibility mode, you have little reason to actually keep track of the topology. The only thing that should matter to you is what address to reach the actually important devices under.

Re: PCI wiki

Posted: Mon Feb 08, 2021 7:41 am
by eekee
8infy wrote:2. Have you ever seen a computer where there's multiple host controllers?
Yes. In the dim and distant past, the vast majority of PCs had at least 2: one for the AGP port (remember that?) and one for the regular PCI bus. (The AGP port appeared to software to be a PCI bus.)

Re: PCI wiki

Posted: Mon Feb 08, 2021 10:27 am
by 8infy
Thanks for the answers everyone!

Re: PCI wiki

Posted: Mon Feb 08, 2021 10:29 am
by 8infy
eekee wrote:
8infy wrote:2. Have you ever seen a computer where there's multiple host controllers?
Yes. In the dim and distant past, the vast majority of PCs had at least 2: one for the AGP port (remember that?) and one for the regular PCI bus. (The AGP port appeared to software to be a PCI bus.)
Good to know, thanks! Did it actually appear under bus 0 device 0 function 1? Was bus 0 connected to it (or maybe vise versa)?

Re: PCI wiki

Posted: Mon Feb 08, 2021 6:37 pm
by eekee
I can't remember which was which now, and the hardware is long since gone. Sorry!