Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
bind kernel driver to only one of two identical pieces of HW
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Atom2
Apprentice
Apprentice


Joined: 01 Aug 2011
Posts: 185

PostPosted: Tue May 02, 2017 11:29 pm    Post subject: bind kernel driver to only one of two identical pieces of HW Reply with quote

Hi guys,
Anybody knows how to restrict loading of a kernel device driver to only one of many (in my case two) identical pieces of PCIe cards installed in the system? To be more specific, I have two identical SAS controllers installed in my server. The first SAS controller is used to boot the system thus the driver for the card must be built into the kernel.

Now the built-in driver should however be restricted to only bind to the boot PCIe SAS device and not touch the second (identical) PCIe device. This second device will then be used to be passed through to a virtual machine once the system is up. Clearly the two devices can be distinguished by their unique <domain>:<bus>:<device>:<func> data displayed by lspci. I have however not found any way of providing this data to the in-kernel driver.

The kernel driver btw is the mpt3sas driver used for LSI cards.

Any insight into this would be appreciated.

Thanks Atom2
Back to top
View user's profile Send private message
R0b0t1
Apprentice
Apprentice


Joined: 05 Jun 2008
Posts: 255

PostPosted: Wed May 03, 2017 3:47 am    Post subject: Reply with quote

https://wiki.archlinux.org/index.php/PCI_passthrough_via_OVMF#Using_identical_guest_and_host_GPUs

You can pass a device through using bus address.
Back to top
View user's profile Send private message
Atom2
Apprentice
Apprentice


Joined: 01 Aug 2011
Posts: 185

PostPosted: Sun May 07, 2017 12:17 am    Post subject: Reply with quote

R0b0t1 wrote:
https://wiki.archlinux.org/index.php/PCI_passthrough_via_OVMF#Using_identical_guest_and_host_GPUs

You can pass a device through using bus address.
Thanks for the pointer, it was an interesting read, albeit mainly limited to GPUs for the relevant question. If I have correctly understood this, it would also require the driver to be available as a loadable kernel module and the BIOS of the card to support UEFI - both of which does not work/is not available with my SATA/SAS controller the system is booted from.

The passthrough as such is something I do know how to do (i.e. using the bus address as listed by lspci).

Thanls Atom2
Back to top
View user's profile Send private message
R0b0t1
Apprentice
Apprentice


Joined: 05 Jun 2008
Posts: 255

PostPosted: Sun May 07, 2017 2:12 am    Post subject: Reply with quote

Atom2 wrote:
R0b0t1 wrote:
https://wiki.archlinux.org/index.php/PCI_passthrough_via_OVMF#Using_identical_guest_and_host_GPUs

You can pass a device through using bus address.
Thanks for the pointer, it was an interesting read, albeit mainly limited to GPUs for the relevant question. If I have correctly understood this, it would also require the driver to be available as a loadable kernel module and the BIOS of the card to support UEFI - both of which does not work/is not available with my SATA/SAS controller the system is booted from.

The passthrough as such is something I do know how to do (i.e. using the bus address as listed by lspci).

Thanls Atom2


It is specific to GPUs but I was hoping the instructions would generalize well; you might refer to QEMU's documentation for PCIe passthrough. I suspect it shares some design with the USB interface which does allow the equivalent of what you want.

Is the main compatibility the use of UEFI? Per my experience doing that with graphics cards the only thing the OVMF firmware is needed for is to keep the passthrough from silently failing - if you are doing it with non VGA devices it should simply work. The other incompatibility, if the driver must be a module, may not be possible to work around. In that case you might need a ramdisk. You should link this thread in #gentoo on irc.freenode.net:6697 if you don't get more replies in a timely fashion.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum