Re: [PATCH 8/9] vfio/pci: use x86 naming instead of igd

From: Alex Williamson
Date: Thu Feb 11 2021 - 14:45:42 EST


On Thu, 11 Feb 2021 08:44:26 +0000
Christoph Hellwig <hch@xxxxxxxxxxxxx> wrote:

> On Tue, Feb 02, 2021 at 04:59:23PM -0700, Alex Williamson wrote:
> > vfio-pci-igd support knows very little about the device, we're
> > effectively just exposing a firmware table and some of the host bridge
> > config space (read-only). So the idea that the host kernel needs to
> > have updated i915 support in order to expose the device to userspace
> > with these extra regions is a bit silly.
>
> On the other hand assuming the IGD scheme works for every device
> with an Intel Vendor ID and a VGA classcode that hangs off an Intel
> host bridge seems highly dangerous. Is this actually going to work
> for the new discreete Intel graphics? For the old i740? And if not
> what is the failure scenario?

The failure scenario is that we expose read-only copies of the OpRegion
firmware table and host and lpc bridge config space to userspace. Not
exactly dangerous. For discrete graphics we'd simply fail the device
probe if the target device isn't on the root bus. This would cover the
old i740 as well, assuming you're seriously concerned about someone
plugging in a predominantly AGP graphics card from 20+ years ago into a
modern system and trying to assign it to a guest. Thanks,

Alex