Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --------------------------------------------------------
- Launch Script:
- #!/bin/bash
- export QEMU_AUDIO_DRV=pa
- #export QEMU_PA_SERVER="<your-pulse-socket>"
- export QEMU_AUDIO_TIMER_PERIOD=50011
- brctl addbr bridge0
- brctl addif bridge0 enp0s31f6
- dhclient -v bridge0
- modprobe vfio_pci
- echo "10de 13b0" > "/sys/bus/pci/drivers/vfio-pci/new_id"
- # Use command below to generate a MAC address
- # printf '52:54:BE:EF:%02X:%02X\n' $((RANDOM%256)) $((RANDOM%256))
- qemu-system-x86_64 \
- -name "Windows10-QEMU" \
- -machine type=q35,accel=kvm \
- -global ICH9-LPC.disable_s3=1 \
- -global ICH9-LPC.disable_s4=1 \
- -enable-kvm \
- -cpu host,hypervisor=off,kvm=off,hv_vapic,hv_relaxed,hv_spinlocks=0x1fff,hv_time,hv_vendor_id=whatvendor \
- -smp 4,sockets=1,cores=2,threads=2 \
- -m 16G \
- -mem-path /dev/hugepages \
- -mem-prealloc \
- -balloon none \
- -rtc clock=host,base=localtime \
- -device ich9-intel-hda -device hda-output \
- -nographic \
- -serial none \
- -parallel none \
- -k de \
- -usbdevice tablet \
- -device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1 \
- -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 \
- -drive if=pflash,format=raw,readonly=on,file=/usr/share/edk2-ovmf/OVMF_CODE.fd \
- -drive if=pflash,format=raw,file=WIN_VARS.fd \
- -boot menu=on \
- -boot order=c \
- -drive id=disk0,if=virtio,cache=none,format=raw,file=WindowsVM.img \
- -drive file=Windows.iso,index=1,media=cdrom \
- -drive file=virtio-win-0.1.149.iso,index=2,media=cdrom \
- -net nic -net bridge,br=bridge0 \
- -device pci-bridge,addr=12.0,chassis_nr=2,id=head.2 \
- -device virtio-keyboard-pci,bus=head.2,addr=03.0,display=video.2 \
- -device virtio-mouse-pci,bus=head.2,addr=04.0,display=video.2 \
- -vga none
- echo "0000:01:00.0" > "/sys/bus/pci/drivers/vfio-pci/0000:01:00.0/driver/unbind"
- echo "OFF" >> /proc/acpi/bbswitch
- ifconfig bridge0 down
- brctl delbr bridge0
- --------------------------------------------------------
- lspci -v when launched
- 01:00.0 VGA compatible controller: NVIDIA Corporation GM107GLM [Quadro M2000M] (rev a2) (prog-if 00 [VGA controller])
- Subsystem: Dell GM107GLM [Quadro M2000M]
- Flags: bus master, fast devsel, latency 0, IRQ 142
- Memory at de000000 (32-bit, non-prefetchable) [size=16M]
- Memory at c0000000 (64-bit, prefetchable) [size=256M]
- Memory at d0000000 (64-bit, prefetchable) [size=32M]
- I/O ports at e000 [size=128]
- [virtual] Expansion ROM at df000000 [disabled] [size=512K]
- Capabilities: [60] Power Management version 3
- Capabilities: [68] MSI: Enable+ Count=1/1 Maskable- 64bit+
- Capabilities: [78] Express Legacy Endpoint, MSI 00
- Capabilities: [100] Virtual Channel
- Capabilities: [250] Latency Tolerance Reporting
- Capabilities: [258] L1 PM Substates
- Capabilities: [128] Power Budgeting <?>
- Capabilities: [600] Vendor Specific Information: ID=0001 Rev=1 Len=024 <?>
- Capabilities: [900] #19
- Kernel driver in use: vfio-pci
- Kernel modules: nvidia_drm, nvidia
- --------------------------------------------------------
- ./rom-parser ../../../qemu/MyGPU.rom
- Valid ROM signature found @600h, PCIR offset 190h
- PCIR: type 0 (x86 PC-AT), vendor: 10de, device: 13b0, class: 030000
- PCIR: revision 3, vendor revision: 1
- Valid ROM signature found @19e00h, PCIR offset 1ch
- PCIR: type 3 (EFI), vendor: 10de, device: 13b0, class: 030000
- PCIR: revision 3, vendor revision: 0
- EFI: Signature Valid, Subsystem: Boot, Machine: X64
- Last image
- --------------------------------------------------------
- optirun lspci -nnk -s 01:00.0
- 01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GM107GLM [Quadro M2000M] [10de:13b0] (rev a2)
- Subsystem: Dell GM107GLM [Quadro M2000M] [1028:06d9]
- Kernel driver in use: nvidia
- Kernel modules: nvidia_drm, nvidia
- --------------------------------------------------------
- OIMMU Groups
- 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
- IOMMU group 7
- [RESET] 00:1c.0 PCI bridge [0604]: Intel Corporation Sunrise Point-H PCI Express Root Port #2 [8086:a111] (rev f1)
- IOMMU group 15
- [RESET] 05:00.0 Non-Volatile memory controller [0108]: Samsung Electronics Co Ltd NVMe SSD Controller SM951/PM951 [144d:a802] (rev 01)
- IOMMU group 5
- 00:16.0 Communication controller [0780]: Intel Corporation Sunrise Point-H CSME HECI #1 [8086:a13a] (rev 31)
- 00:16.3 Serial controller [0700]: Intel Corporation Sunrise Point-H KT Redirection [8086:a13d] (rev 31)
- IOMMU group 13
- [RESET] 02:00.0 Network controller [0280]: Intel Corporation Wireless 8260 [8086:24f3] (rev 3a)
- IOMMU group 3
- 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)
- IOMMU group 11
- 00:1f.0 ISA bridge [0601]: Intel Corporation Sunrise Point-H LPC Controller [8086:a150] (rev 31)
- 00:1f.2 Memory controller [0580]: Intel Corporation Sunrise Point-H PMC [8086:a121] (rev 31)
- 00:1f.3 Audio device [0403]: Intel Corporation Sunrise Point-H HD Audio [8086:a170] (rev 31)
- 00:1f.4 SMBus [0c05]: Intel Corporation Sunrise Point-H SMBus [8086:a123] (rev 31)
- IOMMU group 1
- 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)
- [RESET] 01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GM107GLM [Quadro M2000M] [10de:13b0] (rev ff)
- IOMMU group 8
- [RESET] 00:1c.2 PCI bridge [0604]: Intel Corporation Sunrise Point-H PCI Express Root Port #3 [8086:a112] (rev f1)
- IOMMU group 6
- 00:17.0 SATA controller [0106]: Intel Corporation Sunrise Point-H SATA controller [AHCI mode] [8086:a102] (rev 31)
- IOMMU group 14
- [RESET] 03:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS525A PCI Express Card Reader [10ec:525a] (rev 01)
- IOMMU group 4
- 00:14.0 USB controller [0c03]: Intel Corporation Sunrise Point-H USB 3.0 xHCI Controller [8086:a12f] (rev 31)
- 00:14.2 Signal processing controller [1180]: Intel Corporation Sunrise Point-H Thermal subsystem [8086:a131] (rev 31)
- IOMMU group 12
- [RESET] 00:1f.6 Ethernet controller [0200]: Intel Corporation Ethernet Connection (2) I219-LM [8086:15b7] (rev 31)
- IOMMU group 2
- [RESET] 00:02.0 VGA compatible controller [0300]: Intel Corporation HD Graphics P530 [8086:191d] (rev 06)
- IOMMU group 10
- [RESET] 00:1d.0 PCI bridge [0604]: Intel Corporation Sunrise Point-H PCI Express Root Port #9 [8086:a118] (rev f1)
- IOMMU group 0
- 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)
- IOMMU group 9
- [RESET] 00:1c.4 PCI bridge [0604]: Intel Corporation Sunrise Point-H PCI Express Root Port #5 [8086:a114] (rev f1)
- --------------------------------------------------------
- cat /proc/cmdline
- 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement