[SeaBIOS] [PATCH] provide correct pci routing information in mptable

Gleb Natapov gleb at redhat.com
Wed Dec 23 21:35:55 CET 2009


On Wed, Dec 23, 2009 at 03:26:55PM -0500, Kevin O'Connor wrote:
> On Wed, Dec 23, 2009 at 09:56:23PM +0200, Gleb Natapov wrote:
> > On Wed, Dec 23, 2009 at 02:48:24PM -0500, Kevin O'Connor wrote:
> > > On Wed, Dec 23, 2009 at 08:45:07PM +0200, Gleb Natapov wrote:
> > > > On Wed, Dec 23, 2009 at 01:11:43PM -0500, Kevin O'Connor wrote:
> > > > > Why only increase the allocated storage for intsrc by 16?  The loop
> > > > > above seems like it could add a large number of entries.
> > > > > 
> > > > Unfortunately we have to allocate all memory in advance. The table can
> > > > have max 4 entries per device (one entry for each pin), so 16 is enough
> > > > for 4 devices.
> > > 
> > > Yeah - I suppose the table could be built in temp space and then
> > > copied into the f-segment when the actual size is known.
> > > 
> > Yes, and this is not the only table that needs it. Lets assume 16
> > entries for now  for simplicity.
> 
> The mptable is the only variable length table stored in the
> f-segment.  I can add the table copying though.
> 
Ah, OK.

> BTW, this is only intended for PCI bus zero entries, right?  (In
> theory, one could map a card with a bridge into kvm..)
> 
Mptable should have description for each PCI bus. Devices behind PCI
bridge are still on the same bus.

> > > > > Also, the foreachpci() macro will iterate over every PCI function -
> > > > > there could be 8 functions to a pci device which could lead to
> > > > > duplicates in the table (two pci functions on the same device could
> > > > > use the same irq pin).
> > > > > 
> > > > Yes, correct. Need to rework this loop.
> > > 
> > > Sounds like it should find every function 0 pci entry and then loop
> > > over the four possible pins?
> > > 
> > Each function connected only to one pin. It needs to loop over all
> > function on a device and record pins that it creates entry for. If the
> > same pin is used by more then one function of a device the record will
> > be checked and second entry will not be created.
> 
> I believe the intent of the irq routing in the mptable is to tell the
> OS what the pci pins are routed to so that it can change the irq to a
> different pin.  If only one pin is described, the OS wont be able to
> switch to a different pin.
> 
Each function hardwired to one pin only. It is impossible to change the
pin. It is possible to route it to a different gsi though. Mptable maps
pins of each device to gsis.

--
			Gleb.



More information about the SeaBIOS mailing list