From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36978) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8qz5-0006uo-PY for qemu-devel@nongnu.org; Fri, 03 Jun 2016 11:26:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b8qz4-0000b2-NM for qemu-devel@nongnu.org; Fri, 03 Jun 2016 11:26:03 -0400 References: <1464870382-385-1-git-send-email-bogdan.purcareata@nxp.com> <1464870382-385-3-git-send-email-bogdan.purcareata@nxp.com> From: Alexander Graf Message-ID: <5751A180.8040407@suse.de> Date: Fri, 3 Jun 2016 17:25:52 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/2] arm/virt: Mark pcie controller node as dma-coherent List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mihai Claudiu Caraman , Peter Maydell Cc: Bogdan Purcareata , QEMU Developers , Peter Crosthwaite , qemu-arm , Eric Auger On 06/03/2016 05:16 PM, Mihai Claudiu Caraman wrote: >> -----Original Message----- >> From: Peter Maydell [mailto:peter.maydell@linaro.org] >> Sent: Friday, June 03, 2016 5:38 PM >> To: Mihai Claudiu Caraman >> Cc: Bogdan Purcareata ; QEMU Developers ; Peter Crosthwaite ; Alexander Graf ; qemu-arm ; Eric Auger >> 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 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. Alex