<div dir="ltr">Hello all,<div><br><div>  I try to make VGA pass through works, but always failed. </div><div>  I try to manually apply the patch from <a href="https://lkml.org/lkml/2014/5/9/517">https://lkml.org/lkml/2014/5/9/517</a> , it seems the code struct has changed, the the patch does not work as expect!</div><div>  I can make KVM+OVFM work, but for legacy mode, my Nvidia card never successful pass through to vm.</div><div><br></div><div>  something out of expect:</div><div>  1. As expect, drm should disable, but glxinfo show direct rendering is yes</div><div>  2. disable_vga_mem was called, but no effect</div><div><br></div><div>  dome dmesg output:</div><div><div><b>dmesg|grep vgaarb</b></div><div>[    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</div><div>[    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</div><div>[    0.168279] vgaarb: setting as boot device: PCI:0000:00:02.0</div><div>[    0.168280] vgaarb: device added: PCI:0000:00:02.0,decodes=io+mem,owns=io+mem,locks=none</div><div>[    0.168283] vgaarb: device added: PCI:0000:01:00.0,decodes=io+mem,owns=io+mem,locks=none</div><div>[    0.168284] vgaarb: loaded</div><div>[    0.168284] vgaarb: bridge control possible 0000:01:00.0</div><div>[    0.168285] vgaarb: no bridge control possible 0000:00:02.0</div><div>[   18.470036] vgaarb: device changed decodes: PCI:0000:00:02.0,olddecodes=io+mem,decodes=io:owns=io+mem</div></div><div><div><b>dmesg|grep drm</b></div><div>[   17.640797] [drm] Initialized drm 1.1.0 20060810</div><div>[   18.457550] [drm] Memory usable by graphics device = 2048M</div><div>[   18.457555] fb: switching to inteldrmfb from simple</div><div>[   18.457659] [drm] Replacing VGA console driver</div><div>[   18.464174] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).</div><div>[   18.464175] [drm] Driver supports precise vblank timestamp query.</div><div>[   18.471443] [drm] Initialized i915 1.6.0 20150327 for 0000:00:02.0 on minor 0</div><div>[   18.494301] fbcon: inteldrmfb (fb0) is primary device</div><div>[   18.537278] i915 0000:00:02.0: fb0: inteldrmfb frame buffer device</div></div><div><br></div><div><div><b>dmesg|grep iommu</b></div><div>[    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</div><div>[    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</div><div>congzhang@debian:~/projects/linux-4.1.6$ dmesg|grep -i iommu</div><div>[    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</div><div>[    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</div><div>[    0.000000] Intel-IOMMU: enabled</div><div>[    0.000000] Intel-IOMMU: disable GFX device mapping</div><div>[    0.022861] dmar: IOMMU 0: reg_base_addr fed90000 ver 1:0 cap c0000020660462 ecap f0101a</div><div>[    0.022866] dmar: IOMMU 1: reg_base_addr fed91000 ver 1:0 cap d2008020660462 ecap f010da</div><div>[    0.022869] IOAPIC id 8 under DRHD base  0xfed91000 IOMMU 1</div><div>[    0.453609] IOMMU: dmar1 using Queued invalidation</div><div>[    0.453611] IOMMU: Setting RMRR:</div><div>[    0.453622] IOMMU: Setting identity map for device 0000:00:14.0 [0x8de7b000 - 0x8de89fff]</div><div>[    0.453647] IOMMU: Setting identity map for device 0000:00:1a.0 [0x8de7b000 - 0x8de89fff]</div><div>[    0.453667] IOMMU: Setting identity map for device 0000:00:1d.0 [0x8de7b000 - 0x8de89fff]</div><div>[    0.453680] IOMMU: Prepare 0-16MiB unity mapping for LPC</div><div>[    0.453687] IOMMU: Setting identity map for device 0000:00:1f.0 [0x0 - 0xffffff]</div><div>[    0.463405] AMD IOMMUv2 driver by Joerg Roedel <<a href="mailto:jroedel@suse.de">jroedel@suse.de</a>></div><div>[    0.463406] AMD IOMMUv2 functionality not available on this system</div></div><div><br></div><div><div><b> glxinfo|head</b></div><div>name of display: :0</div><div>display: :0  screen: 0</div><div>direct rendering: Yes</div><div>server glx vendor string: SGI</div><div>server glx version string: 1.4</div><div>server glx extensions:</div><div>    GLX_ARB_multisample, GLX_EXT_import_context, GLX_EXT_texture_from_pixmap, </div><div>    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer, </div><div>    GLX_OML_swap_method, GLX_SGIS_multisample, GLX_SGIX_fbconfig, </div><div>    GLX_SGIX_pbuffer, GLX_SGI_make_current_read</div></div><div><br></div><div><div><b>sudo cat /dev/vga_arbiter |head -2</b></div><div>count:2,PCI:0000:00:02.0,decodes=io,owns=io+mem,locks=none(0:0)</div><div>count:2,PCI:0000:00:02.0,decodes=io,owns=io+mem,locks=none(0:0)</div></div><div><br></div><div><b>lspci -vnn</b><br></div><div><div>01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GK106 [GeForce GTX 660] [10de:11c0] (rev a1) (prog-if 00 [VGA controller])</div><div><span class="" style="white-space:pre">    </span>Subsystem: Gigabyte Technology Co., Ltd Device [1458:354e]</div><div><span class="" style="white-space:pre"> </span>Flags: bus master, fast devsel, latency 0, IRQ 255</div><div><span class="" style="white-space:pre"> </span>Memory at f6000000 (32-bit, non-prefetchable) [size=16M]</div><div><span class="" style="white-space:pre">   </span>Memory at e0000000 (64-bit, prefetchable) [size=128M]</div><div><span class="" style="white-space:pre">      </span>Memory at e8000000 (64-bit, prefetchable) [size=32M]</div><div><span class="" style="white-space:pre">       </span>I/O ports at e000 [size=128]</div><div><span class="" style="white-space:pre">       </span>Expansion ROM at f7000000 [disabled] [size=512K]</div><div><span class="" style="white-space:pre">   </span>Capabilities: <access denied></div><div><br></div><div>01:00.1 Audio device [0403]: NVIDIA Corporation GK106 HDMI Audio Controller [10de:0e0b] (rev a1)</div><div><span class="" style="white-space:pre">        </span>Subsystem: Gigabyte Technology Co., Ltd Device [1458:354e]</div><div><span class="" style="white-space:pre"> </span>Flags: bus master, fast devsel, latency 0, IRQ 17</div><div><span class="" style="white-space:pre">  </span>Memory at f7080000 (32-bit, non-prefetchable) [size=16K]</div><div><span class="" style="white-space:pre">   </span>Capabilities: <access denied></div><div><span class="" style="white-space:pre">        </span>Kernel driver in use: snd_hda_intel</div></div><div><br></div><div><div><b>dmesg|grep monkey(myself log)</b></div><div>[   18.470027] ---monkey---ret = intel_fbdev_init(dev);---monkey---begin--i915_disable_vga_mem(dev);---monkey---<span class="" style="white-space:pre">        </span>/* Disable VGA memory on Intel HD */</div><div>[   18.470038] ---monkey---<span class="" style="white-space:pre">   </span>run/* Disable VGA memory on Intel HD */---monkey---end--i915_disable_vga_mem(dev);</div></div><div><br></div><div><b>my version(which not work as expect and has some mor log) of vgaarb(for debian testing kernel 4.1.6) was attatched!</b></div><div><br></div><div><b>any help or advice will be very appreciate,</b></div><div><br></div><div>Thanks,</div><div>Cong</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div></div>