tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: basic support for (software concept) "pci domains" in the MI pci code



On Monday 24 August 2009 13:47:28 Manuel Bouyer wrote:
> On Mon, Aug 24, 2009 at 12:54:37PM +0200, Christoph Egger wrote:
> > On Monday 24 August 2009 11:58:46 Manuel Bouyer wrote:
> > > On Mon, Aug 24, 2009 at 11:47:59AM +0200, Christoph Egger wrote:
> > > > In newer Xen versions, PCI passthrough works this way:
> > > >
> > > > xm help  enlists these commands:
> > > >
> > > >  pci-attach           Insert a new pass-through pci device.
> > > >  pci-detach           Remove a domain's pass-through pci device.
> > > >  pci-list                  List pass-through pci devices for a
> > > > domain. pci-list-assignable-devices   List all the assignable pci
> > > > devices
> > > >
> > > >
> > > > 1. Enlist all PCI devices you may assign a domU
> > > >
> > > > # xm pci-list-assignable-devices
> > > > 0000:02:00.0
> > > > 0000:02:00.1
> > > >
> > > > 2. Assign these two devices to the first domU
> > > >
> > > > # xm pci-attach 1 0000:02:00.0
> > > > # xm pci-attach 1 0000:02:00.1
> > > >
> > > > 3. List devices assigned to first domU
> > > >
> > > > # xm pci-list 1
> > > > VSlt domain bus  slot func
> > > > 0x06 0x0000 0x02 0x00 0x0
> > > > 0x07 0x0000 0x02 0x00 0x1
> > > >
> > > > "VSlt" is the "virtual slot"
> > >
> > > I can't see wht this can't work with NetBSD now, as this uses the same
> > > infos as Xen 3.1. domain is hardwired to 0, and we can get bus, slot
> > > and func from the kernel though pcictl. The patch I added to xentools3
> > > just needs to be ported to xentools33. As I don't speak python I can't
> > > easily do it myself ...
> >
> > There are machines with multiple PCI host controllers.
> > Let's take the PCI topology on your alpha as an example:
> >
> > tsc0 at mainbus0: 21272 Core Logic Chipset, Cchip rev 0
> > tsc0: 4 Dchips, 1 memory bus of 32 bytes
> > tsc0: arrays present: 1024MB (split), 0MB, 0MB, 0MB, Dchip 0 rev 1
> > tsp0 at tsc0
> > pci0 at tsp0 bus 0
> > tsp1 at tsc0
> > pci1 at tsp1 bus 0
> >
> > With PCI domains hardwired to 0, xm pci-list-assignable-devices can print
> >
> > 0000:00:00.0
> > 0000:00:00.0
>
> Or
> 0000:00:00.0
> 0000:01:00.0
>
> as you can use the autoconfig index as bus number.

That would interfere with devices which are physically on this bus number.

> Also I'm not sure we can have the same bus number twice on x86 these
> days, because the BIOS needs the bus number to be unique AFAIK.

Yes, this can be on x86 where you need 'options ACPI_SCANPCI' to have the 
kernel to find all PCI devices.

Christoph


Home | Main Index | Thread Index | Old Index