1
0
Fork 0

Compare commits

..

No commits in common. "4cbe134987be880b026882c843e8377555a740fd" and "4dbb66353fb7d6b434996f2c285f7684ba2df994" have entirely different histories.

4 changed files with 27 additions and 67 deletions

View File

@ -1,20 +1,16 @@
- hosts: all, localhost - hosts: all, localhost
become: yes become: yes
vars: vars:
audio:
source: EasyEffects Source
sink: EasyEffects Sink
vfio_pci_ids: vfio_pci_ids:
- '8086:15b8' # Intel Corporation Ethernet Connection (2) I219-V # - '8086:15b8' # Intel Corporation Ethernet Connection (2) I219-V
- '1002:731f' # Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 [Radeon RX 5700 / 5700 XT] - '1002:731f' # Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 [Radeon RX 5700 / 5700 XT]
- '1002:ab38' # Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 HDMI Audio - '1002:ab38' # Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 HDMI Audio
# - 'c0a9:2263' # Micron/Crucial Technology P1 NVMe PCIe SSD
pci_device_ids: pci_device_ids:
# Intel Corporation Ethernet Connection (2) I219-V # Intel Corporation Ethernet Connection (2) I219-V
- domain: '0000' # - domain: '0000'
bus: '00' # bus: '00'
slot: '1f' # slot: '1f'
function: '6' # function: '6'
# Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 [Radeon RX 5700 / 5700 XT] # Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 [Radeon RX 5700 / 5700 XT]
- domain: '0000' - domain: '0000'
bus: '03' bus: '03'
@ -25,12 +21,6 @@
bus: '03' bus: '03'
slot: '00' slot: '00'
function: '1' function: '1'
# Micron/Crucial Technology P1 NVMe PCIe SSD
# - alias: ua-nvme1
# domain: '0000'
# bus: '0b'
# slot: '00'
# function: '0'
usb_device_ids: usb_device_ids:
- '054c:05c4' # Sony Corp. DualShock 4 [CUH-ZCT1x] - '054c:05c4' # Sony Corp. DualShock 4 [CUH-ZCT1x]
- '046d:c539' # Logitech, Inc. USB Receiver - '046d:c539' # Logitech, Inc. USB Receiver

View File

@ -2,7 +2,6 @@
pacman: pacman:
name: name:
- qemu - qemu
# - qemu-audio-jack
- libvirt - libvirt
- bridge-utils - bridge-utils
- ovmf - ovmf

View File

@ -14,20 +14,21 @@ prepare() {
irq-affinity mask C1-3,5-7 \ irq-affinity mask C1-3,5-7 \
cpuset-modify --cpus C0,4 /system.slice \ cpuset-modify --cpus C0,4 /system.slice \
cpuset-modify --cpus C0,4 /user.slice \ cpuset-modify --cpus C0,4 /user.slice \
move-tasks / /host.slice \
cpu-governor performance C0-7 cpu-governor performance C0-7
# for _ in $(seq 5); do for _ in $(seq 5); do
# sleep 3 sleep 3
# # assign hugepages # assign hugepages
# sysctl -w vm.nr_overcommit_hugepages=8192 && break sysctl -w vm.nr_hugepages=8192 && break
# done done
# sleep 10 sleep 10
} }
release() { release() {
systemctl stop win10-usb systemctl stop win10-usb
vfio-isolate restore /tmp/win10.undo vfio-isolate restore /tmp/win10.undo
# sysctl -w vm.nr_overcommit_hugepages=0 sysctl -w vm.nr_hugepages=0
} }
if [ "$1" == "win10" ]; then if [ "$1" == "win10" ]; then

View File

