public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* VGA arbiter support for Intel HD?
@ 2013-08-14 13:23 Alex Williamson
  2013-08-14 14:47 ` Ville Syrjälä
  0 siblings, 1 reply; 9+ messages in thread
From: Alex Williamson @ 2013-08-14 13:23 UTC (permalink / raw)
  To: intel-gfx

Hi,

I'm trying to add support for device assignment of PCI VGA devices with
VFIO and QEMU.  For normal, discrete discrete graphics the Linux VGA
arbiter works fairly well, disabling VGA on one bridge and adding it to
another (though I wish all the kernel VGA drivers made use of it).  The
i915 driver only seems to support disabling VGA on really old GMCH
devices (see intel_modeset_vga_set_state).  This means that if I boot
with IGD as the primary graphics and attempt to assign a discrete
graphics device, all the VGA range accesses are still routed to IGD, I
end up getting some error messages from the IGD interrupt handler, and
the discrete card never initializes.

I spent some time looking through the Sand Bridge, Ivy Bridge, and
Haswell datasheets, and I'm a bit concerned whether the hardware even
provides a reasonable way to disable VGA anymore.  Quoting 2.17 from the
Haswell docs:

        Accesses to the VGA memory range are directed to IGD depend on
        the configuration.  The configuration is specified by:
              * Internal graphics controller in Device 2 is enabled
                (DEVEN.D2EN bit 4)
              * Internal graphics VGA in Device 0 Function 0 is enabled
                through register GGC bit 1.
              * IGD's memory accesses (PCICMD2 04 – 05h, MAE bit 1) in
                Device 2 configuration space are enabled.
              * VGA compatibility memory accesses (VGA Miscellaneous
                Output register – MSR Register, bit 1) are enabled.
              * Software sets the proper value for VGA Memory Map Mode
                register (VGA GR06 Register, bits 3-2). See the
                following table for translations.

(There's a similar list for VGA I/O range)  I've found that if I disable
memory and I/O in the PCI command register for IGD then I do get VGA
routing to the PEG device and the discrete VBIOS works.  This obviously
isn't a good option for the VGA arbiter since it entirely disables IGD.

The GGC registers aren't meant for runtime switching and are actually
locked.  Disabling IGD via the device 2 enable bit doesn't seem like and
option.  I don't quite understand the VGA miscellaneous output register
and VGA memory map mode, but the table provided for the latter makes me
think they just augment the VGA ranges and don't disable them.

Is it possible to support the VGA arbiter with the latest IGD?  Is
anyone working on it?  Thanks,

Alex

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread
* VGA arbiter support for Intel HD?
@ 2014-04-03 17:47 Friedrich Oslage
  2014-04-03 18:28 ` Alex Williamson
  0 siblings, 1 reply; 9+ messages in thread
From: Friedrich Oslage @ 2014-04-03 17:47 UTC (permalink / raw)
  To: intel-gfx

Hi,

several months ago Alex Williamson added a patch to the linux kernel to
enable VGA arbiter support for the IGD of Intel Core CPUs [1]. But just
a month after that the patch was reverted [2].

With these patches I am able to use VFIO and Qemu to passthrough a GTX
770 while using the Intel HD of a i7 4771 on the host for X.Org/XFCE.

Using the stock 3.14 kernel, without these patches, it doesn't work.
I believe the Nvidia card doesn't get initialized correctly...the
screen stays black and the guest OS is unreachable via network.


What is required to get these patches back into the mainline kernel? I
can not reproduce the issues described in the revert commit log,
perhaps we just need more testing?

Regards,
Friedrich

[1]
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=81b5c7bc8de3e6f63419139c2fc91bf81dea8a7d
[2]
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=ebff5fa9d545574324095d9c6a3cb80c9157abc5

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-04-05  9:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-14 13:23 VGA arbiter support for Intel HD? Alex Williamson
2013-08-14 14:47 ` Ville Syrjälä
2013-08-14 17:14   ` Alex Williamson
2013-08-14 18:30     ` Ville Syrjälä
2013-08-14 19:39       ` Alex Williamson
2013-08-14 20:01         ` Ville Syrjälä
  -- strict thread matches above, loose matches on Subject: below --
2014-04-03 17:47 Friedrich Oslage
2014-04-03 18:28 ` Alex Williamson
2014-04-05  9:42   ` Friedrich Oslage

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox