Raison d'être
Hardware
CPU: AMD FX 8350 Black Edition Motherboard: ASUSTek Sabertooth 990 FX (r1.0) GPU 1 (Host): Nvidia Geforce 750 Ti GPU 2 (Guest): Nvidia Geforce 760 RAM: 16 GB Guest: Windows 7 x64 /Windows 10 x64 Host: Xubuntu 15:10 / 16:04 / antiX MX 15 Debian Testing (Stretch) 8.5 | CPU: AMD Phenom II 965 Black Edition Motherboard: ASUSTek Sabertooth 990 FX (r1.0) GPU 1 (Host): Nvidia Geforce 440 GTX GPU 2 (Guest): Nvidia Geforce 750 Ti RAM: 16 GB Guest: Windows 7 x64 Host: Xubuntu 15:10 |
Software
sudo apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils |
Add Modules
In your favourite text editor open /etc/modules and add:
pci_stubvfio vfio_iommu_type1 vfio_pci kvm kvm_amd |
kvm_intel |
Edit Grub
Mine looks like this now:
sudo update-grub |
BIOS changes
Verify that the kernel booted with the desired updates to the command line. We can check this by entering this at the command line:
cat /proc/cmdline |
BOOT_IMAGE=/boot/vmlinuz-4.2.0-36-generic root=UUID=df119ac4-a72f-4f74-af03-26083698a5aa ro quiet splash intel_iommu=on vfio_iommu_type1.allow_unsafe_interrupts=1
BOOT_IMAGE=/boot/vmlinuz-4.2.0-36-generic root=UUID=df119ac4-a72f-4f74-af03-26083698a5aa ro quiet splash ivrs_ioapic[9]=00:14.0 ivrs_ioapic[10]=00:00.1
Motherboards with broken BIOS ivrs tables
E.G. my Sabretooth 990 FX rev. 1.0
[ 0.297481] [Firmware Bug]: AMD-Vi: IOAPIC[9] not in IVRS table [ 0.297485] [Firmware Bug]: AMD-Vi: IOAPIC[10] not in IVRS table [ 0.297487] [Firmware Bug]: AMD-Vi: No southbridge IOAPIC found in IVRS table [ 0.297490] AMD-Vi: Disabling interrupt remapping due to BIOS Bug(s) |
dmesg | grep AMD-Vi |
If you have the correct setting setting you should see something like this:
[ 1.750889] AMD-Vi: Found IOMMU at 0000:00:00.2 cap 0x40 [ 1.750890] AMD-Vi: Interrupt remapping enabled [ 1.750992] AMD-Vi: Initialized for Passthrough Mode |
AMD-Vi: Lazy IO/TLB flushing enabled |
amd_iommu=on iommu=pt |
iommu= amd_iommu= amd_iommu_dump= | [x86] off force noforce biomerge panic nopanic merge nomerge forcesac soft pt [x86, IA-64] [HW,X86-64] Pass parameters to the AMD IOMMU driver in the system. Possible values are: fullflush - enable flushing of IO/TLB entries when they are unmapped. Otherwise they are flushed before they will be reused, which is a lot of faster off - do not initialize any AMD IOMMU found in the system force_isolation - Force device isolation for all devices. The IOMMU driver is not allowed anymore to lift isolation requirements as needed. This option does not override iommu=pt [HW,X86-64] Enable AMD IOMMU driver option to dump the ACPI table for AMD IOMMU. With this option enabled, AMD IOMMU driver will print ACPI tables for AMD IOMMU during IOMMU initialization. |