# QEMU-KVM says no IOMMU. How do I activate it for PCI-PT?

## quarksoup

Hi all,

I'm trying to get qemu-kvm to accept the passthrogh of a USB PCI device and am running into problems.

I have the device parked in pci-stub already.

This is my first attempt at IOMMU passthroughs so I may be missing something stupid   :Confused: 

I'm running the current gentoo-sources with intell_iommu=igfx_off passed to the kernel on boot, without which the kernel never finishes loading with a flood of DMAR messages.

I'm not sure that Vt-d is acctually working, though it is enabled in BIOS. 

The intel i7-Q720 CPU and QM57 chipset support Vt-d according to intel's product specs.

```
dmesg | grep -e IOMMU -e DMAR -e PCI-DMA 
```

 outputs:

```
ACPI: DMAR (v001 INTEL  CP_FIELD 0x00000001 INTL 0x00000001) @ 0x00000000cf75ff18

Intel-IOMMU: disable GFX device mapping

PCI-DMA: Using software bounce buffering for IO (SWIOTLB)

DMAR:Host address width 36

DMAR:DRHD base: 0x000000fed90000 flags: 0x1

IOMMU fed90000: ver 1:0 cap c90780106f0462 ecap f020a2

DMAR:RMRR base: 0x000000cf7d8000 end: 0x000000cf7e6fff

DMAR:No ATSR found
```

The KVM VT-d help page suggests that this is correct.

Kernel docs state that software bouce PCI-DMA the default for intel hardware though I have a feeling that this should be handeld by hardware, I've tried passing 

```
iommu=force
```

 and 

```
intel_iommu=pt
```

 to the kernel with no success. 

I've tried running Xen 4.0 as well, which seems to be able to pass the PCI device to the guest but KVM runs win7 guests faster and supports the vmware guest graphics drivers for full resolution, fullscreen, local sdl use and supports suspend recovery (Xen dies on resume which makes it useless for the intended application).  

Does anyone have any ideas on how to confirm that Vt-d is indeed activated and which kernel modules and qemu-kvm version I should be using?

Thanks!

----------

## quarksoup

100+ Views and no reply? Glad to see I'm not the only who's perplexed by this.

----------

## quarksoup

One last bump, then I'll let it die. Thanks!

----------

## s4e8

did you enable the CONFIG_PCI_IOV and CONFIG_PCI_STUB ?

----------

## aCOSwt

 *quarksoup wrote:*   

> Kernel docs state that software bouce PCI-DMA the default for intel hardware

 

That is what I understand too. SWIOTLB is the fallback when you do not get any hardware IOMMU.

=> I would suggest CONFIG_SWIOTLB=n

----------

## quarksoup

Thanks s4e8 and aCOSwt. I'm just heading back from a business trip and I'll see if I can change that kernel setting when I finally get back home.

----------

## trikolon

hi. 

i hade the same problem and was not able to solve it. now i am using xen und here it is possible to usw IOMMU.

ben

----------

## quarksoup

I do have CONFIG_PCI_IOV and CONFIG_PCI_STUB correctly configured but when I tired to make the changes to the CONFIG_SWIOTLB option I found that they are not available through make menuconfig and are reset on compile when I change the .config file directly.

Thanks trikolon, but unless you know how to get Xen to suspend and hibernate gracefully I can't use it for this production environment.

----------

