From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gerd Hoffmann Subject: Re: [vfio-users] [PATCH v3 00/11] igd passthrough chipset tweaks Date: Tue, 02 Feb 2016 08:43:29 +0100 Message-ID: <1454399009.9300.21.camel@redhat.com> References: <1451994098-6972-1-git-send-email-kraxel@redhat.com> <1454009759.7183.7.camel@redhat.com> <1454051359.28516.28.camel@redhat.com> <1454090373.23148.11.camel@redhat.com> <1454330962.10168.34.camel@redhat.com> <1454365016.10542.12.camel@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <1454365016.10542.12.camel@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org Sender: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org To: Alex Williamson Cc: igvt-g@ml01.01.org, xen-devel@lists.xensource.com, Eduardo Habkost , Stefano Stabellini , qemu-devel@nongnu.org, Cao jin , vfio-users@redhat.com List-Id: xen-devel@lists.xenproject.org Hi, > +realloc: > + opregion =3D 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. >=20 > Ah, so here is where we'd clobber data in firmware. I currently do > this in vfio's pci config write in QEMU: >=20 > orig =3D pci_get_long(pdev->config + IGD_OPREGION); > pci_default_write_config(pdev, addr, val, len); > cur =3D pci_get_long(pdev->config + IGD_OPREGION); >=20 > if (cur !=3D orig) { > if (orig) { > memory_region_del_subregion(get_system_memory(), > vdev->igd_opregion->mem); > } >=20 > 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