[vfio-users] failing IGD passthrough on apollo lake - BAR 2 error

Geert Coulommier g.coulommier at gmail.com
Wed Jul 26 17:51:12 UTC 2017


Hi,

I've been trying to get IGD passthrough to work on an ubuntu 17.04 into
linux VM's (Ubuntu 16.04) on an Apollo Lake J3455, using mainly Alex' blog
and this mailing list as a guide, but I keep ending up with a black screen.

There is no other graphics card, so I've been trying with Seabios and the
legacy method. I915 is blacklisted. The host is an Ubuntu 17.04 server with
the Linux kernel upgraded to 4.12.3. Qemu is on 2.8.

I also tried to passthrough the audio card with the same method, and this
worked without a glitch.

>From an extract of the dmesg logfile (see below in [8]) it seems that I'm
also running into the BAR 2 error:
[  192.797993] vfio-pci 0000:00:02.0: BAR 2: can't reserve [mem
0x80000000-0x8fffffff 64bit pref]

Unfortunately, although I did find some references online for this error, I
couldn't find any working solution. Moreover, with the blacklisting and
vfio exclusions for the 2 devices, if I understand correctly, this error
shouldn't even be possible.

Below this message you can find extra info on my config:
[1] host linux version
[2] host qemu version
[3] host grub config
[4] host pci devices
[5] host vfio exclusion of the 2 pci devices (video and audio)
[6] host vfio modules
[7] xml of the Ubuntu 16.04 desktop VM
[8] host log files

If any more information is needed, please let me know.

I have to admit that I'm at a loss at this point. It also feels like I'm
really close to a solution, but I'm just not quite there yet. With all the
research and time already invested in this project, any help would be
greatly appreciated.


Thank you in advance for any assistance,

Kind regards,

Geert



EXTRA INFO:

[1] host linux version:

uname -msr
Linux 4.12.3-041203-generic x86_64

-----------------------------------------------------

[2] host qemu version:

kvm -version
QEMU emulator version 2.8.0(Debian 1:2.8+dfsg-3ubuntu2.3)

-----------------------------------------------------

[3] host grub config:

cat /etc/default/grub
...
GRUB_DEFAULT=0
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=2
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_iommu=on iommu=pt
rd.driver.pre=vfio-pci video=vesafb:off,efifb:off"
GRUB_CMDLINE_LINUX=""
...

-----------------------------------------------------

[4] host pci devices:

lspci -nnk
00:00.0 Host bridge [0600]: Intel Corporation Celeron N3350/Pentium
N4200/Atom E3900 Series Host Bridge [8086:5af0] (rev 0b)
        Subsystem: ASRock Incorporation Atom/Celeron/Pentium Processor
N4200/N3350/E3900 Series Host Bridge [1849:5af0]
00:02.0 VGA compatible controller [0300]: Intel Corporation Device
[8086:5a85] (rev 0b)
        Subsystem: ASRock Incorporation Device [1849:5a85]
        Kernel driver in use: vfio-pci
        Kernel modules: i915
00:0e.0 Audio device [0403]: Intel Corporation Celeron N3350/Pentium
N4200/Atom E3900 Series Audio Cluster [8086:5a98] (rev 0b)
        Subsystem: ASRock Incorporation Atom/Celeron/Pentium Processor
N4200/N3350/E3900 Series Audio Cluster [1849:c892]
        Kernel driver in use: vfio-pci
        Kernel modules: snd_hda_intel, snd_soc_skl
...

-----------------------------------------------------

[5] host vfio exclusion of the 2 pci devices (video and audio):

cat /etc/modprobe.d/vfio.conf
options vfio-pci ids=8086:5a85,8086:5a98
options vfio-pci disable_vga=1

-----------------------------------------------------

[6] vfio modules:

cat /etc/initramfs-tools/modules
...
vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd

-----------------------------------------------------

[7] xml of the Ubuntu 16.04 desktop VM:

 UbuntuVM.xml
