Re: KVM PCI device assignment issues

Greg KH
2009-02-13T16:56:15Z

On Fri, Feb 13, 2009 at 04:32:47PM +0000, Mark McLoughlin wrote:
> Driver Unbinding
> ================
>
> Before a device is assigned to a guest, we should make sure that no host
> device driver is currently bound to the device.
>
> We can do that with e.g.
>
> $> echo -n "8086 10de" > /sys/bus/pci/drivers/pci-stub/new_id
> $> echo -n 0000:00:19.0 > /sys/bus/pci/drivers/e1000e/unbind
> $> echo -n 0000:00:19.0 > /sys/bus/pci/drivers/pci-stub/bind
>
> One minor problem with this scheme is that at this point you can't
> unbind from pci-stub and trigger a re-probe and have e1000e bind to it.

Are you sure? It should work if you manually tell the e1000e driver to
bind to it, after unbinding it from the pci-stub driver.

> In order to support that, we need a "remove_id" interface to remove the
> dynamic ID.

Why?

> What we don't support is a way to unbind permanently. Xen has a
> pciback.hide module param which tries to achieve this, but you end up
> with the inevitable issues around making sure pciback is loaded before
> the device driver etc.

What do you mean, unbind "permanently"? For every reboot? Or just
within the same boot time?

thanks,

greg k-h