1
0
Fork 0
This commit is contained in:
Massaki Archambault 2020-01-07 17:54:19 -05:00
parent c5e0bfaec8
commit 012b674daa
4 changed files with 29 additions and 38 deletions

View File

@ -2,5 +2,5 @@ title Archlinux w/ VFIO
linux /vmlinuz-linux linux /vmlinuz-linux
initrd /intel-ucode.img initrd /intel-ucode.img
initrd /initramfs-linux.img initrd /initramfs-linux.img
options intel_iommu=on iommu=pt intel_iommu=igfx_off kvm.ignore_msrs=1 acpi_backlight=none root=LABEL=ARCHROOT rw options intel_iommu=on iommu=pt intel_iommu=igfx_off experimental_zcopytx=1 kvm.ignore_msrs=1 acpi_backlight=none root=LABEL=ARCHROOT rw

View File

@ -1,10 +1,3 @@
<!--
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' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'> <domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<name>win10</name> <name>win10</name>
<uuid>9d7df055-d6d1-4551-bb25-ef2ddb835c4d</uuid> <uuid>9d7df055-d6d1-4551-bb25-ef2ddb835c4d</uuid>
@ -31,7 +24,7 @@ or other application using the libvirt API.
<iothreadpin iothread='1' cpuset='0,4'/> <iothreadpin iothread='1' cpuset='0,4'/>
</cputune> </cputune>
<os> <os>
<type arch='x86_64' machine='pc-q35-4.0'>hvm</type> <type arch='x86_64' machine='pc-q35-4.1'>hvm</type>
<loader readonly='yes' type='pflash'>/usr/share/ovmf/x64/OVMF_CODE.fd</loader> <loader readonly='yes' type='pflash'>/usr/share/ovmf/x64/OVMF_CODE.fd</loader>
<nvram>/var/lib/libvirt/qemu/nvram/win10_VARS.fd</nvram> <nvram>/var/lib/libvirt/qemu/nvram/win10_VARS.fd</nvram>
</os> </os>
@ -39,6 +32,7 @@ or other application using the libvirt API.
<acpi/> <acpi/>
<apic/> <apic/>
<hyperv> <hyperv>
<!-- hyper-v enlightments, the more the better -->
<relaxed state='on'/> <relaxed state='on'/>
<vapic state='on'/> <vapic state='on'/>
<spinlocks state='on' retries='8191'/> <spinlocks state='on' retries='8191'/>
@ -46,30 +40,35 @@ or other application using the libvirt API.
<synic state='on'/> <synic state='on'/>
<stimer state='on'/> <stimer state='on'/>
<reset state='on'/> <reset state='on'/>
<vendor_id state='on' value='whatever'/>
<frequencies state='on'/> <frequencies state='on'/>
<!-- nvidia code 43 fix -->
<vendor_id state='off' value='fNvidia'/>
</hyperv> </hyperv>
<kvm> <kvm>
<hidden state='on'/> <!-- nvidia code 43 fix -->
<hidden state='on'/>
</kvm> </kvm>
<vmport state='off'/> <vmport state='off'/>
<ioapic driver='kvm'/> <ioapic driver='kvm'/>
</features> </features>
<cpu mode='host-passthrough' check='none'> <cpu mode='host-passthrough' check='none'>
<topology sockets='1' cores='3' threads='2'/> <topology sockets='1' cores='3' threads='2'/>
<cache mode='passthrough'/>
</cpu> </cpu>
<clock offset='localtime'> <clock offset='localtime'>
<timer name='rtc' tickpolicy='catchup'/> <timer name='rtc' present='no' tickpolicy='catchup'/>
<timer name='pit' tickpolicy='delay'/> <timer name='pit' present='no' tickpolicy='delay'/>
<timer name='hpet' present='no'/> <timer name='hpet' present='no'/>
<timer name='kvmclock' present='no'/>
<timer name='hypervclock' present='yes'/> <timer name='hypervclock' present='yes'/>
<timer name='tsc' present='yes' mode='native'/>
</clock> </clock>
<on_poweroff>destroy</on_poweroff> <on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot> <on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash> <on_crash>destroy</on_crash>
<pm> <pm>
<suspend-to-mem enabled='yes'/> <suspend-to-mem enabled='no'/>
<suspend-to-disk enabled='yes'/> <suspend-to-disk enabled='no'/>
</pm> </pm>
<devices> <devices>
<emulator>/usr/bin/qemu-system-x86_64</emulator> <emulator>/usr/bin/qemu-system-x86_64</emulator>
@ -81,7 +80,7 @@ or other application using the libvirt API.
<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'/> <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'/> <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'/>
@ -151,9 +150,6 @@ or other application using the libvirt API.
<target chassis='10' port='0x17'/> <target chassis='10' port='0x17'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x7'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x7'/>
</controller> </controller>
<controller type='virtio-serial' index='0'>
<address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
</controller>
<controller type='usb' index='0' model='qemu-xhci' ports='15'> <controller type='usb' index='0' model='qemu-xhci' ports='15'>
<address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/> <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
</controller> </controller>
@ -164,26 +160,11 @@ or other application using the libvirt API.
<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>
<channel type='spicevmc'>
<target type='virtio' name='com.redhat.spice.0'/>
<address type='virtio-serial' controller='0' bus='0' port='1'/>
</channel>
<input type='keyboard' bus='virtio'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x0f' function='0x0'/>
</input>
<input type='mouse' bus='ps2'/> <input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/> <input type='keyboard' bus='ps2'/>
<graphics type='spice' keymap='en-us'>
<listen type='socket' socket='/tmp/win10.sock'/>
<image compression='off'/>
</graphics>
<sound model='ich6'> <sound model='ich6'>
<address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x0'/> <address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x0'/>
</sound> </sound>
<video>
<model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
</video>
<hostdev mode='subsystem' type='pci' managed='yes'> <hostdev mode='subsystem' type='pci' managed='yes'>
<source> <source>
<address domain='0x0000' bus='0x00' slot='0x1f' function='0x6'/> <address domain='0x0000' bus='0x00' slot='0x1f' function='0x6'/>
@ -218,8 +199,10 @@ or other application using the libvirt API.
</shmem> </shmem>
</devices> </devices>
<qemu:commandline> <qemu:commandline>
<!-- keyboard evdev passthrough -->
<qemu:arg value='-object'/> <qemu:arg value='-object'/>
<qemu:arg value='input-linux,id=kbd1,evdev=/dev/input/by-path/platform-i8042-serio-0-event-kbd,grab_all=off,repeat=on'/> <qemu:arg value='input-linux,id=kbd1,evdev=/dev/input/by-path/platform-i8042-serio-0-event-kbd,grab_all=off,repeat=on'/>
<!-- audio passthrough -->
<qemu:arg value='-audiodev'/> <qemu:arg value='-audiodev'/>
<qemu:arg value='pa,id=pa1,server=/run/user/1000/pulse/native'/> <qemu:arg value='pa,id=pa1,server=/run/user/1000/pulse/native'/>
</qemu:commandline> </qemu:commandline>