<domain type='kvm'>
  <name>ubuntu16.04_desktop</name>
  <uuid>98a7cf88-1b98-47a2-a2eb-4f0cf78b4a3f</uuid>
  <memory unit='KiB'>6144000</memory>
  <currentMemory unit='KiB'>6144000</currentMemory>
  <vcpu placement='static'>4</vcpu>
  <os>
    <type arch='x86_64' machine='pc-i440fx-zesty'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
  </features>
  <cpu mode='host-model'>
    <model fallback='allow'/>
  </cpu>
  <clock offset='utc'>
    <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-spice</emulator>
    <disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='none' io='native'/>
      <source dev='/dev/granada-vg/ubuntu16.04_desktop'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05'
function='0x0'/>
    </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='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01'
function='0x1'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:af:af:31'/>
      <source bridge='virbr0'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03'
function='0x0'/>
    </interface>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <source>
        <address domain='0x0000' bus='0x00' slot='0x0e' 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='0x00' slot='0x02' function='0x0'/>
      </source>
      <rom bar='on'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08'
function='0x0'/>
    </hostdev>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06'
function='0x0'/>
    </memballoon>
  </devices>
</domain>

-----------------------------------------------------

[8] log files host:

dmesg | grep -aiE '((DMAR)|(kvm)|(drm)|(Command line)|(iommu)|(vfio))'
[    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.12.3-041203-generic
root=/dev/mapper/granada--vg-root ro quiet splash intel_iommu=on iommu=pt
rd.driver.pre=vfio-pci video=vesafb:off,efifb:off vt.handoff=7
[    0.000000] ACPI: DMAR 0x000000006D9D0470 0000A8 (v01 INTEL  EDK2
00000003 BRXT 0100000D)
[    0.000000] Kernel command line:
BOOT_IMAGE=/boot/vmlinuz-4.12.3-041203-generic
root=/dev/mapper/granada--vg-root ro quiet splash intel_iommu=on iommu=pt
rd.driver.pre=vfio-pci video=vesafb:off,efifb:off vt.handoff=7
[    0.000000] DMAR: IOMMU enabled
[    0.043824] DMAR: Host address width 39
[    0.043827] DMAR: DRHD base: 0x000000fed64000 flags: 0x0
[    0.043853] DMAR: dmar0: reg_base_addr fed64000 ver 1:0 cap
1c0000c40660462 ecap 7e3ff0505e
[    0.043855] DMAR: DRHD base: 0x000000fed65000 flags: 0x1
[    0.043866] DMAR: dmar1: reg_base_addr fed65000 ver 1:0 cap
d2008c40660462 ecap f050da
[    0.043869] DMAR: RMRR base: 0x0000006d5af000 end: 0x0000006d5cefff
[    0.043872] DMAR: RMRR base: 0x0000006f800000 end: 0x0000007fffffff
[    0.043875] DMAR-IR: IOAPIC id 1 under DRHD base  0xfed65000 IOMMU 1
[    0.043877] DMAR-IR: HPET id 0 under DRHD base 0xfed65000
[    0.043879] DMAR-IR: Queued invalidation will be enabled to support
x2apic and Intr-remapping.
[    0.046017] DMAR-IR: Enabled IRQ remapping in x2apic mode
[    1.795324] DMAR: No ATSR found
[    1.796448] DMAR: dmar0: Using Queued invalidation
[    1.796458] DMAR: dmar1: Using Queued invalidation
[    1.796629] DMAR: Hardware identity mapping for device 0000:00:00.0
[    1.796639] DMAR: Hardware identity mapping for device 0000:00:02.0
[    1.796642] DMAR: Hardware identity mapping for device 0000:00:0e.0
[    1.796651] DMAR: Hardware identity mapping for device 0000:00:0f.0
[    1.796654] DMAR: Hardware identity mapping for device 0000:00:12.0
[    1.796657] DMAR: Hardware identity mapping for device 0000:00:13.0
[    1.796659] DMAR: Hardware identity mapping for device 0000:00:13.1
[    1.796661] DMAR: Hardware identity mapping for device 0000:00:13.2
[    1.796663] DMAR: Hardware identity mapping for device 0000:00:13.3
[    1.796666] DMAR: Hardware identity mapping for device 0000:00:15.0
[    1.796668] DMAR: Hardware identity mapping for device 0000:00:1f.0
[    1.796670] DMAR: Hardware identity mapping for device 0000:00:1f.1
[    1.796675] DMAR: Hardware identity mapping for device 0000:01:00.0
[    1.796680] DMAR: Hardware identity mapping for device 0000:03:00.0
[    1.796681] DMAR: Setting RMRR:
[    1.796684] DMAR: Ignoring identity map for HW passthrough device
0000:00:02.0 [0x6f800000 - 0x7fffffff]
[    1.796685] DMAR: Ignoring identity map for HW passthrough device
0000:00:15.0 [0x6d5af000 - 0x6d5cefff]
[    1.796688] DMAR: Prepare 0-16MiB unity mapping for LPC
[    1.796689] DMAR: Ignoring identity map for HW passthrough device
0000:00:1f.0 [0x0 - 0xffffff]
[    1.796724] DMAR: Intel(R) Virtualization Technology for Directed I/O
[    1.796834] iommu: Adding device 0000:00:00.0 to group 0
[    1.796849] iommu: Adding device 0000:00:02.0 to group 1
[    1.796868] iommu: Adding device 0000:00:0e.0 to group 2
[    1.796888] iommu: Adding device 0000:00:0f.0 to group 3
[    1.796902] iommu: Adding device 0000:00:12.0 to group 4
[    1.796946] iommu: Adding device 0000:00:13.0 to group 5
[    1.796964] iommu: Adding device 0000:00:13.1 to group 5
[    1.796981] iommu: Adding device 0000:00:13.2 to group 5
[    1.797010] iommu: Adding device 0000:00:13.3 to group 5
[    1.797027] iommu: Adding device 0000:00:15.0 to group 6
[    1.797048] iommu: Adding device 0000:00:1f.0 to group 7
[    1.797061] iommu: Adding device 0000:00:1f.1 to group 7
[    1.797071] iommu: Adding device 0000:01:00.0 to group 5
[    1.797081] iommu: Adding device 0000:03:00.0 to group 5
[    2.528485] ata1.00: supports DRM functions and may not be fully
accessible
[    2.530136] ata1.00: supports DRM functions and may not be fully
accessible
[    3.163840] VFIO - User Level meta-driver version: 0.3
[    3.176539] vfio-pci 0000:00:02.0: vgaarb: changed VGA decodes:
olddecodes=io+mem,decodes=io+mem:owns=io+mem
[    3.196189] vfio_pci: add [8086:5a85[ffff:ffff]] class 0x000000/00000000
[    3.216213] vfio_pci: add [8086:5a98[ffff:ffff]] class 0x000000/00000000
[  192.668847] vfio_cap_init: 0000:00:0e.0 pci config conflict @0x80, was
cap 0x9 now cap 0x10
[  192.668851] vfio_cap_init: 0000:00:0e.0 pci config conflict @0x81, was
cap 0x9 now cap 0x10
[  192.668853] vfio_cap_init: 0000:00:0e.0 pci config conflict @0x82, was
cap 0x9 now cap 0x10
[  192.668855] vfio_cap_init: 0000:00:0e.0 pci config conflict @0x83, was
cap 0x9 now cap 0x10
[  192.671623] DMAR: DRHD: handling fault status reg 3
[  192.671686] DMAR: [DMA Write] Request device [00:02.0] fault addr 0
[fault reason 02] Present bit in context entry is clear
[  192.796781] vfio_ecap_init: 0000:00:02.0 hiding ecap 0x1b at 0x100
[  192.797993] vfio-pci 0000:00:02.0: BAR 2: can't reserve [mem
0x80000000-0x8fffffff 64bit pref]
[  203.360382] DMAR: DRHD: handling fault status reg 3
[  203.360484] DMAR: [DMA Write] Request device [00:02.0] fault addr
70096000 [fault reason 05] PTE Write access is not set
...
(last 2 lines keep repeating)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/vfio-users/attachments/20170726/dfc17ded/attachment.htm>


More information about the vfio-users mailing list