Xen PCI Passthrough: Difference between revisions

From Alpine Linux
m (Categorized: Virtualization)
No edit summary
Line 1: Line 1:
This guide is to show how to configure PCI Passthrough on Alpine.
This guide is to show how to configure PCI Passthrough on Alpine.


First use lspci to find out what PCI-Address the Device that you want to Passthrough has:
First, use lspci to find the the PCI-Address of the Device you want to Passthrough:
<pre>
<pre>
node03:~# lspci
node03:~# lspci
Line 19: Line 19:
</pre>
</pre>


In my case i want to passthrough the SAS Controller so the Address is 01:00.0
In this example, I want to passthrough the SAS Controller. So the Address is 01:00.0
Currently there is a bug [http://bugs.alpinelinux.org/issues/3609 #3609]in Alpine due to which we can't use the Default way to use Kernelparameters for it.
Currently there is a bug [http://bugs.alpinelinux.org/issues/3609 #3609]in Alpine that prevents using default Kernelparameters.


Edit /etc/modules and reboot the server:
Edit /etc/modules and reboot the server:
Line 28: Line 28:
</pre>
</pre>


After a reboot you should be able to see that the pci-device is using the pciback Kernelmodule and should be visible to passthrough via xl:
After rebooting, you should be able to verify the pci-device is using the pciback Kernelmodule and that it's visible to passthrough via xl:
<pre>
<pre>
node03:~# lspci -k | grep -A2 '01:00.0'
node03:~# lspci -k | grep -A2 '01:00.0'
Line 38: Line 38:
</pre>
</pre>


Now just add a line to your DomU's Config and everything should be fine.
Add the following line to your DomU's Config:
<pre>
<pre>
pci = [ '01:00.0' ]
pci = [ '01:00.0' ]
Line 45: Line 45:
====Known Issue with LSI Controllers====
====Known Issue with LSI Controllers====
As the Kernelmodule for LSI Controllers is built into the Alpine Initramfs, the real Module is loaded before the pciback Module can be assigned.
As the Kernelmodule for LSI Controllers is built into the Alpine Initramfs, the real Module is loaded before the pciback Module can be assigned.
Just blacklist the mpt2sas module in /etc/modprobe.d/blacklist.conf and rebuilt your initramfs.
<BR>You'll need to blacklist the mpt2sas module in /etc/modprobe.d/blacklist.conf and rebuild your initramfs.
<pre>
<pre>
node03:~# grep sas /etc/modprobe.d/blacklist.conf  
node03:~# grep sas /etc/modprobe.d/blacklist.conf  

Revision as of 16:04, 6 August 2021

This guide is to show how to configure PCI Passthrough on Alpine.

First, use lspci to find the the PCI-Address of the Device you want to Passthrough:

node03:~# lspci
00:00.0 Host bridge: Intel Corporation Xeon E3-1200 Processor Family DRAM Controller (rev 09)
00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (rev 05)
00:1a.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 05)
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b5)
00:1c.4 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5 (rev b5)
00:1d.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 05)
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev a5)
00:1f.0 ISA bridge: Intel Corporation C204 Chipset Family LPC Controller (rev 05)
00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family SATA AHCI Controller (rev 05)
00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 05)
01:00.0 Serial Attached SCSI controller: LSI Logic / Symbios Logic SAS2008 PCI-Express Fusion-MPT SAS-2 [Falcon] (rev 03)
02:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection
03:03.0 VGA compatible controller: Matrox Electronics Systems Ltd. MGA G200eW WPCM450 (rev 0a)

In this example, I want to passthrough the SAS Controller. So the Address is 01:00.0 Currently there is a bug #3609in Alpine that prevents using default Kernelparameters.

Edit /etc/modules and reboot the server:

node03:~# grep pciback /etc/modules 
xen_pciback hide=(01:00.0)

After rebooting, you should be able to verify the pci-device is using the pciback Kernelmodule and that it's visible to passthrough via xl:

node03:~# lspci -k | grep -A2 '01:00.0'
01:00.0 Serial Attached SCSI controller: LSI Logic / Symbios Logic SAS2008 PCI-Express Fusion-MPT SAS-2 [Falcon] (rev 03)
        Subsystem: LSI Logic / Symbios Logic Device 3020
        Kernel driver in use: pciback
node03:~# xl pci-assignable-list
0000:01:00.0

Add the following line to your DomU's Config:

pci = [ '01:00.0' ]

Known Issue with LSI Controllers

As the Kernelmodule for LSI Controllers is built into the Alpine Initramfs, the real Module is loaded before the pciback Module can be assigned.
You'll need to blacklist the mpt2sas module in /etc/modprobe.d/blacklist.conf and rebuild your initramfs.

node03:~# grep sas /etc/modprobe.d/blacklist.conf 
blacklist mpt2sas
node03:~# mkinitfs 
==> initramfs: creating /boot/initramfs-grsec
11538 blocks
33641 blocks