Compare commits
No commits in common. "bcbd8b753522e44a31d6d1272552173898310618" and "4abd973336c784b8ecbb9326c82089c326c27a30" have entirely different histories.
bcbd8b7535
...
4abd973336
|
@ -10,8 +10,7 @@
|
||||||
- '046d:c539' # Logitech, Inc. USB Receiver
|
- '046d:c539' # Logitech, Inc. USB Receiver
|
||||||
- '046d:c08d' # Logitech, Inc. G502 LIGHTSPEED Wireless Gaming Mouse
|
- '046d:c08d' # Logitech, Inc. G502 LIGHTSPEED Wireless Gaming Mouse
|
||||||
keyboards:
|
keyboards:
|
||||||
# - '/dev/input/by-id/usb-0d3d_USBPS2-event-kbd'
|
- '/dev/input/by-id/usb-0d3d_USBPS2-event-kbd'
|
||||||
- '/dev/input/by-path/platform-i8042-serio-0-event-kbd'
|
|
||||||
mice: []
|
mice: []
|
||||||
roles:
|
roles:
|
||||||
- win10
|
- win10
|
||||||
|
|
|
@ -7,8 +7,8 @@ prepare() {
|
||||||
drop-caches \
|
drop-caches \
|
||||||
compact-memory \
|
compact-memory \
|
||||||
irq-affinity mask C1-3,5-7 \
|
irq-affinity mask C1-3,5-7 \
|
||||||
cpuset-modify --cpus C0,4 /system.slice \
|
cpuset-create --cpus C0,4 /host.slice \
|
||||||
cpuset-modify --cpus C0,4 /user.slice \
|
cpuset-create --cpus C1-3,5-7 -nlb /win10.slice \
|
||||||
move-tasks / /host.slice \
|
move-tasks / /host.slice \
|
||||||
cpu-governor performance C0-7
|
cpu-governor performance C0-7
|
||||||
|
|
||||||
|
@ -21,8 +21,15 @@ prepare() {
|
||||||
}
|
}
|
||||||
|
|
||||||
release() {
|
release() {
|
||||||
systemctl stop win10-usb
|
echo "Restore system"
|
||||||
|
|
||||||
|
# restore cgroupv2
|
||||||
|
systemctl set-property --runtime -- user.slice AllowedCPUs=0,1,2,3,4,5,6,7
|
||||||
|
systemctl set-property --runtime -- system.slice AllowedCPUs=0,1,2,3,4,5,6,7
|
||||||
|
systemctl set-property --runtime -- init.scope AllowedCPUs=0,1,2,3,4,5,6,7
|
||||||
|
|
||||||
vfio-isolate restore /tmp/win10.undo
|
vfio-isolate restore /tmp/win10.undo
|
||||||
|
systemctl stop win10-usb
|
||||||
sysctl -w vm.nr_hugepages=0
|
sysctl -w vm.nr_hugepages=0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
options kvm_intel nested=1
|
|
|
@ -7,7 +7,6 @@
|
||||||
- virt-manager
|
- virt-manager
|
||||||
- python-evdev
|
- python-evdev
|
||||||
- python-pyudev
|
- python-pyudev
|
||||||
# - vendor-reset-dkms-git
|
|
||||||
notify:
|
notify:
|
||||||
- restart libvirtd.service
|
- restart libvirtd.service
|
||||||
- restart virtlogd.socket
|
- restart virtlogd.socket
|
||||||
|
@ -48,15 +47,9 @@
|
||||||
line: 'MODULES=(vfio_pci vfio vfio_iommu_type1 vfio_virqfd i915)'
|
line: 'MODULES=(vfio_pci vfio vfio_iommu_type1 vfio_virqfd i915)'
|
||||||
notify: regenerate linux initramfs
|
notify: regenerate linux initramfs
|
||||||
|
|
||||||
- name: configure kvm kernel module
|
- name: configure vfio-pci device ids
|
||||||
copy:
|
|
||||||
src: modprobe/kvm.conf
|
|
||||||
dest: /etc/modprobe.d/kvm.conf
|
|
||||||
notify: regenerate linux initramfs
|
|
||||||
|
|
||||||
- name: configure vfio-pci kernel module
|
|
||||||
template:
|
template:
|
||||||
src: modprobe/vfio.conf.j2
|
src: vfio.conf.j2
|
||||||
dest: /etc/modprobe.d/vfio.conf
|
dest: /etc/modprobe.d/vfio.conf
|
||||||
notify: regenerate linux initramfs
|
notify: regenerate linux initramfs
|
||||||
|
|
||||||
|
|
|
@ -42,42 +42,41 @@
|
||||||
<vapic state='on'/>
|
<vapic state='on'/>
|
||||||
<spinlocks state='on' retries='8191'/>
|
<spinlocks state='on' retries='8191'/>
|
||||||
<vpindex state='on'/>
|
<vpindex state='on'/>
|
||||||
<runtime state='on'/>
|
|
||||||
<synic state='on'/>
|
<synic state='on'/>
|
||||||
<stimer state="on">
|
<stimer state='on'/>
|
||||||
<direct state="on"/>
|
|
||||||
</stimer>
|
|
||||||
<reset state='on'/>
|
|
||||||
<!-- <vendor_id state='on' value='other'/> -->
|
|
||||||
<frequencies state='on'/>
|
|
||||||
<reenlightenment state='on'/>
|
|
||||||
<tlbflush state='on'/>
|
<tlbflush state='on'/>
|
||||||
<ipi state='on'/>
|
<ipi state='on'/>
|
||||||
<evmcs state='off'/>
|
<reset state='on'/>
|
||||||
|
<frequencies state='on'/>
|
||||||
|
<reenlightenment state='on'/>
|
||||||
|
<!-- nvidia code 43 fix -->
|
||||||
|
<vendor_id state='on' value='fNvidia'/>
|
||||||
</hyperv>
|
</hyperv>
|
||||||
<kvm>
|
<kvm>
|
||||||
|
<!-- nvidia code 43 fix -->
|
||||||
<hidden state='on'/>
|
<hidden state='on'/>
|
||||||
</kvm>
|
</kvm>
|
||||||
<vmport state='off'/>
|
<vmport state='off'/>
|
||||||
<ioapic driver='kvm'/>
|
<ioapic driver='kvm'/>
|
||||||
</features>
|
</features>
|
||||||
<cpu mode='host-passthrough' check='partial'>
|
<cpu mode='host-passthrough' check='none'>
|
||||||
<topology sockets='1' cores='3' threads='2'/>
|
<topology sockets='1' cores='3' threads='2'/>
|
||||||
<cache mode='passthrough'/>
|
<cache mode='passthrough'/>
|
||||||
<feature policy='require' name='invtsc'/>
|
<feature policy='require' name='invtsc'/>
|
||||||
<!-- required for Genshin Impact, come with a performance hit -->
|
<!-- required for Genshin Impact, come with a performance hit -->
|
||||||
<!-- <feature policy="disable" name="hypervisor"/> -->
|
<feature policy="disable" name="hypervisor"/>
|
||||||
</cpu>
|
</cpu>
|
||||||
<clock offset='localtime'>
|
<clock offset='localtime'>
|
||||||
<timer name='tsc' present='yes' mode='native'/>
|
<timer name='rtc' present='no' tickpolicy='catchup'/>
|
||||||
<timer name='hypervclock' present='yes'/>
|
<timer name='pit' present='no' tickpolicy='delay'/>
|
||||||
<timer name='rtc' tickpolicy='catchup'/>
|
|
||||||
<timer name='pit' tickpolicy='delay'/>
|
|
||||||
<timer name='hpet' present='no'/>
|
<timer name='hpet' present='no'/>
|
||||||
|
<timer name='kvmclock' present='no'/>
|
||||||
|
<timer name='hypervclock' present='yes'/>
|
||||||
|
<timer name='tsc' present='yes' mode='native'/>
|
||||||
</clock>
|
</clock>
|
||||||
<on_poweroff>destroy</on_poweroff>
|
<on_poweroff>destroy</on_poweroff>
|
||||||
<!-- Because of the AMD reset bug, we cannot actually restart normally -->
|
<!-- Because of the reset bug, we cannot actually restart without restarting the host -->
|
||||||
<on_reboot>restart</on_reboot>
|
<on_reboot>destroy</on_reboot>
|
||||||
<on_crash>destroy</on_crash>
|
<on_crash>destroy</on_crash>
|
||||||
<pm>
|
<pm>
|
||||||
<suspend-to-mem enabled='no'/>
|
<suspend-to-mem enabled='no'/>
|
||||||
|
@ -174,11 +173,9 @@
|
||||||
<address type='pci' domain='0x0000' bus='0x08' slot='0x00' function='0x0'/>
|
<address type='pci' domain='0x0000' bus='0x08' slot='0x00' function='0x0'/>
|
||||||
</interface>
|
</interface>
|
||||||
<input type='mouse' bus='ps2'/>
|
<input type='mouse' bus='ps2'/>
|
||||||
<input type='mouse' bus='virtio'/>
|
|
||||||
<input type='keyboard' bus='ps2'/>
|
<input type='keyboard' bus='ps2'/>
|
||||||
<input type='keyboard' bus='virtio'/>
|
<graphics type='spice'>
|
||||||
<graphics type='spice' listen='127.0.0.1' port='5900' defaultMode='insecure'>
|
<listen type='socket' socket='/tmp/win10-spice.sock'/>
|
||||||
<listen type='address' address='127.0.0.1'/>
|
|
||||||
<image compression='off' />
|
<image compression='off' />
|
||||||
<mouse mode='server'/>
|
<mouse mode='server'/>
|
||||||
<filetransfer enable='no'/>
|
<filetransfer enable='no'/>
|
||||||
|
@ -213,24 +210,25 @@
|
||||||
<address type='usb' bus='0' port='3'/>
|
<address type='usb' bus='0' port='3'/>
|
||||||
</redirdev>
|
</redirdev>
|
||||||
<memballoon model='none'/>
|
<memballoon model='none'/>
|
||||||
|
<!-- <memballoon model='virtio'>
|
||||||
|
<address type='pci' domain='0x0000' bus='0x07' slot='0x00' function='0x0'/>
|
||||||
|
</memballoon> -->
|
||||||
<shmem name='looking-glass'>
|
<shmem name='looking-glass'>
|
||||||
<model type='ivshmem-plain'/>
|
<model type='ivshmem-plain'/>
|
||||||
<size unit='M'>32</size>
|
<size unit='M'>32</size>
|
||||||
<address type='pci' domain='0x0000' bus='0x02' slot='0x04' function='0x0'/>
|
<address type='pci' domain='0x0000' bus='0x02' slot='0x04' function='0x0'/>
|
||||||
</shmem>
|
</shmem>
|
||||||
<!-- mouse evdev passthrough -->
|
|
||||||
{% for item in mice %}
|
|
||||||
<input type='evdev'>
|
|
||||||
<source dev='/dev/input/by-id/uinput-persist-mouse{{ loop.index0 }}'/>
|
|
||||||
</input>
|
|
||||||
{% endfor %}
|
|
||||||
<!-- keyboard evdev passthrough -->
|
|
||||||
{% for item in keyboards %}
|
|
||||||
<input type='evdev'>
|
|
||||||
<source dev='/dev/input/by-id/uinput-persist-keyboard{{ loop.index0 }}' grab='all' repeat='on'/>
|
|
||||||
</input>
|
|
||||||
{% endfor %}
|
|
||||||
</devices>
|
</devices>
|
||||||
<qemu:commandline>
|
<qemu:commandline>
|
||||||
|
<!-- keyboard evdev passthrough -->
|
||||||
|
{% for item in keyboards %}
|
||||||
|
<qemu:arg value='-object'/>
|
||||||
|
<qemu:arg value='input-linux,id=kbd1,evdev=/dev/input/by-id/uinput-persist-keyboard{{ loop.index0 }},grab_all=off,repeat=on'/>
|
||||||
|
{% endfor %}
|
||||||
|
<!-- mouse evdev passthrough -->
|
||||||
|
{% for item in mice %}
|
||||||
|
<qemu:arg value='-object'/>
|
||||||
|
<qemu:arg value='input-linux,id=input5,evdev=/dev/input/by-id/uinput-persist-mouse{{ loop.index0 }}'/>
|
||||||
|
{% endfor %}
|
||||||
</qemu:commandline>
|
</qemu:commandline>
|
||||||
</domain>
|
</domain>
|
||||||
|
|
Loading…
Reference in New Issue