SHARE
TWEET

Untitled

a guest Jun 20th, 2018 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --------------------------------------------------------
  2. Launch Script:
  3.  
  4. #!/bin/bash
  5.  
  6. export QEMU_AUDIO_DRV=pa
  7. #export QEMU_PA_SERVER="<your-pulse-socket>"
  8. export QEMU_AUDIO_TIMER_PERIOD=50011
  9.  
  10. brctl addbr bridge0
  11. brctl addif bridge0 enp0s31f6
  12. dhclient -v bridge0
  13.  
  14. modprobe vfio_pci
  15. echo "10de 13b0" > "/sys/bus/pci/drivers/vfio-pci/new_id"
  16.  
  17.  
  18.  
  19. # Use command below to generate a MAC address
  20. # printf '52:54:BE:EF:%02X:%02X\n' $((RANDOM%256)) $((RANDOM%256))
  21. qemu-system-x86_64 \
  22.   -name "Windows10-QEMU" \
  23.   -machine type=q35,accel=kvm \
  24.   -global ICH9-LPC.disable_s3=1 \
  25.   -global ICH9-LPC.disable_s4=1 \
  26.   -enable-kvm \
  27.   -cpu host,hypervisor=off,kvm=off,hv_vapic,hv_relaxed,hv_spinlocks=0x1fff,hv_time,hv_vendor_id=whatvendor \
  28.   -smp 4,sockets=1,cores=2,threads=2 \
  29.   -m 16G \
  30.   -mem-path /dev/hugepages \
  31.   -mem-prealloc \
  32.   -balloon none \
  33.   -rtc clock=host,base=localtime \
  34.   -device ich9-intel-hda -device hda-output \
  35.   -nographic \
  36.   -serial none \
  37.   -parallel none \
  38.   -k de \
  39.   -usbdevice tablet \
  40.   -device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1 \
  41.   -device vfio-pci,host=01:00.0,bus=root.1,addr=00.0,x-pci-sub-device-id=1753,x-pci-sub-vendor-id=4136,multifunction=on,romfile=MyGPU.rom \
  42.   -drive if=pflash,format=raw,readonly=on,file=/usr/share/edk2-ovmf/OVMF_CODE.fd \
  43.   -drive if=pflash,format=raw,file=WIN_VARS.fd \
  44.   -boot menu=on \
  45.   -boot order=c \
  46.   -drive id=disk0,if=virtio,cache=none,format=raw,file=WindowsVM.img \
  47.   -drive file=Windows.iso,index=1,media=cdrom \
  48.   -drive file=virtio-win-0.1.149.iso,index=2,media=cdrom \
  49.   -net nic -net bridge,br=bridge0 \
  50.   -device pci-bridge,addr=12.0,chassis_nr=2,id=head.2 \
  51.   -device virtio-keyboard-pci,bus=head.2,addr=03.0,display=video.2 \
  52.   -device virtio-mouse-pci,bus=head.2,addr=04.0,display=video.2 \
  53.   -vga none
  54.  
  55.  
  56.  
  57.  
  58. echo "0000:01:00.0" > "/sys/bus/pci/drivers/vfio-pci/0000:01:00.0/driver/unbind"
  59. echo "OFF" >> /proc/acpi/bbswitch
  60. ifconfig bridge0 down
  61. brctl delbr bridge0
  62.  
  63. --------------------------------------------------------
  64.  
  65. lspci -v when launched
  66.  
  67. 01:00.0 VGA compatible controller: NVIDIA Corporation GM107GLM [Quadro M2000M] (rev a2) (prog-if 00 [VGA controller])
  68.     Subsystem: Dell GM107GLM [Quadro M2000M]
  69.     Flags: bus master, fast devsel, latency 0, IRQ 142
  70.     Memory at de000000 (32-bit, non-prefetchable) [size=16M]
  71.     Memory at c0000000 (64-bit, prefetchable) [size=256M]
  72.     Memory at d0000000 (64-bit, prefetchable) [size=32M]
  73.     I/O ports at e000 [size=128]
  74.     [virtual] Expansion ROM at df000000 [disabled] [size=512K]
  75.     Capabilities: [60] Power Management version 3
  76.     Capabilities: [68] MSI: Enable+ Count=1/1 Maskable- 64bit+
  77.     Capabilities: [78] Express Legacy Endpoint, MSI 00
  78.     Capabilities: [100] Virtual Channel
  79.     Capabilities: [250] Latency Tolerance Reporting
  80.     Capabilities: [258] L1 PM Substates
  81.     Capabilities: [128] Power Budgeting <?>
  82.     Capabilities: [600] Vendor Specific Information: ID=0001 Rev=1 Len=024 <?>
  83.     Capabilities: [900] #19
  84.     Kernel driver in use: vfio-pci
  85.     Kernel modules: nvidia_drm, nvidia
  86.  
  87. --------------------------------------------------------
  88.  
  89. ./rom-parser ../../../qemu/MyGPU.rom
  90. Valid ROM signature found @600h, PCIR offset 190h
  91.     PCIR: type 0 (x86 PC-AT), vendor: 10de, device: 13b0, class: 030000
  92.     PCIR: revision 3, vendor revision: 1
  93. Valid ROM signature found @19e00h, PCIR offset 1ch
  94.     PCIR: type 3 (EFI), vendor: 10de, device: 13b0, class: 030000
  95.     PCIR: revision 3, vendor revision: 0
  96.         EFI: Signature Valid, Subsystem: Boot, Machine: X64
  97.     Last image
  98.  
  99. --------------------------------------------------------
  100.  
  101. optirun lspci -nnk -s 01:00.0
  102. 01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GM107GLM [Quadro M2000M] [10de:13b0] (rev a2)
  103.     Subsystem: Dell GM107GLM [Quadro M2000M] [1028:06d9]
  104.     Kernel driver in use: nvidia
  105.     Kernel modules: nvidia_drm, nvidia
  106.  
  107. --------------------------------------------------------
  108.  
  109. OIMMU Groups
  110. plumbus /home/bock/Downloads/git/rom-parser # for iommu_group in $(find /sys/kernel/iommu_groups/ -maxdepth 1 -mindepth 1 -type d);do echo "IOMMU group $(basename "$iommu_group")"; for device in $(\ls -1 "$iommu_group"/devices/); do if [[ -e "$iommu_group"/devices/"$device"/reset ]]; then echo -n "[RESET]"; fi; echo -n $'\t';lspci -nns "$device"; done; done
  111. IOMMU group 7
  112. [RESET] 00:1c.0 PCI bridge [0604]: Intel Corporation Sunrise Point-H PCI Express Root Port #2 [8086:a111] (rev f1)
  113. IOMMU group 15
  114. [RESET] 05:00.0 Non-Volatile memory controller [0108]: Samsung Electronics Co Ltd NVMe SSD Controller SM951/PM951 [144d:a802] (rev 01)
  115. IOMMU group 5
  116.     00:16.0 Communication controller [0780]: Intel Corporation Sunrise Point-H CSME HECI #1 [8086:a13a] (rev 31)
  117.     00:16.3 Serial controller [0700]: Intel Corporation Sunrise Point-H KT Redirection [8086:a13d] (rev 31)
  118. IOMMU group 13
  119. [RESET] 02:00.0 Network controller [0280]: Intel Corporation Wireless 8260 [8086:24f3] (rev 3a)
  120. IOMMU group 3
  121.     00:04.0 Signal processing controller [1180]: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem [8086:1903] (rev 07)
  122. IOMMU group 11
  123.     00:1f.0 ISA bridge [0601]: Intel Corporation Sunrise Point-H LPC Controller [8086:a150] (rev 31)
  124.     00:1f.2 Memory controller [0580]: Intel Corporation Sunrise Point-H PMC [8086:a121] (rev 31)
  125.     00:1f.3 Audio device [0403]: Intel Corporation Sunrise Point-H HD Audio [8086:a170] (rev 31)
  126.     00:1f.4 SMBus [0c05]: Intel Corporation Sunrise Point-H SMBus [8086:a123] (rev 31)
  127. IOMMU group 1
  128.     00:01.0 PCI bridge [0604]: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x16) [8086:1901] (rev 07)
  129. [RESET] 01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GM107GLM [Quadro M2000M] [10de:13b0] (rev ff)
  130. IOMMU group 8
  131. [RESET] 00:1c.2 PCI bridge [0604]: Intel Corporation Sunrise Point-H PCI Express Root Port #3 [8086:a112] (rev f1)
  132. IOMMU group 6
  133.     00:17.0 SATA controller [0106]: Intel Corporation Sunrise Point-H SATA controller [AHCI mode] [8086:a102] (rev 31)
  134. IOMMU group 14
  135. [RESET] 03:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS525A PCI Express Card Reader [10ec:525a] (rev 01)
  136. IOMMU group 4
  137.     00:14.0 USB controller [0c03]: Intel Corporation Sunrise Point-H USB 3.0 xHCI Controller [8086:a12f] (rev 31)
  138.     00:14.2 Signal processing controller [1180]: Intel Corporation Sunrise Point-H Thermal subsystem [8086:a131] (rev 31)
  139. IOMMU group 12
  140. [RESET] 00:1f.6 Ethernet controller [0200]: Intel Corporation Ethernet Connection (2) I219-LM [8086:15b7] (rev 31)
  141. IOMMU group 2
  142. [RESET] 00:02.0 VGA compatible controller [0300]: Intel Corporation HD Graphics P530 [8086:191d] (rev 06)
  143. IOMMU group 10
  144. [RESET] 00:1d.0 PCI bridge [0604]: Intel Corporation Sunrise Point-H PCI Express Root Port #9 [8086:a118] (rev f1)
  145. IOMMU group 0
  146.     00:00.0 Host bridge [0600]: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers [8086:1918] (rev 07)
  147. IOMMU group 9
  148. [RESET] 00:1c.4 PCI bridge [0604]: Intel Corporation Sunrise Point-H PCI Express Root Port #5 [8086:a114] (rev f1)
  149.  
  150.  
  151. --------------------------------------------------------
  152.  
  153. cat /proc/cmdline
  154.  
  155. BOOT_IMAGE=/vmlinuz-4.17.2 root=/dev/mapper/root ro crypt_root=UUID=a7ef84c9-a8f0-4596-837e-6ee3f1a51231 rootfstype=ext4 keymap=de intel_iommu=on kvm.ignore_msrs=1 default_hugepagesz=1G hugepagesz=1G hugepages=16 transparent_hugepage=never root_trim=yes
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top