aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xHooks/isocpurevert.sh3
-rwxr-xr-xHooks/isolstart.sh3
-rwxr-xr-xHooks/revert.sh26
-rwxr-xr-xHooks/start.sh24
-rwxr-xr-xgpu_pass.sh6
-rwxr-xr-xpatch.rombin0 -> 962048 bytes
-rwxr-xr-xwin10.xml171
7 files changed, 233 insertions, 0 deletions
diff --git a/Hooks/isocpurevert.sh b/Hooks/isocpurevert.sh
new file mode 100755
index 0000000..b297a3c
--- /dev/null
+++ b/Hooks/isocpurevert.sh
@@ -0,0 +1,3 @@
+systemctl set-property --runtime -- user.slice AllowedCPUs=0-11
+systemctl set-property --runtime -- system.slice AllowedCPUs=0-11
+systemctl set-property --runtime -- init.scope AllowedCPUs=0-11
diff --git a/Hooks/isolstart.sh b/Hooks/isolstart.sh
new file mode 100755
index 0000000..f00ba9e
--- /dev/null
+++ b/Hooks/isolstart.sh
@@ -0,0 +1,3 @@
+systemctl set-property --runtime -- user.slice AllowedCPUs=0,6
+systemctl set-property --runtime -- system.slice AllowedCPUs=0,6
+systemctl set-property --runtime -- init.scope AllowedCPUs=0,6
diff --git a/Hooks/revert.sh b/Hooks/revert.sh
new file mode 100755
index 0000000..3157a30
--- /dev/null
+++ b/Hooks/revert.sh
@@ -0,0 +1,26 @@
+#!/bin/bash
+set -x
+source "/etc/libvirt/hooks/kvm.conf"
+
+modprobe -r vfio_pci
+modprobe -r vfio_iommu_type1
+modprobe -r vfio
+
+virsh nodedev-reattach $VIRSH_GPU_VIDEO
+virsh nodedev-reattach $VIRSH_GPU_AUDIO
+
+echo 1 > /sys/class/vtconsole/vtcon0/bind
+echo 0 > /sys/class/vtconsole/vtcon1/bind
+
+nvidia-xconfig --query-gpu-info > /dev/null 2>&1
+
+echo "efi-framebuffer.0" > /sys/bus/platform/drivers/efi-framebuffer/bind
+
+modprobe nvidia_drm
+modprobe nvidia_modeset
+modprobe drm_kms_helper
+modprobe nvidia
+modprobe drm
+modprobe nvidia_uvm
+
+systemctl start sddm.service
diff --git a/Hooks/start.sh b/Hooks/start.sh
new file mode 100755
index 0000000..241fdcc
--- /dev/null
+++ b/Hooks/start.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+set -x
+
+source "/etc/libvirt/hooks/kvm.conf"
+
+systemctl stop sddm.service
+echo 0 > /sys/class/vtconsole/vtcon0/bind
+echo 0 > /sys/class/vtconsole/vtcon1/bind
+echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind
+sleep 10
+modprobe -r nvidia_drm
+modprobe -r nvidia_modeset
+modprobe -r drm_kms_helper
+modprobe -r nvidia
+modprobe -r i2c_nvidia_gpu
+modprobe -r drm
+modprobe -r nvidia_uvm
+
+virsh nodedev-detach $VIRSH_GPU_VIDEO
+virsh nodedev-detach $VIRSH_GPU_AUDIO
+
+modprobe vfio
+modprobe vfio_pci
+modprobe vfio_iommu_type1
diff --git a/gpu_pass.sh b/gpu_pass.sh
index bf09f14..5b5d9a6 100755
--- a/gpu_pass.sh
+++ b/gpu_pass.sh
@@ -1 +1,7 @@
sudo pacman -S qemu libvirt edk2-ovmf virt-manager ebtables dnsmasq
+sudo systemctl enable libvirtd.service
+sudo systemctl start libvirtd.service
+sudo systemctl enable virtlogd.socket
+sudo systemctl start virtlogd.socket
+sudo virsh net-autostart default
+sudo virsh net-start default
diff --git a/patch.rom b/patch.rom
new file mode 100755
index 0000000..10acbf7
--- /dev/null
+++ b/patch.rom
Binary files differ
diff --git a/win10.xml b/win10.xml
new file mode 100755
index 0000000..a3a2052
--- /dev/null
+++ b/win10.xml
@@ -0,0 +1,171 @@
+<!--
+WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
+OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:
+ virsh edit win10
+or other application using the libvirt API.
+-->
+
+<domain type='kvm'>
+ <name>win10</name>
+ <uuid>c7401f17-efca-4238-9c50-3ccaf7a36eab</uuid>
+ <metadata>
+ <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
+ <libosinfo:os id="http://microsoft.com/win/10"/>
+ </libosinfo:libosinfo>
+ </metadata>
+ <memory unit='KiB'>31457280</memory>
+ <currentMemory unit='KiB'>31457280</currentMemory>
+ <vcpu placement='static'>10</vcpu>
+ <os>
+ <type arch='x86_64' machine='pc-q35-6.1'>hvm</type>
+ <loader readonly='yes' type='pflash'>/usr/share/edk2-ovmf/x64/OVMF_CODE.fd</loader>
+ <nvram>/var/lib/libvirt/qemu/nvram/win10_VARS.fd</nvram>
+ </os>
+ <features>
+ <acpi/>
+ <apic/>
+ <hyperv>
+ <relaxed state='on'/>
+ <vapic state='on'/>
+ <spinlocks state='on' retries='8191'/>
+ <vpindex state='on'/>
+ <runtime state='on'/>
+ <synic state='on'/>
+ <stimer state='on'/>
+ <reset state='on'/>
+ <vendor_id state='on' value='1qqw'/>
+ <frequencies state='on'/>
+ </hyperv>
+ <kvm>
+ <hidden state='on'/>
+ </kvm>
+ <vmport state='off'/>
+ </features>
+ <cpu mode='host-passthrough' check='partial' migratable='on'>
+ <topology sockets='1' dies='1' cores='5' threads='2'/>
+ <cache mode='passthrough'/>
+ <feature policy='disable' name='hypervisor'/>
+ </cpu>
+ <clock offset='localtime'>
+ <timer name='rtc' tickpolicy='catchup'/>
+ <timer name='pit' tickpolicy='delay'/>
+ <timer name='hpet' present='no'/>
+ <timer name='hypervclock' present='yes'/>
+ </clock>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <pm>
+ <suspend-to-mem enabled='no'/>
+ <suspend-to-disk enabled='no'/>
+ </pm>
+ <devices>
+ <emulator>/usr/bin/qemu-system-x86_64</emulator>
+ <disk type='file' device='disk'>
+ <driver name='qemu' type='qcow2'/>
+ <source file='/var/lib/libvirt/images/win10.qcow2'/>
+ <target dev='sda' bus='sata'/>
+ <boot order='2'/>
+ <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+ </disk>
+ <controller type='usb' index='0' model='qemu-xhci' ports='15'>
+ <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
+ </controller>
+ <controller type='sata' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
+ </controller>
+ <controller type='pci' index='0' model='pcie-root'/>
+ <controller type='pci' index='1' model='pcie-root-port'>
+ <model name='pcie-root-port'/>
+ <target chassis='1' port='0x10'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0' multifunction='on'/>
+ </controller>
+ <controller type='pci' index='2' model='pcie-root-port'>
+ <model name='pcie-root-port'/>
+ <target chassis='2' port='0x11'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x1'/>
+ </controller>
+ <controller type='pci' index='3' model='pcie-root-port'>
+ <model name='pcie-root-port'/>
+ <target chassis='3' port='0x12'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x2'/>
+ </controller>
+ <controller type='pci' index='4' model='pcie-root-port'>
+ <model name='pcie-root-port'/>
+ <target chassis='4' port='0x13'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x3'/>
+ </controller>
+ <controller type='pci' index='5' model='pcie-root-port'>
+ <model name='pcie-root-port'/>
+ <target chassis='5' port='0x14'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x4'/>
+ </controller>
+ <controller type='pci' index='6' model='pcie-root-port'>
+ <model name='pcie-root-port'/>
+ <target chassis='6' port='0x15'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x5'/>
+ </controller>
+ <controller type='virtio-serial' index='0'>
+ <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
+ </controller>
+ <interface type='network'>
+ <mac address='52:54:00:33:f0:2f'/>
+ <source network='default'/>
+ <model type='e1000e'/>
+ <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
+ </interface>
+ <input type='tablet' bus='usb'>
+ <address type='usb' bus='0' port='1'/>
+ </input>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <sound model='ich9'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x1b' function='0x0'/>
+ </sound>
+ <audio id='1' type='spice'/>
+ <hostdev mode='subsystem' type='pci' managed='yes'>
+ <source>
+ <address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
+ </source>
+ <rom file='/home/jimbob/patch.rom'/>
+ <address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/>
+ </hostdev>
+ <hostdev mode='subsystem' type='pci' managed='yes'>
+ <source>
+ <address domain='0x0000' bus='0x01' slot='0x00' function='0x1'/>
+ </source>
+ <rom file='/home/jimbob/patch.rom'/>
+ <address type='pci' domain='0x0000' bus='0x06' slot='0x00' function='0x0'/>
+ </hostdev>
+ <hostdev mode='subsystem' type='usb' managed='yes'>
+ <source>
+ <vendor id='0x0951'/>
+ <product id='0x16e5'/>
+ </source>
+ <address type='usb' bus='0' port='4'/>
+ </hostdev>
+ <hostdev mode='subsystem' type='usb' managed='yes'>
+ <source>
+ <vendor id='0x0951'/>
+ <product id='0x1727'/>
+ </source>
+ <address type='usb' bus='0' port='5'/>
+ </hostdev>
+ <hostdev mode='subsystem' type='usb' managed='yes'>
+ <source>
+ <vendor id='0x0951'/>
+ <product id='0x16a4'/>
+ </source>
+ <address type='usb' bus='0' port='6'/>
+ </hostdev>
+ <redirdev bus='usb' type='spicevmc'>
+ <address type='usb' bus='0' port='2'/>
+ </redirdev>
+ <redirdev bus='usb' type='spicevmc'>
+ <address type='usb' bus='0' port='3'/>
+ </redirdev>
+ <memballoon model='virtio'>
+ <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
+ </memballoon>
+ </devices>
+</domain>