@ -9,7 +9,7 @@
<memory unit='KiB'>16777216</memory> <memory unit='KiB'>16777216</memory>
<currentMemory unit='KiB'>16777216</currentMemory> <currentMemory unit='KiB'>16777216</currentMemory>
<memoryBacking> <memoryBacking>
<!-- <hugepages/> --> <hugepages/>
<locked/> <locked/>
</memoryBacking> </memoryBacking>
<vcpu placement='static'>6</vcpu> <vcpu placement='static'>6</vcpu>
@ -76,7 +76,7 @@
<timer name='hpet' present='no'/> <timer name='hpet' present='no'/>
</clock> </clock>
<on_poweroff>destroy</on_poweroff> <on_poweroff>destroy</on_poweroff>
<!-- Because of the AMD reset bug, we cannot actually reboot normally --> <!-- Because of the AMD reset bug, we cannot actually restart normally -->
<on_reboot>destroy</on_reboot> <on_reboot>destroy</on_reboot>
<on_crash>destroy</on_crash> <on_crash>destroy</on_crash>
<pm> <pm>
@ -88,22 +88,21 @@
<disk type='file' device='disk'> <disk type='file' device='disk'>
<driver name='qemu' type='raw'/> <driver name='qemu' type='raw'/>
<source file='/data/marchambault/VirtualMachines/img/win10.img'/> <source file='/data/marchambault/VirtualMachines/img/win10.img'/>
<target dev='sda' bus='scsi' rotation_rate="1"/> <target dev='sda' bus='scsi'/>
<boot order='2'/> <boot order='1'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk> </disk>
<disk type='block' device='disk'> <disk type='block' device='disk'>
<driver name='qemu' type='raw' cache='none' io='native' discard='unmap'/> <driver name='qemu' type='raw' cache='none' io='native' discard='unmap' detect_zeroes='unmap'/>
<source dev='/dev/disk/by-id/nvme-CT1000P1SSD8_1910E1F03D8E'/> <source dev='/dev/disk/by-id/nvme-CT1000P1SSD8_1910E1F03D8E'/>
<target dev='sdc' bus='scsi' rotation_rate="1"/> <target dev='sdc' bus='scsi'/>
<address type='drive' controller='0' bus='0' target='0' unit='2'/> <address type='drive' controller='0' bus='0' target='0' unit='2'/>
</disk> </disk>
<disk type='file' device='cdrom'> <disk type='file' device='cdrom'>
<driver name='qemu' type='raw'/> <driver name='qemu' type='raw'/>
<!-- <source file=''/> --> <source file='/data/marchambault/VirtualMachines/iso/virtio-win-0.1.171.iso'/>
<target dev='sdb' bus='sata'/> <target dev='sdb' bus='sata'/>
<readonly/> <readonly/>
<boot order='1'/>
<address type='drive' controller='0' bus='0' target='0' unit='1'/> <address type='drive' controller='0' bus='0' target='0' unit='1'/>
</disk> </disk>
<controller type='scsi' index='0' model='virtio-scsi'> <controller type='scsi' index='0' model='virtio-scsi'>
@ -169,21 +168,21 @@
</controller> </controller>
<!-- networking --> <!-- networking -->
<interface type='bridge'> <!-- <interface type='bridge'>
<mac address='52:54:00:f5:2c:df'/> <mac address='52:54:00:f5:2c:df'/>
<source bridge='virbr0'/> <source bridge='virbr0'/>
<model type='virtio'/> <model type='virtio'/>
<link state='up'/> <link state='up'/>
<address type='pci' domain='0x0000' bus='0x08' slot='0x00' function='0x0'/> <address type='pci' domain='0x0000' bus='0x08' slot='0x00' function='0x0'/>
</interface> </interface> -->
<!-- <interface type='bridge'> <interface type='bridge'>
<mac address='52:54:00:f5:2c:df'/> <mac address='52:54:00:f5:2c:df'/>
<source bridge='br0'/> <source bridge='br0'/>
<target dev="vnet0"/> <target dev="vnet0"/>
<model type='virtio'/> <model type='virtio'/>
<link state='up'/> <link state='up'/>
<address type='pci' domain='0x0000' bus='0x08' slot='0x00' function='0x0'/> <address type='pci' domain='0x0000' bus='0x08' slot='0x00' function='0x0'/>
</interface> --> </interface>
<!-- HID --> <!-- HID -->
<input type='mouse' bus='ps2'/> <input type='mouse' bus='ps2'/>
@ -206,35 +205,20 @@
<!-- audio --> <!-- audio -->
<sound model='ich9'> <sound model='ich9'>
<address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x0'/> <address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x0'/>
<codec type='micro'/>
<audio id='1'/> <audio id='1'/>
</sound> </sound>
<audio id='1' type='pulseaudio' serverName='/run/user/1000/pulse/native'> <audio id='1' type='pulseaudio' serverName='/run/user/1000/pulse/native'>
<input mixingEngine='yes' fixedSettings='yes' voices='1' bufferLength='100'/> <output mixingEngine='no' voices='1' bufferLength='100'>
<output mixingEngine='yes' fixedSettings='yes' voices='1' bufferLength='100'> <!-- <settings frequency='48000' channels='2' format='f32'/> -->
<settings frequency='48000' channels='2' format='f32'/>
</output> </output>
</audio> </audio>
<!-- <audio id='1' type='pulseaudio' serverName='/run/user/1000/pulse/native'>
<input mixingEngine='no'/>
<output mixingEngine='no'/>
</audio> -->
<!-- <audio id='1' type='jack'>
<input clientName="win10" connectPorts="{{ audio.source }}"/>
<output clientName="win10" connectPorts="{{ audio.sink }}"/>
</audio> -->
<!-- pci passthrough --> <!-- pci passthrough -->
{% for pci_device_id in pci_device_ids %} {% for pci_device_id in pci_device_ids %}
<hostdev mode='subsystem' type='pci' managed='yes'> <hostdev mode='subsystem' type='pci' managed='yes'>
<source> <source>
<address domain='0x{{ pci_device_id.domain }}' bus='0x{{ pci_device_id.bus }}' slot='0x{{ pci_device_id.slot }}' function='0x{{ pci_device_id.function }}'/> <address domain='0x{{ pci_device_id.domain }}' bus='0x{{ pci_device_id.bus }}' slot='0x{{ pci_device_id.slot }}' function='0x{{ pci_device_id.function }}'/>
</source> </source>
{% if 'alias' in pci_device_id %}
<alias name='{{ pci_device_id.alias }}'/>
{% endif %}
</hostdev> </hostdev>
{% endfor %} {% endfor %}
@ -261,20 +245,6 @@
</shmem> </shmem>
</devices> </devices>
<qemu:override>
<!-- workaround for NVMe passthrough with SMI SM2262 controller -->
<!-- this breaks with >15 vCPUs! -->
<!-- https://bugzilla.kernel.org/show_bug.cgi?id=202055#c42 -->
<!-- <qemu:device alias='ua-nvme1'>
<qemu:frontend>
<qemu:property name='x-msix-relocation' type='string' value='bar2'/>
</qemu:frontend>
</qemu:device> -->
</qemu:override>
<qemu:commandline> <qemu:commandline>
<!-- <qemu:env name="PIPEWIRE_RUNTIME_DIR" value="/run/user/1000"/>
<qemu:env name="PIPEWIRE_LATENCY" value="512/48000"/> -->
</qemu:commandline> </qemu:commandline>
</domain> </domain>