-----Original Message----- From: Alexander Graf [mailto:ag...@suse.de] Sent: Friday, June 03, 2016 6:26 PM To: Mihai Claudiu Caraman <mike.cara...@nxp.com>; Peter Maydell <peter.mayd...@linaro.org> > Cc: Bogdan Purcareata <bogdan.purcare...@nxp.com>; QEMU Developers > <qemu-devel@nongnu.org>; Peter Crosthwaite <crosthwaite.pe...@gmail.com>; > qemu-arm <qemu-...@nongnu.org>; Eric Auger <eric.au...@linaro.org> > Subject: Re: [Qemu-devel] [PATCH 2/2] arm/virt: Mark pcie controller node as > dma-coherent > > On 06/03/2016 05:16 PM, Mihai Claudiu Caraman wrote: > >> -----Original Message----- > >> From: Peter Maydell [mailto:peter.mayd...@linaro.org] > >> Sent: Friday, June 03, 2016 5:38 PM > >> To: Mihai Claudiu Caraman <mike.cara...@nxp.com> > >> Cc: Bogdan Purcareata <bogdan.purcare...@nxp.com>; QEMU Developers > >> <qemu-devel@nongnu.org>; Peter Crosthwaite > >> <crosthwaite.pe...@gmail.com>; Alexander Graf <ag...@suse.de>; > >> qemu-arm <qemu-...@nongnu.org>; Eric Auger <eric.au...@linaro.org> > >> Subject: Re: [Qemu-devel] [PATCH 2/2] arm/virt: Mark pcie controller > >> node as dma-coherent > >> > >> On 3 June 2016 at 15:22, Mihai Claudiu Caraman <mike.cara...@nxp.com> > >> wrote: > >>> In particular for virtual and emulated devices the host CPU behaves > >>> as a DMA coherent 'device'. This should have been stated in patch > >>> description. > >> Wouldn't that imply that we should just always have the "dma-coherent" > >> property set, and we don't need to do any of the messing around looking at > >> the host sysfs ? > >> > >> thanks > >> -- PMM > > We can always set "dma-coherent" for virtual and emulated devices but not > > for passthrough devices. So we can't have one PCIe controller for all > > devices marked as "dma-coherent". > > The original patch is about the case where PCI is already cache coherent on > the host. > > I think at the end of the day this is simply outside of QEMU's scope to > decide. What we can do is set dma-coherent per default (if Will and Ard > agree) on the default PCIe bus and add code that allows to spawn a secondary > PCIe bus which can then have different dma-coherent attributes and that you > can then plug your non-coherent vfio devices into.
A dma-coherent default PCIe bus looks fine. Thanks, Mike