Xen PCI Passthrough: Difference between revisions
m (There was two 'the' on the second sentence of the page. I removed one of them) |
(Style/grammar amendments.) |
||
| 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 Linux. | ||
First, use lspci to find the PCI | First, use ''lspci'' to find the PCI address of the device that you want to passthrough: | ||
<pre> | <pre> | ||
node03:~# lspci | node03:~# lspci | ||
| Line 19: | Line 19: | ||
</pre> | </pre> | ||
In this example, | In this example, let's passthrough the SAS controller. So the address is ''01:00.0''. | ||
Make sure xen_pciback is in your /etc/modules: | Make sure that ''xen_pciback'' is in your {{Path|/etc/modules}}: | ||
<pre> | <pre> | ||
node03:~# grep pciback /etc/modules | node03:~# grep pciback /etc/modules | ||
| Line 27: | Line 27: | ||
</pre> | </pre> | ||
Edit /etc/conf.d/xen-pci to add the device: | Edit {{Path|/etc/conf.d/xen-pci}} to add the device: | ||
<pre> | <pre> | ||
node03:~# cat /etc/conf.d/xen-pci | node03:~# cat /etc/conf.d/xen-pci | ||
| Line 36: | Line 36: | ||
</pre> | </pre> | ||
Add the xen-pci daemon to the default runlevel and reboot: | Add the ''xen-pci'' daemon to the default runlevel, and reboot: | ||
<pre> | <pre> | ||
rc-update add xen-pci default | rc-update add xen-pci default | ||
</pre> | </pre> | ||
After rebooting, you should be able to verify the | After rebooting, you should be able to verify that the PCI device is using the pciback kernel module, and that it is visible to passthrough via ''xl'': | ||
<pre> | <pre> | ||
node03:~# lspci -k | grep -A2 '01:00.0' | node03:~# lspci -k | grep -A2 '01:00.0' | ||
| Line 51: | Line 51: | ||
</pre> | </pre> | ||
Add the following line to your DomU's | Add the following line to your DomU's configuration file: | ||
<pre> | <pre> | ||
pci = [ '01:00.0' ] | pci = [ '01:00.0' ] | ||
| Line 57: | Line 57: | ||
====Known Issue with LSI Controllers==== | ====Known Issue with LSI Controllers==== | ||
As the | As the kernel module for LSI controllers is built into the Alpine Linux initramfs, the real module is loaded before the pciback module can be assigned. | ||
<BR>You | <BR>You will need to blacklist the ''mpt2sas'' module in {{Path|/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 | ||
Latest revision as of 01:33, 1 February 2026
This guide is to show how to configure PCI Passthrough on Alpine Linux.
First, use lspci to find the PCI address of the device that 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, let's passthrough the SAS controller. So the address is 01:00.0.
Make sure that xen_pciback is in your /etc/modules:
node03:~# grep pciback /etc/modules xen_pciback
Edit /etc/conf.d/xen-pci to add the device:
node03:~# cat /etc/conf.d/xen-pci # /etc/conf.d/xen-pci # PCI devices that will be used by domUs DEVICES="01:00.0"
Add the xen-pci daemon to the default runlevel, and reboot:
rc-update add xen-pci default
After rebooting, you should be able to verify that the PCI device is using the pciback kernel module, and that it is 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 configuration file:
pci = [ '01:00.0' ]
Known Issue with LSI Controllers
As the kernel module for LSI controllers is built into the Alpine Linux initramfs, the real module is loaded before the pciback module can be assigned.
You will 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