From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37902) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZEhDj-0002s6-2Q for qemu-devel@nongnu.org; Mon, 13 Jul 2015 13:08:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZEhDf-0003Is-OX for qemu-devel@nongnu.org; Mon, 13 Jul 2015 13:08:47 -0400 Message-ID: <1436807320.1391.354.camel@redhat.com> From: Alex Williamson Date: Mon, 13 Jul 2015 11:08:40 -0600 In-Reply-To: <1436525028-23963-3-git-send-email-aik@ozlabs.ru> References: <1436525028-23963-1-git-send-email-aik@ozlabs.ru> <1436525028-23963-3-git-send-email-aik@ozlabs.ru> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH qemu 2/5] vfio: Skip PCI BARs in memory listener List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, David Gibson On Fri, 2015-07-10 at 20:43 +1000, Alexey Kardashevskiy wrote: > In some cases PCI BARs are registered as RAM via > memory_region_init_ram_ptr() and the vfio_memory_listener will be called > on them too. However DMA will not be performed to/from these regions so > just skip them. Who says? What about peer-to-peer DMA? We have all sorts of FUD about whether the hardware handles this correctly, but mapping PCI MMIO BARs into the IOMMU allows the possibility of supporting p2p DMA between devices in the guest. Thanks, Alex > > Signed-off-by: Alexey Kardashevskiy > --- > hw/vfio/common.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/hw/vfio/common.c b/hw/vfio/common.c > index d115ec9..225cdc7 100644 > --- a/hw/vfio/common.c > +++ b/hw/vfio/common.c > @@ -248,7 +248,8 @@ static bool vfio_listener_skipped_section(MemoryRegionSection *section) > * are never accessed by the CPU and beyond the address width of > * some IOMMU hardware. TODO: VFIO should tell us the IOMMU width. > */ > - section->offset_within_address_space & (1ULL << 63); > + section->offset_within_address_space & (1ULL << 63) || > + memory_region_is_skip_dump(section->mr); > } > > static void vfio_iommu_map_notify(Notifier *n, void *data)