From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Williamson Subject: Re: [iGVT-g] [vfio-users] [PATCH v3 00/11] igd passthrough chipset tweaks Date: Sun, 31 Jan 2016 10:42:12 -0700 Message-ID: <1454262132.10542.1.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> <003AAFE53969E14CB1F09B6FD68C3CD47BB681B7@ORSMSX106.amr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <003AAFE53969E14CB1F09B6FD68C3CD47BB681B7@ORSMSX106.amr.corp.intel.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: "Kay, Allen M" , Gerd Hoffmann , David Woodhouse 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 On Sat, 2016-01-30 at 01:18 +0000, Kay, Allen M wrote: >=C2=A0 > > -----Original Message----- > > From: iGVT-g [mailto:igvt-g-bounces@lists.01.org] On Behalf Of Alex > > Williamson > > Sent: Friday, January 29, 2016 10:00 AM > > To: Gerd Hoffmann > > Cc: igvt-g@ml01.01.org; xen-devel@lists.xensource.com; Eduardo Habkos= t; > > Stefano Stabellini; qemu-devel@nongnu.org; Cao jin; vfio- > > users@redhat.com > > Subject: Re: [iGVT-g] [vfio-users] [PATCH v3 00/11] igd passthrough c= hipset > > tweaks > >=C2=A0 > > Do guest drivers depend on IGD appearing at 00:02.0?=C2=A0=C2=A0I'm c= urrently testing > > for any Intel VGA device, but I wonder if I should only be enabling a= nything > > opregion if it also appears at a specific address. > >=C2=A0 >=C2=A0 > No.=C2=A0=C2=A0Both Windows and Linux IGD driver should work at any PCI= slot.=C2=A0=C2=A0We have seen 0:5.0 in the guest and the driver works. Thanks Allen.=C2=A0=C2=A0Another question, when I boot a VM with an assig= ned HD P4000 GPU, my console stream with IOMMU faults, like: DMAR: DMAR:[DMA Write] Request device [00:02.0] fault addr 9fa30000=C2=A0 DMAR: DMAR:[DMA Write] Request device [00:02.0] fault addr 9fa30000=C2=A0 DMAR: DMAR:[DMA Write] Request device [00:02.0] fault addr 9fa30000=C2=A0 DMAR: DMAR:[DMA Write] Request device [00:02.0] fault addr 9fa30000=C2=A0 DMAR: DMAR:[DMA Write] Request device [00:02.0] fault addr 9fa30000=C2=A0 All of these fall within the host RMRR range for the device: DMAR: Setting RMRR: DMAR: Setting identity map for device 0000:00:02.0 [0x9f800000 - 0xaf9fff= ff] A while back, we excluded devices using RMRRs from participating in IOMMU API domains because they may continue to DMA to these reserved regions after assignment, possibly corrupting VM memory (c875d2c1b808).=C2=A0=C2=A0Intel later decided this exclusion shouldn't a= pply to graphics devices (18436afdc11a).=C2=A0=C2=A0Don't the above IOMMU faults = reveal that exactly the problem we're trying to prevent by general exclusion of RMRR encumbered devices from the IOMMU API is actually occuring?=C2=A0=C2= =A0If I were to have VM memory within the RMRR address range, I wouldn't be seeing these faults, I'd be having the GPU corrupt my VM memory. David notes in the latter commit above: "We should be able to successfully assign graphics devices to guests too, as long as the initial handling of stolen memory is reconfigured appropriately." What code is supposed to be doing that reconfiguration when a device is assigned?=C2=A0=C2=A0Clearly we don't have it yet, making assignment of t= hese devices very unsafe.=C2=A0=C2=A0It seems like vfio or IOMMU code in the = kernel needs device specific code to clear these settings to make it safe for userspace, then perhaps VM BIOS support to reallocate.=C2=A0=C2=A0Is ther= e any consistency across IGD revisions for doing this? Is there a spec? Thanks, Alex