From: Gleb Natapov <gleb@redhat.com>
To: "Kevin O'Connor" <kevin@koconnor.net>
Cc: seabios@seabios.org, kvm@vger.kernel.org
Subject: Re: [PATCH] provide correct pci routing information in mptable
Date: Wed, 23 Dec 2009 22:35:55 +0200 [thread overview]
Message-ID: <20091223203555.GC30203@redhat.com> (raw)
In-Reply-To: <20091223202655.GA479@morn.localdomain>
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.
next prev parent reply other threads:[~2009-12-23 20:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-23 15:29 [PATCH] provide correct pci routing information in mptable Gleb Natapov
2009-12-23 18:11 ` Kevin O'Connor
2009-12-23 18:45 ` Gleb Natapov
2009-12-23 19:48 ` Kevin O'Connor
2009-12-23 19:56 ` Gleb Natapov
2009-12-23 20:26 ` Kevin O'Connor
2009-12-23 20:35 ` Gleb Natapov [this message]
2009-12-23 20:58 ` Kevin O'Connor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091223203555.GC30203@redhat.com \
--to=gleb@redhat.com \
--cc=kevin@koconnor.net \
--cc=kvm@vger.kernel.org \
--cc=seabios@seabios.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox