Hotplug of root PCI buses

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

 



As mentioned in a message a couple of months ago, I'm building a front-end driver which makes a root PCI bus appear in a Hyper-V VM, whenever a user decides to pass through a device.  This can happen while the VM runs, as when SR-IOV networking becomes available (maybe the VM migrated to a host which had free Virtual Functions) or when the user decides to pass through a discrete physical device.

In Hyper-V, this is modeled as mapping a single function (unless the device itself is made up of multiple inseparable functions) into the VM, without any surrounding emulation of a root PCI bus or any bridges.  In software, this looks like a new root PCI bus had been added to the system, with its own region of memory space, and a single device sits on it, the one that has been passed through.

My question is about how resources are assigned to PCI devices in Linux.  What I'm seeing is a failure to bring the device's driver into the working state because the BARs of the device are zeroed.  An example error message looks like this:

[  190.960703] megaraid_sas 8e1b:00:00.0: can't enable device: BAR 1 [mem 0x00000000-0x00003fff 64bit] not claimed

What is supposed to trigger the resource assignment code?  I see it in the code base, called when a hot-plug bridge brings a new device on line.  But I'm not sure how or when I should attempt to trigger it when I'm essentially hot-plugging a root bus.

If anybody has any suggestion about how I should approach this problem architecturally, I would appreciate that.

Thanks,
Jake Oshins
Microsoft

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux