[SeaBIOS] [PATCH] Don't overallocate mptable

Kevin O'Connor kevin at koconnor.net
Thu Dec 24 18:22:12 CET 2009

On Thu, Dec 24, 2009 at 06:54:55PM +0200, Gleb Natapov wrote:
> On Thu, Dec 24, 2009 at 11:38:45AM -0500, Kevin O'Connor wrote:
> >      foreachpci(bdf, max) {
> > +        if (pci_bdf_to_bus(bdf) > 0)
> > +            break;
> mptable routing info should be created for each pci bus.

My read of the spec is that independent PCI buses need to be added to
the MPTable, but a bus created due to a PCI-to-PCI bridge (eg, on an
add-on card) need not go into the table.

> See example here:
> http://people.freebsd.org/~fsmp/SMP/mptable/t30

In that example, it looks like the machine has two independent buses -
note how bus 1 has more than four irqs - so it can't be an add-on

> Hmm. It looks like we need to create io_bus entries dynamically 
> for each newly discovered PCI bus.

Right now, the pciinit.c code handles neither PCI-to-PCI bridges nor
independent PCI bridges.  I think it would be useful to support
bridges (for mapping in add-on cards that have them), but I don't know
why an emulator would want to have independent buses.  Note that it's
difficult to detect an independent bus - some sideband mechanism is
needed (eg, see CONFIG_PCI_ROOT1 in src/config.h).


More information about the SeaBIOS mailing list