[vfio-users] [PATCH v3 00/11] igd passthrough chipset tweaks
Gerd Hoffmann
kraxel at redhat.com
Tue Feb 2 07:43:29 UTC 2016
Hi,
> +realloc:
> + opregion = malloc_high(size * 1024);
memalign_high(PAGE_SIZE, size * 1024);
> > I'd have qemu copy the data on 0xfc write then, so things continue to
> > work without updating seabios. So, the firmware has to allocate space,
> > reserve it etc., and programming the 0xfc register. Qemu has to make
> > sure the opregion appears at the address written by the firmware, by
> > whatever method it prefers.
>
> Ah, so here is where we'd clobber data in firmware. I currently do
> this in vfio's pci config write in QEMU:
>
> orig = pci_get_long(pdev->config + IGD_OPREGION);
> pci_default_write_config(pdev, addr, val, len);
> cur = pci_get_long(pdev->config + IGD_OPREGION);
>
> if (cur != orig) {
> if (orig) {
> memory_region_del_subregion(get_system_memory(),
> vdev->igd_opregion->mem);
> }
>
> if (cur) {
> memory_region_add_subregion(get_system_memory(),
> cur, vdev->igd_opregion->mem);
> }
> }
Ok, so we avoid the clobber and qemu sill has the choice to implement
the opregion in different ways, by simply changing how
vdev->igd_opregion->mem is backed. Good.
cheers,
Gerd
More information about the vfio-users
mailing list