summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore6
-rw-r--r--configs/win7.xml136
-rw-r--r--configs/win8.xml184
-rw-r--r--doc/build/pcie_passthrough.pdfbin32795 -> 34479 bytes
-rw-r--r--doc/pcie_passthrough.tex49
5 files changed, 357 insertions, 18 deletions
diff --git a/.gitignore b/.gitignore
index a44cbfa..6a7b3ab 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,3 @@
-./doc/build/*.aux
-./doc/build/*.log
-./doc/build/*.out
+doc/**/*.aux
+doc/**/*.log
+doc/**/*.out
diff --git a/configs/win7.xml b/configs/win7.xml
new file mode 100644
index 0000000..85a62f9
--- /dev/null
+++ b/configs/win7.xml
@@ -0,0 +1,136 @@
+<domain type='kvm'>
+ <name>win7</name>
+ <uuid>6819b8dc-01f4-4975-827f-49a93b06d523</uuid>
+ <title>Windows 7 Pro</title>
+ <memory unit='KiB'>8392704</memory>
+ <currentMemory unit='KiB'>8392704</currentMemory>
+ <vcpu placement='static'>4</vcpu>
+ <os>
+ <type arch='x86_64' machine='pc-i440fx-2.7'>hvm</type>
+ <loader type='rom'>/usr/share/OVMF/OVMF_CODE.fd</loader>
+ </os>
+ <features>
+ <acpi/>
+ <apic/>
+ <hyperv>
+ <relaxed state='off'/>
+ <vapic state='off'/>
+ <spinlocks state='off'/>
+ <vendor_id state='on' value='whatever'/>
+ </hyperv>
+ <kvm>
+ <hidden state='on'/>
+ </kvm>
+ <vmport state='off'/>
+ </features>
+ <cpu mode='custom' match='exact'>
+ <model fallback='allow'>Skylake-Client</model>
+ </cpu>
+ <clock offset='localtime'>
+ <timer name='rtc' tickpolicy='catchup'/>
+ <timer name='pit' tickpolicy='delay'/>
+ <timer name='hpet' present='no'/>
+ </clock>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>restart</on_crash>
+ <pm>
+ <suspend-to-mem enabled='no'/>
+ <suspend-to-disk enabled='no'/>
+ </pm>
+ <devices>
+ <emulator>/usr/bin/kvm</emulator>
+ <disk type='file' device='cdrom'>
+ <driver name='qemu' type='raw'/>
+ <target dev='sda' bus='sata'/>
+ <readonly/>
+ <boot order='2'/>
+ <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+ </disk>
+ <disk type='block' device='disk'>
+ <driver name='qemu' type='raw' cache='none' io='native'/>
+ <source dev='/dev/md/win7'/>
+ <target dev='sdb' bus='sata'/>
+ <boot order='3'/>
+ <address type='drive' controller='0' bus='0' target='0' unit='1'/>
+ </disk>
+ <controller type='usb' index='0' model='ich9-ehci1'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x7'/>
+ </controller>
+ <controller type='usb' index='0' model='ich9-uhci1'>
+ <master startport='0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0' multifunction='on'/>
+ </controller>
+ <controller type='usb' index='0' model='ich9-uhci2'>
+ <master startport='2'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x1'/>
+ </controller>
+ <controller type='usb' index='0' model='ich9-uhci3'>
+ <master startport='4'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x2'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <controller type='sata' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
+ </controller>
+ <controller type='virtio-serial' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
+ </controller>
+ <interface type='network'>
+ <mac address='52:54:00:0d:91:06'/>
+ <source network='default'/>
+ <model type='rtl8139'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+ </interface>
+ <serial type='pty'>
+ <target port='0'/>
+ </serial>
+ <console type='pty'>
+ <target type='serial' port='0'/>
+ </console>
+ <channel type='spicevmc'>
+ <target type='virtio' name='com.redhat.spice.0'/>
+ <address type='virtio-serial' controller='0' bus='0' port='1'/>
+ </channel>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <graphics type='spice' autoport='yes'>
+ <listen type='address'/>
+ </graphics>
+ <sound model='ich6'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </sound>
+ <video>
+ <model type='vga' vram='1048576' heads='1' primary='yes'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x0b' function='0x0'/>
+ </video>
+ <hostdev mode='subsystem' type='pci' managed='yes'>
+ <source>
+ <address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
+ </source>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
+ </hostdev>
+ <hostdev mode='subsystem' type='pci' managed='yes'>
+ <source>
+ <address domain='0x0000' bus='0x01' slot='0x00' function='0x1'/>
+ </source>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
+ </hostdev>
+ <hostdev mode='subsystem' type='pci' managed='yes'>
+ <source>
+ <address domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
+ </source>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
+ </hostdev>
+ <redirdev bus='usb' type='spicevmc'>
+ <address type='usb' bus='0' port='1'/>
+ </redirdev>
+ <redirdev bus='usb' type='spicevmc'>
+ <address type='usb' bus='0' port='2'/>
+ </redirdev>
+ <memballoon model='virtio'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
+ </memballoon>
+ </devices>
+</domain>
+
diff --git a/configs/win8.xml b/configs/win8.xml
new file mode 100644
index 0000000..a593e7c
--- /dev/null
+++ b/configs/win8.xml
@@ -0,0 +1,184 @@
+<domain type='kvm' id='2' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
+ <name>win8</name>
+ <uuid>e9b56499-0472-448b-a66f-a40636e13919</uuid>
+ <title>Windows 8.1 Pro</title>
+ <memory unit='KiB'>12582912</memory>
+ <currentMemory unit='KiB'>12582912</currentMemory>
+ <vcpu placement='static'>4</vcpu>
+ <resource>
+ <partition>/machine</partition>
+ </resource>
+ <os>
+ <type arch='x86_64' machine='pc-i440fx-2.7'>hvm</type>
+ <boot dev='hd'/>
+ <bootmenu enable='no'/>
+ </os>
+ <features>
+ <acpi/>
+ <apic/>
+ <kvm>
+ <hidden state='on'/>
+ </kvm>
+ </features>
+ <cpu mode='custom' match='exact'>
+ <model fallback='forbid'>Skylake-Client</model>
+ <vendor>Intel</vendor>
+ <topology sockets='1' cores='4' threads='1'/>
+ </cpu>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>restart</on_crash>
+ <pm>
+ <suspend-to-mem enabled='no'/>
+ <suspend-to-disk enabled='no'/>
+ </pm>
+ <devices>
+ <emulator>/usr/bin/kvm</emulator>
+ <disk type='file' device='cdrom'>
+ <driver name='qemu' type='raw' cache='none'/>
+ <source file='/home/libvirt/isos/xplane_10_dvd1.iso'/>
+ <backingStore/>
+ <target dev='sdd' bus='sata'/>
+ <readonly/>
+ <alias name='sata0-0-3'/>
+ <address type='drive' controller='0' bus='0' target='0' unit='3'/>
+ </disk>
+ <disk type='block' device='disk'>
+ <driver name='qemu' type='raw' cache='none' io='native'/>
+ <source dev='/dev/md/win8'/>
+ <backingStore/>
+ <target dev='sdf' bus='sata'/>
+ <alias name='sata0-0-5'/>
+ <address type='drive' controller='0' bus='0' target='0' unit='5'/>
+ </disk>
+ <disk type='block' device='disk'>
+ <driver name='qemu' type='raw' cache='none' io='native'/>
+ <source dev='/dev/disk/by-uuid/420CB1411267E812'/>
+ <backingStore/>
+ <target dev='sdg' bus='sata'/>
+ <alias name='sata1-0-0'/>
+ <address type='drive' controller='1' bus='0' target='0' unit='0'/>
+ </disk>
+ <controller type='usb' index='0' model='ich9-ehci1'>
+ <alias name='usb'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x7'/>
+ </controller>
+ <controller type='usb' index='0' model='ich9-uhci1'>
+ <alias name='usb'/>
+ <master startport='0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0' multifunction='on'/>
+ </controller>
+ <controller type='usb' index='0' model='ich9-uhci2'>
+ <alias name='usb'/>
+ <master startport='2'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x1'/>
+ </controller>
+ <controller type='usb' index='0' model='ich9-uhci3'>
+ <alias name='usb'/>
+ <master startport='4'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x2'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'>
+ <alias name='pci.0'/>
+ </controller>
+ <controller type='sata' index='0'>
+ <alias name='sata0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
+ </controller>
+ <controller type='sata' index='1'>
+ <alias name='sata1'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
+ </controller>
+ <controller type='fdc' index='0'>
+ <alias name='fdc0'/>
+ </controller>
+ <controller type='virtio-serial' index='0'>
+ <alias name='virtio-serial0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+ </controller>
+ <interface type='network'>
+ <mac address='52:54:00:cb:8c:ff'/>
+ <source network='default' bridge='virbr0'/>
+ <target dev='vnet0'/>
+ <model type='rtl8139'/>
+ <alias name='net0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </interface>
+ <serial type='pty'>
+ <source path='/dev/pts/2'/>
+ <target port='0'/>
+ <alias name='serial0'/>
+ </serial>
+ <console type='pty' tty='/dev/pts/2'>
+ <source path='/dev/pts/2'/>
+ <target type='serial' port='0'/>
+ <alias name='serial0'/>
+ </console>
+ <channel type='spicevmc'>
+ <target type='virtio' name='com.redhat.spice.0' state='disconnected'/>
+ <alias name='channel0'/>
+ <address type='virtio-serial' controller='0' bus='0' port='1'/>
+ </channel>
+ <input type='mouse' bus='ps2'>
+ <alias name='input0'/>
+ </input>
+ <input type='keyboard' bus='ps2'>
+ <alias name='input1'/>
+ </input>
+ <hostdev mode='subsystem' type='pci' managed='yes'>
+ <driver name='vfio'/>
+ <source>
+ <address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
+ </source>
+ <alias name='hostdev0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+ </hostdev>
+ <hostdev mode='subsystem' type='pci' managed='yes'>
+ <driver name='vfio'/>
+ <source>
+ <address domain='0x0000' bus='0x01' slot='0x00' function='0x1'/>
+ </source>
+ <alias name='hostdev1'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
+ </hostdev>
+ <hostdev mode='subsystem' type='pci' managed='yes'>
+ <driver name='vfio'/>
+ <source>
+ <address domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
+ </source>
+ <alias name='hostdev2'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x0b' function='0x0'/>
+ </hostdev>
+ <hostdev mode='subsystem' type='pci' managed='yes'>
+ <driver name='vfio'/>
+ <source>
+ <address domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
+ </source>
+ <alias name='hostdev3'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
+ </hostdev>
+ <hostdev mode='subsystem' type='pci' managed='yes'>
+ <driver name='vfio'/>
+ <source>
+ <address domain='0x0000' bus='0x02' slot='0x00' function='0x1'/>
+ </source>
+ <alias name='hostdev4'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x0c' function='0x0'/>
+ </hostdev>
+ <memballoon model='virtio'>
+ <alias name='balloon0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
+ </memballoon>
+ </devices>
+ <seclabel type='none' model='none'/>
+ <seclabel type='dynamic' model='dac' relabel='yes'>
+ <label>+119:+128</label>
+ <imagelabel>+119:+128</imagelabel>
+ </seclabel>
+ <qemu:commandline>
+ <qemu:arg value='-drive'/>
+ <qemu:arg value='if=pflash,format=raw,readonly,file=/usr/share/ovmf/OVMF.fd'/>
+ </qemu:commandline>
+</domain>
+
diff --git a/doc/build/pcie_passthrough.pdf b/doc/build/pcie_passthrough.pdf
index c219d31..ac0510e 100644
--- a/doc/build/pcie_passthrough.pdf
+++ b/doc/build/pcie_passthrough.pdf
Binary files differ
diff --git a/doc/pcie_passthrough.tex b/doc/pcie_passthrough.tex
index 1528593..69c7fe7 100644
--- a/doc/pcie_passthrough.tex
+++ b/doc/pcie_passthrough.tex
@@ -92,8 +92,11 @@
essendo utilizzato soprattuto nei servers il ciclo di testing e updates è
molto lento in modo da avere sempre un supporto legacy e un sistema stabile.
Purtroppo però attualmente (12.2016) Debian 8 Jessie ha ancora la kernel
- 3.16 quindi si deve abilitare il supporto backport per poter installare una
- versione aggiornata della kernel. \\
+ 3.16 quindi si deve utilizzare la versione testing (9) Stretch. Anche se
+ Debian Testing non \`e pensato per essere utilizzato come sistema primario
+ (i bug possono essere ignorati a lungo nei repo) il supporto di
+ aggiornamenti software \`e garantito per un perido molto pi\`u esteso delle
+ altre distro. \\
Prima di installare il sistema operativo è consigliato rimuovere la GPU che
si utilizzerà per il passthrough dallo slot PCI per evitare che Linux si
@@ -107,8 +110,9 @@
\section{Kernel Modules and GRUB}
Normalmente Debian viene con GRUB2 preinstallato come bootloader, se si
dovesse avere un altro bootloader si deve semplicemente passare gli stessi
- parametri alla kernel quando si avvia. \\
+ parametri alla kernel quando si avvia.
+ \subsection{IOMMU}
Dalla kernel 3.9 Linux ha introdotto gli iommu\_groups che permettono di
mappare dispositivi di memoria reale ad indirizzi virtuali che possono
essere a loro volta passati alla VM. Per poter utilizzare questa
@@ -136,7 +140,7 @@
\% lspci -nnk | grep -i -A2 nvidia \\
02:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP107 [GeForce GTX 1050 Ti] [10de:1c82] (rev a1) \\
~~~~~~~~Subsystem: Micro-Star International Co., Ltd. [MSI] GP107 [GeForce GTX 1050 Ti] [1462:8c96] \\
- ~~~~~~~~Kernel driver in use: nouveau \\
+ ~~~~~~~~Kernel driver in use: {\bf nouveau} \\
-- \\
02:00.1 Audio device [0403]: NVIDIA Corporation Device [10de:0fb9] (rev a1) \\
~~~~~~~~Subsystem: Micro-Star International Co., Ltd. [MSI] Device [1462:8c96] \\
@@ -217,17 +221,32 @@ WantedBy=multi-user.target
Before=libvirt-guests.service \end{verbatim}
\end{framed}
- \section*{Appendici}
- \subsection*{i915 Skylake iGPU support} \label{skylakeigpu}
- Attualmente (12.2016) i driver grafici per i nuovi processori intel di
- architettura skylake sono disponibili e relativamente stabili dalle kernel
- 4.7+, quindi nella mia installazione di debian ho deciso di utilizzare il
- backport della kernel 4.8.0. Per abilitare i backports si deve aggiungere
- un nuovo repo nel file `/etc/apt/sources.list'.
- \begin{framed}\raggedright
- \# file: /etc/apt/sources.list \\
- deb http://ftp.debian.org/debian jessie-backports main non-free
+ \section{Installare la VM}
+ Come sistema operativo guest conglio Windows 8+, poich\`e il supporto
+ dell'UEFI \`e migliorato e per esperienza trovo che Windows 7 sia pi\`u
+ complicato da configurare (errori di drivers video).
+
+ \subsection{Dispositivo di installazione}
+ Per installare l'OS guest \`e necessario avere un immagine di installazione
+ bootable perch\`e OVMF non supporta l'avvio di CDROM (o di altri sistemi
+ legacy). Da un disco di installazione normalmente \`e possibile genereare un
+ disco di installazione uefi utilizzando una memoria USB formattata in FAT32.
+
+ \subsection{Installazione}
+ Per creare la VM in libvirt \`e possibile utilizzare virt-manager che ha uno
+ strumento con interfaccia grafica, in alternativa \`e possibile utilizzare
+ virt-install dalla linea di comando.
+
+ \begin{framed}
+ \begin{verbatim}
+% virt-install --connect qemu:///system \
+ --name win8 \
+ --memory 8169 \
+ --vcpus sockets=1,cores=2,threads=2 \
+ --cpu Skylake-Client \
+ --metadata title="Windows 8.1" \
+ --disk ~/vm_images/windows8.raw,cache=none \
+ --network ... \end{verbatim}
\end{framed}
- Successivamente si deve aggiornare la kernel e i driver grafici mesa
\end{document}