3

I have a server with 2 NICs

01:00.0 Ethernet controller: Intel Corporation Ethernet Controller 10-Gigabit X540-AT2 (rev 01) 01:00.1 Ethernet controller: Intel Corporation Ethernet Controller 10-Gigabit X540-AT2 (rev 01)

and i want to assign theise 2 NICs devices to a guest (ubuntu server 14.04) , i'm folowing this topic this topic :How to assign devices with VT-d in KVM so i did what it's says :

  • Modifying kernel config :

    make menuconfig set "Bus options (PCI etc.)" -> "Support for DMA Remapping Devices" to "" set "Bus options (PCI etc.)" -> "Enable DMA Remapping Devices" to "" set "Bus options (PCI etc.)" -> "PCI Stub driver" to "*" save and rebuild kernel

  • my dmesg | grep -e DMAR -e IOMMU shows :

    [ 0.000000] ACPI: DMAR 00000000ddfaabc8 000078 (v01 INTEL SNB 00000001 INTL 00000001) [ 0.000000] Intel-IOMMU: enabled [ 0.018789] dmar: IOMMU 0: reg_base_addr fed90000 ver 1:0 cap >c9008020660262 ecap f010da [ 0.018860] IOAPIC id 2 under DRHD base 0xfed90000 IOMMU 0 [ 1.610427] DMAR: No ATSR found [ 1.610449] IOMMU 0 0xfed90000: using Queued invalidation [ 1.610451] IOMMU: Setting RMRR: [ 1.610460] IOMMU: Setting identity map for device 0000:00:1d.0 >[0xdde16000 - 0xdde32fff] [ 1.610478] IOMMU: Setting identity map for device 0000:00:1a.0 >[0xdde16000 - 0xdde32fff] [ 1.610487] IOMMU: Prepare 0-16MiB unity mapping for LPC [ 1.610494] IOMMU: Setting identity map for device 0000:00:1f.0 [0x0 - 0xffffff]

    • i also Activate Intel VT-d in the kernel by appending the intel_iommu=on parameter to the kernel line of the kernel line in the /boot/grub/grub.conf file
    • setting VT-d on BIOS to enabled
    • unbind nic from host kernel driver :

      echo "8086 10b9" > /sys/bus/pci/drivers/pci-stub/new_id echo 0000:01:00.0 > /sys/bus/pci/devices/0000:01:00.0/driver/unbind echo 0000:01:00.0 > /sys/bus/pci/drivers/pci-stub/bind

    • i verified the unbinding with lspci -k : the driver was pci_stub

And when i add this folowing lines in XML file of guest vm , i got an error

device 01:00.0 already in use

The XML add

hostdev mode='subsystem' type='pci' managed='yes' source address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/ /source /hostdev

Kaminek
  • 31
  • 4

0 Answers0