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

Re: [Xen-devel] xensource (pci) device id's?

Ian Campbell wrote:
> On Thu, 2007-02-01 at 12:02 -0800, Zulauf, John wrote:
>> If we change all the PCI vendor ID's for the virtualized devices, how
>> will the OS find the correct driver in standard HVM systems? 
> Gerd is proposing to change the subvendor/subdevice ID's which is
> different to the regular vendor/device ID.
> The purpose of the subvendor/subdevice ID is to allow manufacturers to
> take an existing PCI device chipset (with a given vendor/device ID burnt
> in) and incorporate it into a card of their own. They can then use their
> own subvendor/subdevice ID for this card and presumably have their own
> driver match on these IDs rather than the more generic ones to offer
> advanced functionality which is dependant on the board not the chipset
> etc.
> Linux at least matches primarily on the vendor/device IDs with
> subvendor/subdevice set to match anything so we would be OK here.

No.  It fully depends on the driver.

> From
> include/linux/pci.h here is the macro typically used by drivers:
>         #define PCI_DEVICE(vend,dev) \
>                 .vendor = (vend), .device = (dev), \
>                 .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID

You *can* specify subvendor IDs too.  If you do so linux will match only
devices where both normal and subsystem ID match.  And I think they are
even preferred over more generic (without subsystem) matches, at least
when it comes to module loading.

Adding a subsystem ID makes it possible for the guest OS to use a
different driver for the virtual device.  Without special hooks needed,
the normal device probing works just fine for that purpose then.  If no
special driver is available the generic chipset driver will be used.


Gerd Hoffmann <kraxel@xxxxxxx>

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.