# yet another pci/pci-e kvm passthrough question

## dab_s_bad

Greetings to everyone!,

its been a while  :Smile: 

anyways, I'm setting up a gentoo box that will host VM's via KVM/Qemu.

host details:

-Intel XEON E5520 http://ark.intel.com/products/40200/Intel-Xeon-Processor-E5520-8M-Cache-2_26-GHz-5_86-GTs-Intel-QPI

-Intel DX58S0 motherboard

-4GB RAM [at the moment]

what I'm trying to do is to passthrough a pci-e LAN/NIC but seems to fail.

I have read these for passthrough:

http://www.linux-kvm.org/page/How_to_assign_devices_with_VT-d_in_KVM

https://wiki.gentoo.org/wiki/QEMU/Options#PCI_pass-through

here is what I did:

```
hypervisor ~ # qemu-system-x86_64 -enable-kvm -cpu host -net vde -net nic -m 512M -cdrom /home/qemu/systemrescuecd-x86-4.5.4.iso -vnc 192.168.1.65:1 -device kvm-pci-assign,host=00:30.0

qemu-system-x86_64: -device kvm-pci-assign,host=00:30.0: Property 'kvm-pci-assign.host' doesn't take value '00:30.0'
```

I did try to follow it but no avail...  :Sad: 

tried also using virt-install..., and the result:

```
hypervisor ~ # virt-install --name dualNIC --memory 512 --cpu host --vcpus 2 --virt-type kvm --hvm --nodisks --cdrom /home/qemu/systemrescuecd-x86-4.5.4.iso --host-device=pci_0000_03_00_0 --network network:default --graphics vnc

WARNING  No operating system detected, VM performance may suffer. Specify an OS with --os-variant for optimal results.

Starting install...

ERROR    internal error: early end of file from monitor: possible problem:

2015-10-22T10:48:33.690341Z qemu-system-x86_64: -device pci-assign,configfd=19,host=03:00.0,id=hostdev0,bus=pci.0,addr=0x4: Could not open '/sys/bus/pci/devices/0000:03:00.0/resource': Permission denied

Domain installation does not appear to have been successful.

If it was, you can restart your domain by running:

  virsh --connect qemu:///system start dualNIC

otherwise, please restart your installation.
```

some info on the pci-e lan am trying to passthrough

```
hypervisor ~ # lspci -nn | grep 03:00.0

03:00.0 Ethernet controller [0200]: Intel Corporation 82573L Gigabit Ethernet Controller [8086:109a]
```

my emerge --info:  https://bpaste.net/show/c1483b8b73e6

my kernel config: https://bpaste.net/show/4dfc31b49f65

dmesg if you need:  https://bpaste.net/show/1337cde7626a

its been more than 2days already for me on this, any help is appreciated  :Smile: 

thanks in advance!

----------

## hceline

Have you assigned the card to vfio-pci and booted with "iommu=on" or "iommu=pt"?

Edit: You seem to have switched the numbers here:

 *Quote:*   

> qemu-system-x86_64: -device kvm-pci-assign,host=00:30.0: Property 'kvm-pci-assign.host' doesn't take value '00:30.0'

 

00:30.0 should be 03:00.0 as below 

 *Quote:*   

> 03:00.0 Ethernet controller [0200]: Intel Corporation 82573L Gigabit Ethernet Controller [8086:109a]	
> 
> 

 

Edit 2:

The "Could not open '/sys/bus/pci/devices/0000:03:00.0/resource': Permission denied" error should go away if you start qemu as root.

----------

## dab_s_bad

I seem to have resolved it.

as hceline also pointed out, it needs a boot option of "intel_iommu=on" [for intel]

afterwards, you need to unbind the needed device [like below for example]:

```
root #echo "8086 284b" > /sys/bus/pci/drivers/pci-stub/new_id

root #echo "0000:00:1b.0" > /sys/bus/pci/devices/0000:00:1b.0/driver/unbind

root #echo "0000:00:1b.0" > /sys/bus/pci/drivers/pci-stub/bind
```

and then enable this if it complains something like: "No interrupt remapping support...."

execute this also:

```
echo 1 > /sys/module/kvm/parameters/allow_unsafe_assigned_interrupts
```

pci passthru seems to be working and am happy ATM  :Smile: 

thanks to all!

----------

## TigerJr

 *Quote:*   

> [    0.015908] This system BIOS has enabled interrupt remapping
> 
>                on a chipset that contains an erratum making that
> 
>                feature unstable.  To maintain system stability
> ...

 

I found this message in your dmesg. Maybe this message helps you to understand USB\PCI Passthrough needs.

----------

