Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrey-str/297792bff6d131497ee6dc1b789e100d to your computer and use it in GitHub Desktop.
Save andrey-str/297792bff6d131497ee6dc1b789e100d to your computer and use it in GitHub Desktop.
OVMF passthrough of RX570 over Thunderbolt3 on Thinkpad P50
prompt:/# kvm -version
QEMU emulator version 2.9.0 (v2.9.0-dirty)
Copyright (c) 2003-2017 Fabrice Bellard and the QEMU Project developers
prompt:/# uname -a
Linux ThinkPad-P50 4.13.8-041308-generic #201710180430 SMP Wed Oct 18 08:33:18 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
prompt:/# cat /etc/modprobe.d/vfio.conf
options vfio-pci ids=1002:67df,1002:aaf0
prompt:/# cat /etc/default/grub
.....
GRUB_CMDLINE_LINUX="kvm.ignore_msrs=1 intel_iommu=on"
.....
prompt:/# lspci
00:00.0 Host bridge: Intel Corporation Sky Lake Host Bridge/DRAM Registers (rev 07)
00:01.0 PCI bridge: Intel Corporation Sky Lake PCIe Controller (x16) (rev 07)
00:14.0 USB controller: Intel Corporation Sunrise Point-H USB 3.0 xHCI Controller (rev 31)
00:14.2 Signal processing controller: Intel Corporation Sunrise Point-H Thermal subsystem (rev 31)
00:16.0 Communication controller: Intel Corporation Sunrise Point-H CSME HECI #1 (rev 31)
00:17.0 SATA controller: Intel Corporation Sunrise Point-H SATA controller [AHCI mode] (rev 31)
00:1c.0 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #1 (rev f1)
00:1c.2 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #3 (rev f1)
00:1c.4 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #5 (rev f1)
00:1d.0 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #9 (rev f1)
00:1d.4 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #13 (rev f1)
00:1f.0 ISA bridge: Intel Corporation Sunrise Point-H LPC Controller (rev 31)
00:1f.2 Memory controller: Intel Corporation Sunrise Point-H PMC (rev 31)
00:1f.3 Audio device: Intel Corporation Sunrise Point-H HD Audio (rev 31)
00:1f.4 SMBus: Intel Corporation Sunrise Point-H SMBus (rev 31)
00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (2) I219-LM (rev 31)
01:00.0 VGA compatible controller: NVIDIA Corporation GM107GLM [Quadro M2000M] (rev a2)
01:00.1 Audio device: NVIDIA Corporation Device 0fbc (rev a1)
04:00.0 Network controller: Intel Corporation Wireless 8260 (rev 3a)
05:00.0 PCI bridge: Intel Corporation Device 1576
06:00.0 PCI bridge: Intel Corporation Device 1576
06:01.0 PCI bridge: Intel Corporation Device 1576
06:02.0 PCI bridge: Intel Corporation Device 1576
07:00.0 System peripheral: Intel Corporation Device 1575
3e:00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd NVMe SSD Controller (rev 01)
3f:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS525A PCI Express Card Reader (rev 01)
prompt:/# sudo sh -c 'echo 1 > /sys/bus/thunderbolt/devices/0-1/authorized'
prompt:/# lspci
00:00.0 Host bridge: Intel Corporation Sky Lake Host Bridge/DRAM Registers (rev 07)
00:01.0 PCI bridge: Intel Corporation Sky Lake PCIe Controller (x16) (rev 07)
00:14.0 USB controller: Intel Corporation Sunrise Point-H USB 3.0 xHCI Controller (rev 31)
00:14.2 Signal processing controller: Intel Corporation Sunrise Point-H Thermal subsystem (rev 31)
00:16.0 Communication controller: Intel Corporation Sunrise Point-H CSME HECI #1 (rev 31)
00:17.0 SATA controller: Intel Corporation Sunrise Point-H SATA controller [AHCI mode] (rev 31)
00:1c.0 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #1 (rev f1)
00:1c.2 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #3 (rev f1)
00:1c.4 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #5 (rev f1)
00:1d.0 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #9 (rev f1)
00:1d.4 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #13 (rev f1)
00:1f.0 ISA bridge: Intel Corporation Sunrise Point-H LPC Controller (rev 31)
00:1f.2 Memory controller: Intel Corporation Sunrise Point-H PMC (rev 31)
00:1f.3 Audio device: Intel Corporation Sunrise Point-H HD Audio (rev 31)
00:1f.4 SMBus: Intel Corporation Sunrise Point-H SMBus (rev 31)
00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (2) I219-LM (rev 31)
01:00.0 VGA compatible controller: NVIDIA Corporation GM107GLM [Quadro M2000M] (rev a2)
01:00.1 Audio device: NVIDIA Corporation Device 0fbc (rev a1)
04:00.0 Network controller: Intel Corporation Wireless 8260 (rev 3a)
05:00.0 PCI bridge: Intel Corporation Device 1576
06:00.0 PCI bridge: Intel Corporation Device 1576
06:01.0 PCI bridge: Intel Corporation Device 1576
06:02.0 PCI bridge: Intel Corporation Device 1576
07:00.0 System peripheral: Intel Corporation Device 1575
08:00.0 PCI bridge: Intel Corporation Device 1576
09:01.0 PCI bridge: Intel Corporation Device 1576
0a:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Device 67df (rev ef)
0a:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Device aaf0
3e:00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd NVMe SSD Controller (rev 01)
3f:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS525A PCI Express Card Reader (rev 01)
prompt:/# lspci -nnk
00:00.0 Host bridge [0600]: Intel Corporation Sky Lake Host Bridge/DRAM Registers [8086:1918] (rev 07)
Subsystem: Lenovo Skylake Host Bridge/DRAM Registers [17aa:222e]
Kernel driver in use: ie31200_edac
Kernel modules: ie31200_edac
00:01.0 PCI bridge [0604]: Intel Corporation Sky Lake PCIe Controller (x16) [8086:1901] (rev 07)
Kernel driver in use: pcieport
Kernel modules: shpchp
00:14.0 USB controller [0c03]: Intel Corporation Sunrise Point-H USB 3.0 xHCI Controller [8086:a12f] (rev 31)
Subsystem: Lenovo Sunrise Point-H USB 3.0 xHCI Controller [17aa:222e]
Kernel driver in use: xhci_hcd
00:14.2 Signal processing controller [1180]: Intel Corporation Sunrise Point-H Thermal subsystem [8086:a131] (rev 31)
Subsystem: Lenovo Sunrise Point-H Thermal subsystem [17aa:222e]
Kernel driver in use: intel_pch_thermal
Kernel modules: intel_pch_thermal
00:16.0 Communication controller [0780]: Intel Corporation Sunrise Point-H CSME HECI #1 [8086:a13a] (rev 31)
Subsystem: Lenovo Sunrise Point-H CSME HECI [17aa:222e]
Kernel driver in use: mei_me
Kernel modules: mei_me
00:17.0 SATA controller [0106]: Intel Corporation Sunrise Point-H SATA controller [AHCI mode] [8086:a102] (rev 31)
Subsystem: Lenovo Sunrise Point-H SATA controller [AHCI mode] [17aa:222e]
Kernel driver in use: ahci
Kernel modules: ahci
00:1c.0 PCI bridge [0604]: Intel Corporation Sunrise Point-H PCI Express Root Port #1 [8086:a110] (rev f1)
Kernel driver in use: pcieport
Kernel modules: shpchp
00:1c.2 PCI bridge [0604]: Intel Corporation Sunrise Point-H PCI Express Root Port #3 [8086:a112] (rev f1)
Kernel driver in use: pcieport
Kernel modules: shpchp
00:1c.4 PCI bridge [0604]: Intel Corporation Sunrise Point-H PCI Express Root Port #5 [8086:a114] (rev f1)
Kernel driver in use: pcieport
Kernel modules: shpchp
00:1d.0 PCI bridge [0604]: Intel Corporation Sunrise Point-H PCI Express Root Port #9 [8086:a118] (rev f1)
Kernel driver in use: pcieport
Kernel modules: shpchp
00:1d.4 PCI bridge [0604]: Intel Corporation Sunrise Point-H PCI Express Root Port #13 [8086:a11c] (rev f1)
Kernel driver in use: pcieport
Kernel modules: shpchp
00:1f.0 ISA bridge [0601]: Intel Corporation Sunrise Point-H LPC Controller [8086:a150] (rev 31)
Subsystem: Lenovo Sunrise Point-H LPC Controller [17aa:222e]
00:1f.2 Memory controller [0580]: Intel Corporation Sunrise Point-H PMC [8086:a121] (rev 31)
Subsystem: Lenovo Sunrise Point-H PMC [17aa:222e]
00:1f.3 Audio device [0403]: Intel Corporation Sunrise Point-H HD Audio [8086:a170] (rev 31)
Subsystem: Lenovo Sunrise Point-H HD Audio [17aa:222e]
Kernel driver in use: snd_hda_intel
Kernel modules: snd_hda_intel
00:1f.4 SMBus [0c05]: Intel Corporation Sunrise Point-H SMBus [8086:a123] (rev 31)
Subsystem: Lenovo Sunrise Point-H SMBus [17aa:222e]
Kernel modules: i2c_i801
00:1f.6 Ethernet controller [0200]: Intel Corporation Ethernet Connection (2) I219-LM [8086:15b7] (rev 31)
Subsystem: Lenovo Ethernet Connection (2) I219-LM [17aa:2233]
Kernel driver in use: e1000e
Kernel modules: e1000e
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GM107GLM [Quadro M2000M] [10de:13b0] (rev a2)
Subsystem: Lenovo GM107GLM [Quadro M2000M] [17aa:2230]
Kernel driver in use: nvidia
Kernel modules: nvidiafb, nouveau, nvidia_384_drm, nvidia_384
01:00.1 Audio device [0403]: NVIDIA Corporation Device [10de:0fbc] (rev a1)
Kernel driver in use: vfio-pci
Kernel modules: snd_hda_intel
04:00.0 Network controller [0280]: Intel Corporation Wireless 8260 [8086:24f3] (rev 3a)
Subsystem: Intel Corporation Wireless 8260 [8086:0130]
Kernel driver in use: iwlwifi
Kernel modules: iwlwifi
05:00.0 PCI bridge [0604]: Intel Corporation Device [8086:1576]
Kernel driver in use: pcieport
Kernel modules: shpchp
06:00.0 PCI bridge [0604]: Intel Corporation Device [8086:1576]
Kernel driver in use: pcieport
Kernel modules: shpchp
06:01.0 PCI bridge [0604]: Intel Corporation Device [8086:1576]
Kernel driver in use: pcieport
Kernel modules: shpchp
06:02.0 PCI bridge [0604]: Intel Corporation Device [8086:1576]
Kernel driver in use: pcieport
Kernel modules: shpchp
07:00.0 System peripheral [0880]: Intel Corporation Device [8086:1575]
Subsystem: Device [2222:1111]
Kernel driver in use: thunderbolt
Kernel modules: thunderbolt
08:00.0 PCI bridge [0604]: Intel Corporation Device [8086:1576]
Kernel driver in use: pcieport
Kernel modules: shpchp
09:01.0 PCI bridge [0604]: Intel Corporation Device [8086:1576]
Kernel driver in use: pcieport
Kernel modules: shpchp
0a:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Device [1002:67df] (rev ef)
Subsystem: Device [1da2:e366]
Kernel driver in use: vfio-pci
Kernel modules: amdgpu
0a:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Device [1002:aaf0]
Subsystem: Device [1da2:aaf0]
Kernel driver in use: vfio-pci
Kernel modules: snd_hda_intel
3e:00.0 Non-Volatile memory controller [0108]: Samsung Electronics Co Ltd NVMe SSD Controller [144d:a802] (rev 01)
Subsystem: Samsung Electronics Co Ltd NVMe SSD Controller [144d:a801]
Kernel driver in use: nvme
Kernel modules: nvme
3f:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS525A PCI Express Card Reader [10ec:525a] (rev 01)
Subsystem: Lenovo RTS525A PCI Express Card Reader [17aa:222e]
Kernel driver in use: rtsx_pci
Kernel modules: rtsx_pci
prompt:/# for dp in $(find /sys/kernel/iommu_groups/*/devices/*); do ploc=$(basename $dp | sed 's/0000://'); igrp=$(echo $dp | awk -F/ '{print $5}'); dinfo=$(lspci -nn | grep -E "^$ploc"); echo "[IOMMU $igrp] $dinfo" ; done
[IOMMU 0] 00:00.0 Host bridge [0600]: Intel Corporation Sky Lake Host Bridge/DRAM Registers [8086:1918] (rev 07)
[IOMMU 10] 00:1f.0 ISA bridge [0601]: Intel Corporation Sunrise Point-H LPC Controller [8086:a150] (rev 31)
[IOMMU 10] 00:1f.2 Memory controller [0580]: Intel Corporation Sunrise Point-H PMC [8086:a121] (rev 31)
[IOMMU 10] 00:1f.3 Audio device [0403]: Intel Corporation Sunrise Point-H HD Audio [8086:a170] (rev 31)
[IOMMU 10] 00:1f.4 SMBus [0c05]: Intel Corporation Sunrise Point-H SMBus [8086:a123] (rev 31)
[IOMMU 11] 00:1f.6 Ethernet controller [0200]: Intel Corporation Ethernet Connection (2) I219-LM [8086:15b7] (rev 31)
[IOMMU 12] 04:00.0 Network controller [0280]: Intel Corporation Wireless 8260 [8086:24f3] (rev 3a)
[IOMMU 13] 3e:00.0 Non-Volatile memory controller [0108]: Samsung Electronics Co Ltd NVMe SSD Controller [144d:a802] (rev 01)
[IOMMU 14] 3f:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS525A PCI Express Card Reader [10ec:525a] (rev 01)
[IOMMU 15] 05:00.0 PCI bridge [0604]: Intel Corporation Device [8086:1576]
[IOMMU 16] 06:00.0 PCI bridge [0604]: Intel Corporation Device [8086:1576]
[IOMMU 16] 07:00.0 System peripheral [0880]: Intel Corporation Device [8086:1575]
[IOMMU 17] 06:01.0 PCI bridge [0604]: Intel Corporation Device [8086:1576]
[IOMMU 17] 08:00.0 PCI bridge [0604]: Intel Corporation Device [8086:1576]
[IOMMU 17] 09:01.0 PCI bridge [0604]: Intel Corporation Device [8086:1576]
[IOMMU 17] 0a:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Device [1002:67df] (rev ef)
[IOMMU 17] 0a:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Device [1002:aaf0]
[IOMMU 18] 06:02.0 PCI bridge [0604]: Intel Corporation Device [8086:1576]
[IOMMU 1] 00:01.0 PCI bridge [0604]: Intel Corporation Sky Lake PCIe Controller (x16) [8086:1901] (rev 07)
[IOMMU 1] 01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GM107GLM [Quadro M2000M] [10de:13b0] (rev a2)
[IOMMU 1] 01:00.1 Audio device [0403]: NVIDIA Corporation Device [10de:0fbc] (rev a1)
[IOMMU 2] 00:14.0 USB controller [0c03]: Intel Corporation Sunrise Point-H USB 3.0 xHCI Controller [8086:a12f] (rev 31)
[IOMMU 2] 00:14.2 Signal processing controller [1180]: Intel Corporation Sunrise Point-H Thermal subsystem [8086:a131] (rev 31)
[IOMMU 3] 00:16.0 Communication controller [0780]: Intel Corporation Sunrise Point-H CSME HECI #1 [8086:a13a] (rev 31)
[IOMMU 4] 00:17.0 SATA controller [0106]: Intel Corporation Sunrise Point-H SATA controller [AHCI mode] [8086:a102] (rev 31)
[IOMMU 5] 00:1c.0 PCI bridge [0604]: Intel Corporation Sunrise Point-H PCI Express Root Port #1 [8086:a110] (rev f1)
[IOMMU 6] 00:1c.2 PCI bridge [0604]: Intel Corporation Sunrise Point-H PCI Express Root Port #3 [8086:a112] (rev f1)
[IOMMU 7] 00:1c.4 PCI bridge [0604]: Intel Corporation Sunrise Point-H PCI Express Root Port #5 [8086:a114] (rev f1)
[IOMMU 8] 00:1d.0 PCI bridge [0604]: Intel Corporation Sunrise Point-H PCI Express Root Port #9 [8086:a118] (rev f1)
[IOMMU 9] 00:1d.4 PCI bridge [0604]: Intel Corporation Sunrise Point-H PCI Express Root Port #13 [8086:a11c] (rev f1)
prompt:/# kvm -m 16384 -smp 2 -machine pc
-name uefivm
-pflash /usr/share/ovmf/OVMF.fd
-drive file=/Downloads/uefivmhdd1.img,format=raw,index=0,media=disk
-enable-kvm -vga none -cpu host
-usb -usbdevice host:045e:00dd
-usb -usbdevice host:045e:07fd
-device vfio-pci,host=0a:00.0 -device vfio-pci,host=0a:00.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment