[vfio-users] Question about integrated GPU passthrough and initialization

Alex Williamson alex.williamson at redhat.com
Fri May 24 19:50:13 UTC 2019


On Fri, 24 May 2019 11:12:41 -0700
Micah Morton <mortonm at chromium.org> wrote:

> I’ve been working with an Intel Chrome OS device to see if integrated
> GPU passthrough works. The device is a 7th Generation (Kaby Lake)
> Intel Core i5-7Y57 with HD Graphics 615. So no discrete GPU. I think
> iGPU passthrough should work on this device.
> 
> Initializing the graphics hardware has proven to be the trickiest part
> in all of this, and I have a question I thought someone on this list
> might be able to answer:
> 
> Why does vfio enforce that I _need_ a VGA rom to be available in order
> to boot the guest in legacy passthrough mode
> (https://github.com/qemu/qemu/blob/master/hw/vfio/pci-quirks.c#L1616)?

"Legacy" mode is largely about setting up components to make the VGA
ROM work.  Some of the components of legacy mode are faking stolen
memory (which really only works for the ROM, not the OS driver), adding
the LPC bridge (not sure of the OS driver dependency on this, but I
think it can be manually added if needed), and adding the OpRegion
(which can also be manually added).  If you only care about OS level
graphics initialization then you probably only need the OpRegion
support, which Intel vGPU also needs but Intel can't provide a
consistent story about how it should work.  So why do you think you
need legacy assignment mode?  Granted UPT mode is just about a
forgotten ideal at Intel, but legacy mode doesn't really solve the
stolen memory dependencies for anyone but the VGA ROM.

> The Intel device I’m working with normally doesn’t initialize the GPU
> at all until the kernel is running, at which point the i915 driver
> does the initialization. So there is never actually any VGA rom
> anywhere on the system at any time for me to grab. I suppose I maybe
> could get one for this hardware from Intel or the web somewhere, but
> seems like if the device can normally initialize the GPU hardware from
> the kernel driver then it wouldn’t be too unreasonable to pass through
> the GPU and let the guest (with the same i915 driver) initialize the
> GPU without using a VGA rom. Do you think it would be reasonable for
> me to find a way to patch qemu/vfio/SeaBIOS to allow for this
> scenario?

I'm still not sure what you're missing versus the options we provide
otherwise.  If your dependency is actually on stolen memory, then
trying to re-enable the hack for legacy mode is likely not to work for
the OS driver.  The fix for that would mean having the host dictate to
the VM an address space hole such that stolen memory could be identity
mapped into the VM (plus safety things like clearing that memory
between users to avoid leaking data).  Thanks,

Alex




More information about the vfio-users mailing list