any one try to make vga passthrough work with new kernel(4.1.6 but not 4.3) under igfx+nvidia?

Cong Zhang congzhangzh at gmail.com
Sat Sep 26 02:44:56 PDT 2015


Hello all,

  I try to make VGA pass through works, but always failed.
  I try to manually apply the patch from https://lkml.org/lkml/2014/5/9/517
, it seems the code struct has changed, the the patch does not work as
expect!
  I can make KVM+OVFM work, but for legacy mode, my Nvidia card never
successful pass through to vm.

  something out of expect:
  1. As expect, drm should disable, but glxinfo show direct rendering is yes
  2. disable_vga_mem was called, but no effect

  dome dmesg output:
*dmesg|grep vgaarb*
[    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.1.6
root=UUID=728f9f82-2c79-4054-8b66-df6b92623d52 ro quiet
intel_iommu=on,igfx_off i915.enable_hd_vgaarb=1 enable_hd_vgaarb=1
kvm.allow_unsafe_assigned_interrupts=1 allow_unsafe_assigned_interrupts=1
blacklist.nouveau=1
[    0.000000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.1.6
root=UUID=728f9f82-2c79-4054-8b66-df6b92623d52 ro quiet
intel_iommu=on,igfx_off i915.enable_hd_vgaarb=1 enable_hd_vgaarb=1
kvm.allow_unsafe_assigned_interrupts=1 allow_unsafe_assigned_interrupts=1
blacklist.nouveau=1
[    0.168279] vgaarb: setting as boot device: PCI:0000:00:02.0
[    0.168280] vgaarb: device added:
PCI:0000:00:02.0,decodes=io+mem,owns=io+mem,locks=none
[    0.168283] vgaarb: device added:
PCI:0000:01:00.0,decodes=io+mem,owns=io+mem,locks=none
[    0.168284] vgaarb: loaded
[    0.168284] vgaarb: bridge control possible 0000:01:00.0
[    0.168285] vgaarb: no bridge control possible 0000:00:02.0
[   18.470036] vgaarb: device changed decodes:
PCI:0000:00:02.0,olddecodes=io+mem,decodes=io:owns=io+mem
*dmesg|grep drm*
[   17.640797] [drm] Initialized drm 1.1.0 20060810
[   18.457550] [drm] Memory usable by graphics device = 2048M
[   18.457555] fb: switching to inteldrmfb from simple
[   18.457659] [drm] Replacing VGA console driver
[   18.464174] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[   18.464175] [drm] Driver supports precise vblank timestamp query.
[   18.471443] [drm] Initialized i915 1.6.0 20150327 for 0000:00:02.0 on
minor 0
[   18.494301] fbcon: inteldrmfb (fb0) is primary device
[   18.537278] i915 0000:00:02.0: fb0: inteldrmfb frame buffer device

*dmesg|grep iommu*
[    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.1.6
root=UUID=728f9f82-2c79-4054-8b66-df6b92623d52 ro quiet
intel_iommu=on,igfx_off i915.enable_hd_vgaarb=1 enable_hd_vgaarb=1
kvm.allow_unsafe_assigned_interrupts=1 allow_unsafe_assigned_interrupts=1
blacklist.nouveau=1
[    0.000000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.1.6
root=UUID=728f9f82-2c79-4054-8b66-df6b92623d52 ro quiet
intel_iommu=on,igfx_off i915.enable_hd_vgaarb=1 enable_hd_vgaarb=1
kvm.allow_unsafe_assigned_interrupts=1 allow_unsafe_assigned_interrupts=1
blacklist.nouveau=1
congzhang at debian:~/projects/linux-4.1.6$ dmesg|grep -i iommu
[    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.1.6
root=UUID=728f9f82-2c79-4054-8b66-df6b92623d52 ro quiet
intel_iommu=on,igfx_off i915.enable_hd_vgaarb=1 enable_hd_vgaarb=1
kvm.allow_unsafe_assigned_interrupts=1 allow_unsafe_assigned_interrupts=1
blacklist.nouveau=1
[    0.000000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.1.6
root=UUID=728f9f82-2c79-4054-8b66-df6b92623d52 ro quiet
intel_iommu=on,igfx_off i915.enable_hd_vgaarb=1 enable_hd_vgaarb=1
kvm.allow_unsafe_assigned_interrupts=1 allow_unsafe_assigned_interrupts=1
blacklist.nouveau=1
[    0.000000] Intel-IOMMU: enabled
[    0.000000] Intel-IOMMU: disable GFX device mapping
[    0.022861] dmar: IOMMU 0: reg_base_addr fed90000 ver 1:0 cap
c0000020660462 ecap f0101a
[    0.022866] dmar: IOMMU 1: reg_base_addr fed91000 ver 1:0 cap
d2008020660462 ecap f010da
[    0.022869] IOAPIC id 8 under DRHD base  0xfed91000 IOMMU 1
[    0.453609] IOMMU: dmar1 using Queued invalidation
[    0.453611] IOMMU: Setting RMRR:
[    0.453622] IOMMU: Setting identity map for device 0000:00:14.0
[0x8de7b000 - 0x8de89fff]
[    0.453647] IOMMU: Setting identity map for device 0000:00:1a.0
[0x8de7b000 - 0x8de89fff]
[    0.453667] IOMMU: Setting identity map for device 0000:00:1d.0
[0x8de7b000 - 0x8de89fff]
[    0.453680] IOMMU: Prepare 0-16MiB unity mapping for LPC
[    0.453687] IOMMU: Setting identity map for device 0000:00:1f.0 [0x0 -
0xffffff]
[    0.463405] AMD IOMMUv2 driver by Joerg Roedel <jroedel at suse.de>
[    0.463406] AMD IOMMUv2 functionality not available on this system

* glxinfo|head*
name of display: :0
display: :0  screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:
    GLX_ARB_multisample, GLX_EXT_import_context,
GLX_EXT_texture_from_pixmap,
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer,
    GLX_OML_swap_method, GLX_SGIS_multisample, GLX_SGIX_fbconfig,
    GLX_SGIX_pbuffer, GLX_SGI_make_current_read

*sudo cat /dev/vga_arbiter |head -2*
count:2,PCI:0000:00:02.0,decodes=io,owns=io+mem,locks=none(0:0)
count:2,PCI:0000:00:02.0,decodes=io,owns=io+mem,locks=none(0:0)

*lspci -vnn*
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GK106 [GeForce
GTX 660] [10de:11c0] (rev a1) (prog-if 00 [VGA controller])
Subsystem: Gigabyte Technology Co., Ltd Device [1458:354e]
Flags: bus master, fast devsel, latency 0, IRQ 255
Memory at f6000000 (32-bit, non-prefetchable) [size=16M]
Memory at e0000000 (64-bit, prefetchable) [size=128M]
Memory at e8000000 (64-bit, prefetchable) [size=32M]
I/O ports at e000 [size=128]
Expansion ROM at f7000000 [disabled] [size=512K]
Capabilities: <access denied>

01:00.1 Audio device [0403]: NVIDIA Corporation GK106 HDMI Audio Controller
[10de:0e0b] (rev a1)
Subsystem: Gigabyte Technology Co., Ltd Device [1458:354e]
Flags: bus master, fast devsel, latency 0, IRQ 17
Memory at f7080000 (32-bit, non-prefetchable) [size=16K]
Capabilities: <access denied>
Kernel driver in use: snd_hda_intel

*dmesg|grep monkey(myself log)*
[   18.470027] ---monkey---ret =
intel_fbdev_init(dev);---monkey---begin--i915_disable_vga_mem(dev);---monkey---
/*
Disable VGA memory on Intel HD */
[   18.470038] ---monkey--- run/* Disable VGA memory on Intel HD
*/---monkey---end--i915_disable_vga_mem(dev);

*my version(which not work as expect and has some mor log) of vgaarb(for
debian testing kernel 4.1.6) was attatched!*

*any help or advice will be very appreciate,*

Thanks,
Cong
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.x.org/archives/xorg-devel/attachments/20150926/95a2063e/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: myi915.patch
Type: text/x-patch
Size: 6398 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20150926/95a2063e/attachment-0001.bin>


More information about the xorg-devel mailing list