[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [iGVT-g] [vfio-users] [PATCH v3 00/11] igd passthrough chipset tweaks

> -----Original Message-----
> From: iGVT-g [mailto:igvt-g-bounces@xxxxxxxxxxxx] On Behalf Of Alex
> Williamson
> Sent: Thursday, January 28, 2016 11:36 AM
> To: Gerd Hoffmann; qemu-devel@xxxxxxxxxx
> Cc: igvt-g@xxxxxxxxxxx; xen-devel@xxxxxxxxxxxxxxxxxxx; Eduardo Habkost;
> Stefano Stabellini; Cao jin; vfio-users@xxxxxxxxxx
> Subject: Re: [iGVT-g] [vfio-users] [PATCH v3 00/11] igd passthrough chipset
> tweaks
> 1) The OpRegion MemoryRegion is mapped into system_memory through
> programming of the 0xFC config space register.
> Âa) vfio-pci could pick an address to do this as it is realized.
> Âb) SeaBIOS/OVMF could program this.
> Discussion: 1.a) Avoids any BIOS dependency, but vfio-pci would need to pick
> an address and mark it as e820 reserved.ÂÂI'm not sure how to pick that
> address.ÂÂWe'd probably want to make the 0xFC config register read-
> only.ÂÂ1.b) has the issue you mentioned where in most cases the OpRegion
> will be 8k, but the BIOS won't know how much address space it's mapping
> into system memory when it writes the 0xFC register.ÂÂI don't know how
> much of a problem this is since the BIOS can easily determine the size once
> mapped and re-map it somewhere there's sufficient space.
> Practically, it seems like it's always going to be 8K.ÂÂThis of course 
> requires
> modification to every BIOS.ÂÂIt also leaves the 0xFC register as a mapping
> control rather than a pointer to the OpRegion in RAM, which doesn't really
> match real hardware.ÂÂThe BIOS would need to pick an address in this case.
> 2) Read-only mappings version of 1)
> Discussion: Really nothing changes from the issues above, just prevents any
> possibility of the guest modifying anything in the host.ÂÂXen apparently 
> allows
> write access to the host page already.
> 3) Copy OpRegion contents into buffer and do either 1) or 2) above.
> Discussion: No benefit that I can see over above other than maybe allowing
> write access that doesn't affect the host.
> 4) Copy contents into a guest RAM location, mark it reserved, point to it via
> 0xFC config as scratch register.
> Âa) Done by QEMU (vfio-pci)
> Âb) Done by SeaBIOS/OVMF
> Discussion: This is the most like real hardware.ÂÂ4.a) has the usual issue of
> how to pick an address, but the benefit of not requiring BIOS changes (simply
> mark the RAM reserved via existing methods).ÂÂ4.b) would require passing a
> buffer containing the contents of the OpRegion via fw_cfg and letting the
> BIOS do the setup.ÂÂThe latter of course requires modifying each BIOS for this
> support.
> Of course none of these support hotplug nor really can they since reserved
> memory regions are not dynamic in the architecture.
> In all cases, some piece of software needs to know where it can place the
> OpRegion in guest memory.ÂÂIt seems like there are advantages or
> disadvantages whether that's done by QEMU or the BIOS, but we only need
> to do it once if it's QEMU.ÂÂSuggestions, comments, preferences?

Hi Alex, another thing to consider is how to communicate to the guest driver 
the address at 0xFC contains a valid GPA address that can be accessed by the 
driver without causing a EPT fault - since the same driver will be used on 
other hypervisors and they may not EPT map OpRegion memory.  On idea proposed 
by display driver team is to set bit0 of the address to 1 for indicating 
OpRegion memory can be safely accessed by the guest driver.

> Another thing I notice in this series is the access to PCI config space of 
> both
> the host bridge and the LPC bridge.  This prevents unprivileged use cases and
> is a barrier to libvirt support since it will need to provide access to the 
> pci-
> sysfs files for the process.ÂÂShould vfio add additional device specific 
> regions
> to expose the config space of these other devices?ÂÂI don't see that there's
> any write access necessary, so these would be read-only.ÂÂThe comment in
> the kernel regarding why an unprivileged user can only access standard
> config space indicates that some devices lockup if unimplemented config
> space is accessed.ÂÂIt seems like that's probably not an issue for recent-ish
> Intel host bridges and LPC devices.ÂÂIf OpRegion, host bridge config, and LPC
> config were all provided through vfio, would there be any need for igd-
> passthrough switches on the machine type?ÂÂIt seems like the QEMU vfio-pci
> driver could enable the necessary features and pre-fill the host and LPC
> bridge config items on demand when parsing an IGD device.ÂÂThanks,
> Alex
> __

> iGVT-g mailing list
> iGVT-g@xxxxxxxxxxxx
> https://lists.01.org/mailman/listinfo/igvt-g
Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.