View File

@ -1,10 +1,10 @@
- name: regenerate linux initramfs - name: regenerate linux initramfs
command: /usr/bin/mkinitcpio -p linux command: /usr/bin/mkinitcpio -p linux
- name: restart libvirtd.socket - name: restart libvirtd.service
systemd: systemd:
name: libvirtd.socket name: libvirtd.service
enabled: yes enabled: no
state: restarted state: restarted
- name: restart virtlogd.socket - name: restart virtlogd.socket

View File

@ -59,7 +59,7 @@
nvram = [ nvram = [
"/usr/share/ovmf/x64/OVMF_CODE.fd:/usr/share/ovmf/x64/OVMF_VARS.fd" "/usr/share/ovmf/x64/OVMF_CODE.fd:/usr/share/ovmf/x64/OVMF_VARS.fd"
] ]
notify: restart libvirtd.socket notify: restart libvirtd.service
- name: setup cgroup device acl - name: setup cgroup device acl
blockinfile: blockinfile:
@ -80,9 +80,17 @@
copy: copy:
src: win10.xml src: win10.xml
dest: /etc/libvirt/qemu/win10.xml dest: /etc/libvirt/qemu/win10.xml
validate: /usr/bin/virt-xml-validate %s
notify: restart libvirtd.service
- name: install qemu hook - name: install qemu hook
copy: copy:
src: qemu_hook src: qemu_hook
dest: /etc/libvirt/hooks/qemu dest: /etc/libvirt/hooks/qemu
mode: '755' mode: '755'
- name: enable libvirtd.socket
systemd:
name: libvirtd.socket
enabled: yes