Advertisement
Guest User

Untitled

a guest
Jan 4th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.67 KB | None | 0 0
  1. lspci -vv | grep -i acscap
  2.  
  3. # lspci -vv | grep -i acscap
  4. #
  5.  
  6.  
  7. dmesg | grep -e DMAR -e IOMMU
  8.  
  9. # dmesg | grep -e DMAR -e IOMMU
  10. [ 0.000000] ACPI: DMAR 0x000000008A430B40 0000A8 (v01 INTEL SKL 00000001 INTL 00000001)
  11. [ 0.000000] DMAR: IOMMU enabled
  12. [ 0.032444] DMAR: Host address width 39
  13. [ 0.032446] DMAR: DRHD base: 0x000000fed90000 flags: 0x0
  14. [ 0.032452] DMAR: dmar0: reg_base_addr fed90000 ver 1:0 cap 1c0000c40660462 ecap 7e3ff0505e
  15. [ 0.032455] DMAR: DRHD base: 0x000000fed91000 flags: 0x1
  16. [ 0.032459] DMAR: dmar1: reg_base_addr fed91000 ver 1:0 cap d2008c40660462 ecap f050da
  17. [ 0.032462] DMAR: RMRR base: 0x00000089f07000 end: 0x00000089f26fff
  18. [ 0.032476] DMAR: RMRR base: 0x0000008b800000 end: 0x0000008fffffff
  19. [ 0.032478] DMAR-IR: IOAPIC id 2 under DRHD base 0xfed91000 IOMMU 1
  20. [ 0.032480] DMAR-IR: HPET id 0 under DRHD base 0xfed91000
  21. [ 0.033866] DMAR-IR: Enabled IRQ remapping in xapic mode
  22. [ 7.518966] DMAR: No ATSR found
  23. [ 7.519126] DMAR: dmar0: Using Queued invalidation
  24. [ 7.519131] DMAR: dmar1: Using Queued invalidation
  25. [ 7.519328] DMAR: Setting RMRR:
  26. [ 7.519348] DMAR: Setting identity map for device 0000:00:02.0 [0x8b800000 - 0x8fffffff]
  27. [ 7.519369] DMAR: Setting identity map for device 0000:00:14.0 [0x89f07000 - 0x89f26fff]
  28. [ 7.519375] DMAR: Prepare 0-16MiB unity mapping for LPC
  29. [ 7.519391] DMAR: Setting identity map for device 0000:00:1f.0 [0x0 - 0xffffff]
  30. [ 7.519412] DMAR: Intel(R) Virtualization Technology for Directed I/O
  31.  
  32.  
  33. dmesg |grep vfio:
  34.  
  35. # dmesg |grep vfio
  36. [ 0.000000] Command line: BOOT_IMAGE=/kernel-genkernel-x86_64-4.9.72-gentoo root=/dev/mapper/vg0-root ro dolvm crypt_root=UUID=5016f5cf-65f7-4d8f-8c14-113c48778ad6 root=/dev/mapper/vg0-root iommu=on intel_iommu=on vfio_pci.ids=10de:1b81,10de:10f0 pcie_acs_override=downstream
  37. [ 0.000000] Kernel command line: BOOT_IMAGE=/kernel-genkernel-x86_64-4.9.72-gentoo root=/dev/mapper/vg0-root ro dolvm crypt_root=UUID=5016f5cf-65f7-4d8f-8c14-113c48778ad6 root=/dev/mapper/vg0-root iommu=on intel_iommu=on vfio_pci.ids=10de:1b81,10de:10f0 pcie_acs_override=downstream
  38. [ 7.627739] vfio_pci: add [10de:1b81[ffff:ffff]] class 0x000000/00000000
  39. [ 7.639685] vfio_pci: add [10de:10f0[ffff:ffff]] class 0x000000/00000000
  40.  
  41.  
  42. lspci -nnk | grep -A3 -i nvidia
  43.  
  44. # lspci -nnk | grep -A3 -i nvidia
  45. 01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP104 [GeForce GTX 1070] [10de:1b81] (rev a1)
  46. Subsystem: Micro-Star International Co., Ltd. [MSI] GP104 [GeForce GTX 1070] [1462:3302]
  47. Kernel driver in use: vfio-pci
  48. Kernel modules: nvidiafb, nouveau, nvidia_drm, nvidia
  49. 01:00.1 Audio device [0403]: NVIDIA Corporation GP104 High Definition Audio Controller [10de:10f0] (rev a1)
  50. Subsystem: Micro-Star International Co., Ltd. [MSI] GP104 High Definition Audio Controller [1462:3302]
  51. Kernel driver in use: vfio-pci
  52. Kernel modules: snd_hda_intel
  53.  
  54.  
  55. ./iommu_groups.sh
  56.  
  57. # ./iommu_groups.sh
  58. IOMMU Group 0 00:00.0 Host bridge [0600]: Intel Corporation Skylake Host Bridge/DRAM Registers [8086:191f] (rev 07)
  59. IOMMU Group 10 00:1f.6 Ethernet controller [0200]: Intel Corporation Ethernet Connection (2) I219-V [8086:15b8] (rev 31)
  60. IOMMU Group 1 00:01.0 PCI bridge [0604]: Intel Corporation Skylake PCIe Controller (x16) [8086:1901] (rev 07)
  61. IOMMU Group 1 01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP104 [GeForce GTX 1070] [10de:1b81] (rev a1)
  62. IOMMU Group 1 01:00.1 Audio device [0403]: NVIDIA Corporation GP104 High Definition Audio Controller [10de:10f0] (rev a1)
  63. IOMMU Group 2 00:02.0 VGA compatible controller [0300]: Intel Corporation HD Graphics 530 [8086:1912] (rev 06)
  64. IOMMU Group 3 00:14.0 USB controller [0c03]: Intel Corporation Sunrise Point-H USB 3.0 xHCI Controller [8086:a12f] (rev 31)
  65. IOMMU Group 4 00:16.0 Communication controller [0780]: Intel Corporation Sunrise Point-H CSME HECI #1 [8086:a13a] (rev 31)
  66. IOMMU Group 5 00:17.0 SATA controller [0106]: Intel Corporation Sunrise Point-H SATA controller [AHCI mode] [8086:a102] (rev 31)
  67. IOMMU Group 6 00:1b.0 PCI bridge [0604]: Intel Corporation Sunrise Point-H PCI Root Port #17 [8086:a167] (rev f1)
  68. IOMMU Group 6 00:1b.2 PCI bridge [0604]: Intel Corporation Sunrise Point-H PCI Root Port #19 [8086:a169] (rev f1)
  69. IOMMU Group 7 00:1c.0 PCI bridge [0604]: Intel Corporation Sunrise Point-H PCI Express Root Port #1 [8086:a110] (rev f1)
  70. IOMMU Group 7 00:1c.1 PCI bridge [0604]: Intel Corporation Sunrise Point-H PCI Express Root Port #2 [8086:a111] (rev f1)
  71. IOMMU Group 7 00:1c.2 PCI bridge [0604]: Intel Corporation Sunrise Point-H PCI Express Root Port #3 [8086:a112] (rev f1)
  72. IOMMU Group 7 00:1c.4 PCI bridge [0604]: Intel Corporation Sunrise Point-H PCI Express Root Port #5 [8086:a114] (rev f1)
  73. IOMMU Group 7 07:00.0 PCI bridge [0604]: Intel Corporation DSL6540 Thunderbolt 3 Bridge [Alpine Ridge 4C 2015] [8086:1578]
  74. IOMMU Group 7 08:00.0 PCI bridge [0604]: Intel Corporation DSL6540 Thunderbolt 3 Bridge [Alpine Ridge 4C 2015] [8086:1578]
  75. IOMMU Group 7 08:01.0 PCI bridge [0604]: Intel Corporation DSL6540 Thunderbolt 3 Bridge [Alpine Ridge 4C 2015] [8086:1578]
  76. IOMMU Group 7 08:02.0 PCI bridge [0604]: Intel Corporation DSL6540 Thunderbolt 3 Bridge [Alpine Ridge 4C 2015] [8086:1578]
  77. IOMMU Group 7 08:04.0 PCI bridge [0604]: Intel Corporation DSL6540 Thunderbolt 3 Bridge [Alpine Ridge 4C 2015] [8086:1578]
  78. IOMMU Group 7 0b:00.0 USB controller [0c03]: Intel Corporation DSL6540 USB 3.1 Controller [Alpine Ridge] [8086:15b6]
  79. IOMMU Group 8 00:1d.0 PCI bridge [0604]: Intel Corporation Sunrise Point-H PCI Express Root Port #9 [8086:a118] (rev f1)
  80. IOMMU Group 8 00:1d.4 PCI bridge [0604]: Intel Corporation Sunrise Point-H PCI Express Root Port #13 [8086:a11c] (rev f1)
  81. IOMMU Group 9 00:1f.0 ISA bridge [0601]: Intel Corporation Sunrise Point-H LPC Controller [8086:a145] (rev 31)
  82. IOMMU Group 9 00:1f.2 Memory controller [0580]: Intel Corporation Sunrise Point-H PMC [8086:a121] (rev 31)
  83. IOMMU Group 9 00:1f.3 Audio device [0403]: Intel Corporation Sunrise Point-H HD Audio [8086:a170] (rev 31)
  84. IOMMU Group 9 00:1f.4 SMBus [0c05]: Intel Corporation Sunrise Point-H SMBus [8086:a123] (rev 31)
  85.  
  86. cat win10-clone.xml
  87.  
  88. # cat win10-clone.xml
  89. <!--
  90. WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
  91. OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:
  92. virsh edit win10-clone
  93. or other application using the libvirt API.
  94. -->
  95.  
  96. <domain type='kvm'>
  97. <name>win10-clone</name>
  98. <uuid>a673c9c8-a1f5-4c3d-97a7-16096bcf1b01</uuid>
  99. <memory unit='KiB'>4194304</memory>
  100. <currentMemory unit='KiB'>4194304</currentMemory>
  101. <vcpu placement='static'>2</vcpu>
  102. <os>
  103. <type arch='x86_64' machine='pc-i440fx-2.10'>hvm</type>
  104. <loader readonly='yes' type='pflash'>/usr/share/edk2-ovmf/OVMF_CODE.fd</loader>
  105. <nvram>/var/lib/libvirt/qemu/nvram/win10_VARS.fd</nvram>
  106. <boot dev='hd'/>
  107. </os>
  108. <features>
  109. <acpi/>
  110. <apic/>
  111. <hyperv>
  112. <relaxed state='on'/>
  113. <vapic state='on'/>
  114. <spinlocks state='on' retries='8191'/>
  115. </hyperv>
  116. <vmport state='off'/>
  117. </features>
  118. <cpu mode='host-model' check='partial'>
  119. <model fallback='allow'/>
  120. </cpu>
  121. <clock offset='localtime'>
  122. <timer name='rtc' tickpolicy='catchup'/>
  123. <timer name='pit' tickpolicy='delay'/>
  124. <timer name='hpet' present='no'/>
  125. <timer name='hypervclock' present='yes'/>
  126. </clock>
  127. <on_poweroff>destroy</on_poweroff>
  128. <on_reboot>restart</on_reboot>
  129. <on_crash>restart</on_crash>
  130. <pm>
  131. <suspend-to-mem enabled='no'/>
  132. <suspend-to-disk enabled='no'/>
  133. </pm>
  134. <devices>
  135. <emulator>/usr/bin/qemu-system-x86_64</emulator>
  136. <disk type='file' device='disk'>
  137. <driver name='qemu' type='qcow2'/>
  138. <source file='/home/tse/kvm_vm/test1-clone.qcow2'/>
  139. <target dev='sda' bus='scsi'/>
  140. <address type='drive' controller='0' bus='0' target='0' unit='0'/>
  141. </disk>
  142. <disk type='file' device='cdrom'>
  143. <driver name='qemu' type='raw'/>
  144. <target dev='hdb' bus='ide'/>
  145. <readonly/>
  146. <address type='drive' controller='0' bus='0' target='0' unit='1'/>
  147. </disk>
  148. <disk type='file' device='cdrom'>
  149. <driver name='qemu' type='raw'/>
  150. <target dev='hdc' bus='ide'/>
  151. <readonly/>
  152. <address type='drive' controller='0' bus='1' target='0' unit='0'/>
  153. </disk>
  154. <controller type='usb' index='0' model='ich9-ehci1'>
  155. <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x7'/>
  156. </controller>
  157. <controller type='usb' index='0' model='ich9-uhci1'>
  158. <master startport='0'/>
  159. <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0' multifunction='on'/>
  160. </controller>
  161. <controller type='usb' index='0' model='ich9-uhci2'>
  162. <master startport='2'/>
  163. <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x1'/>
  164. </controller>
  165. <controller type='usb' index='0' model='ich9-uhci3'>
  166. <master startport='4'/>
  167. <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x2'/>
  168. </controller>
  169. <controller type='scsi' index='0' model='virtio-scsi'>
  170. <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
  171. </controller>
  172. <controller type='pci' index='0' model='pci-root'/>
  173. <controller type='ide' index='0'>
  174. <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
  175. </controller>
  176. <controller type='virtio-serial' index='0'>
  177. <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
  178. </controller>
  179. <interface type='direct'>
  180. <mac address='52:54:00:45:6f:82'/>
  181. <source dev='enp0s31f6' mode='bridge'/>
  182. <model type='rtl8139'/>
  183. <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
  184. </interface>
  185. <serial type='pty'>
  186. <target port='0'/>
  187. </serial>
  188. <console type='pty'>
  189. <target type='serial' port='0'/>
  190. </console>
  191. <input type='mouse' bus='ps2'/>
  192. <input type='keyboard' bus='ps2'/>
  193. <sound model='ac97'>
  194. <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
  195. </sound>
  196. <hostdev mode='subsystem' type='pci' managed='yes'>
  197. <source>
  198. <address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
  199. </source>
  200. <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
  201. </hostdev>
  202. <hostdev mode='subsystem' type='pci' managed='yes'>
  203. <source>
  204. <address domain='0x0000' bus='0x01' slot='0x00' function='0x1'/>
  205. </source>
  206. <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
  207. </hostdev>
  208. <redirdev bus='usb' type='spicevmc'>
  209. <address type='usb' bus='0' port='2'/>
  210. </redirdev>
  211. <redirdev bus='usb' type='spicevmc'>
  212. <address type='usb' bus='0' port='3'/>
  213. </redirdev>
  214. <memballoon model='virtio'>
  215. <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
  216. </memballoon>
  217. </devices>
  218. </domain>
  219.  
  220.  
  221. cat iommu_groups.sh
  222.  
  223. # cat iommu_groups.sh
  224. #!/bin/bash
  225. shopt -s nullglob
  226. for d in /sys/kernel/iommu_groups/*/devices/*; do
  227. n=${d#*/iommu_groups/*}; n=${n%%/*}
  228. printf 'IOMMU Group %s ' "$n"
  229. lspci -nns "${d##*/}"
  230. done;
  231.  
  232.  
  233. cat vfio-bind
  234.  
  235. # cat vfio-bind
  236. #!/bin/bash
  237. modprobe vfio-pci
  238. for dev in "$@"; do
  239. vendor=$(cat /sys/bus/pci/devices/$dev/vendor)
  240. device=$(cat /sys/bus/pci/devices/$dev/device)
  241. if [ -e /sys/bus/pci/devices/$dev/driver ]; then
  242. echo $dev > /sys/bus/pci/devices/$dev/driver/unbind
  243. fi
  244. echo $vendor $device > /sys/bus/pci/drivers/vfio-pci/new_id
  245. echo "done"
  246. done
  247.  
  248.  
  249. emerge --pretend --verbose qemu
  250.  
  251. [ebuild R ] app-emulation/qemu-2.10.1-r1::gentoo USE="aio alsa bzip2 caps curl fdt filecaps jpeg ncurses nls opengl pin-upstream-blobs png python seccomp spice usb usbredir vhost-net vnc xattr -accessibility -bluetooth -debug (-glusterfs) -gnutls -gtk -gtk2 -infiniband -iscsi -lzo -nfs -numa -pulseaudio -rbd -sasl -sdl -sdl2 (-selinux) -smartcard -snappy -ssh -static -static-user -systemtap -tci {-test} -vde -virgl -virtfs -vte -xen -xfs" LINGUAS="-bg -de_DE -fr_FR -hu -it -tr -zh_CN" PYTHON_TARGETS="python2_7" QEMU_SOFTMMU_TARGETS="x86_64 -aarch64 -alpha -arm -cris -i386 -lm32 -m68k -microblaze -microblazeel -mips -mips64 -mips64el -mipsel -moxie -nios2 -or1k -ppc -ppc64 -ppcemb -s390x -sh4 -sh4eb -sparc -sparc64 -tricore -unicore32 -xtensa -xtensaeb" QEMU_USER_TARGETS="-aarch64 -alpha -arm -armeb -cris -hppa -i386 -m68k -microblaze -microblazeel -mips -mips64 -mips64el -mipsel -mipsn32 -mipsn32el -nios2 -or1k -ppc -ppc64 -ppc64abi32 -ppc64le -s390x -sh4 -sh4eb -sparc -sparc32plus -sparc64 -tilegx -x86_64"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement