From fe9faedc076f5b37f49e91cdcdda90d1f18dabd5 Mon Sep 17 00:00:00 2001 From: Patrick Magauran Date: Mon, 30 Nov 2020 13:45:29 -0500 Subject: [PATCH] Add Release files --- Release/iommu.sh | 8 ++++++++ Release/test-gvt-d.sh | 22 ++++++++++++++++++++++ Release/test-gvt-g.sh | 26 ++++++++++++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100755 Release/iommu.sh create mode 100755 Release/test-gvt-d.sh create mode 100755 Release/test-gvt-g.sh diff --git a/Release/iommu.sh b/Release/iommu.sh new file mode 100755 index 0000000..e3559fb --- /dev/null +++ b/Release/iommu.sh @@ -0,0 +1,8 @@ +#!/bin/bash +shopt -s nullglob +for g in /sys/kernel/iommu_groups/*; do + echo "IOMMU Group ${g##*/}:" + for d in $g/devices/*; do + echo -e "\t$(lspci -nns ${d##*/})" + done; +done; \ No newline at end of file diff --git a/Release/test-gvt-d.sh b/Release/test-gvt-d.sh new file mode 100755 index 0000000..d3fd656 --- /dev/null +++ b/Release/test-gvt-d.sh @@ -0,0 +1,22 @@ +#!/bin/bash +export WORKSPACE=/home/patrick/i915dev/Release +export PCILOC=0000:00:02.0 +export PCIID=8086:9bca + +cd $WORKSPACE + +cd ./i915_simple + +# Create an UEFI disk that immediately shuts down the VM when booted +mkdir -p tmpfat +mount disk tmpfat +mkdir -p tmpfat/EFI/BOOT +umount tmpfat +rmdir tmpfat +systemctl stop display-manager.service + echo $PCIID > /sys/bus/pci/drivers/vfio-pci/new_id + echo $PCILOC> /sys/bus/pci/devices/$PCILOC/driver/unbind + echo $PCILOC > /sys/bus/pci/drivers/vfio-pci/bind +#qemu-system-x86_64 -k en-us -name uefitest,debug-threads=on -nographic -vga none -serial stdio -m 2048 -M pc -cpu host -global PIIX4_PM.disable_s3=1 -global PIIX4_PM.disable_s4=1 -machine kernel_irqchip=on -nodefaults -rtc base=localtime,driftfix=slew -no-hpet -global kvm-pit.lost_tick_policy=discard -enable-kvm -bios $WORKSPACE/OVMF_CODE.fd -device vfio-pci,host=$PCILOC,romfile=`pwd`/i915ovmf.rom -device qemu-xhci,p2=8,p3=8 -device usb-kbd -device usb-tablet -drive format=raw,file=disk -usb +timeout --foreground -k 1 8 qemu-system-x86_64 -k en-us -name uefitest,debug-threads=on -nographic -vga none -chardev stdio,id=char0,logfile=serial.log,signal=off \ + -serial chardev:char0 -m 2048 -M pc -cpu host -global PIIX4_PM.disable_s3=1 -global PIIX4_PM.disable_s4=1 -machine kernel_irqchip=on -nodefaults -rtc base=localtime,driftfix=slew -no-hpet -global kvm-pit.lost_tick_policy=discard -enable-kvm -bios $WORKSPACE/OVMF_CODE.fd -device vfio-pci,host=$PCILOC,romfile=`pwd`/i915ovmf.rom -device qemu-xhci,p2=8,p3=8 -device usb-kbd -device usb-tablet -drive format=raw,file=disk -usb diff --git a/Release/test-gvt-g.sh b/Release/test-gvt-g.sh new file mode 100755 index 0000000..368744f --- /dev/null +++ b/Release/test-gvt-g.sh @@ -0,0 +1,26 @@ +#!/bin/bash +export WORKSPACE=/home/patrick/development +export PCILOC=00:02.0 +export PCIID=8086:9bca +export GVTMODE=i915-GVTg_V5_4 + + +cd ./i915_simple + +if [ -e /sys/bus/pci/devices/0000:$PCILOC/2aee154e-7d0d-11e8-88b8-6f45320c7162 ] +then + true +else + modprobe kvmgt || exit + #sudo dd if=/sys/class/drm/card0-HDMI-A-1/edid of=/sys/class/drm/card0/gvt_edid bs=128 count=1 + echo 2aee154e-7d0d-11e8-88b8-6f45320c7162 > /sys/bus/pci/devices/0000:$PCILOC/mdev_supported_types/$GVTMODE/create || exit +fi + +# Create an UEFI disk that immediately shuts down the VM when booted +mkdir -p tmpfat +mount disk tmpfat +mkdir -p tmpfat/EFI/BOOT +umount tmpfat +rmdir tmpfat + +qemu-system-x86_64 -k en-us -name uefitest,debug-threads=on -serial stdio -m 2048 -M pc -cpu host -global PIIX4_PM.disable_s3=1 -global PIIX4_PM.disable_s4=1 -machine kernel_irqchip=on -nodefaults -rtc base=localtime,driftfix=slew -no-hpet -global kvm-pit.lost_tick_policy=discard -enable-kvm -bios $WORKSPACE/OVMF_CODE.fd -display gtk,gl=on,grab-on-hover=on -full-screen -vga none -device vfio-pci,sysfsdev=/sys/bus/pci/devices/0000:$PCILOC/2aee154e-7d0d-11e8-88b8-6f45320c7162,addr=02.0,display=on,x-igd-opregion=on,romfile=`pwd`/i915ovmf.rom -device qemu-xhci,p2=8,p3=8 -device usb-kbd -device usb-tablet -drive format=raw,file=disk