From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48717) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDVnu-0001FQ-QJ for qemu-devel@nongnu.org; Fri, 10 Jul 2015 06:45:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZDVnq-0006Qd-GP for qemu-devel@nongnu.org; Fri, 10 Jul 2015 06:45:14 -0400 Received: from e23smtp06.au.ibm.com ([202.81.31.148]:50435) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDVnp-0006Pv-TS for qemu-devel@nongnu.org; Fri, 10 Jul 2015 06:45:10 -0400 Received: from /spool/local by e23smtp06.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 10 Jul 2015 20:44:57 +1000 From: Alexey Kardashevskiy Date: Fri, 10 Jul 2015 20:43:45 +1000 Message-Id: <1436525028-23963-3-git-send-email-aik@ozlabs.ru> In-Reply-To: <1436525028-23963-1-git-send-email-aik@ozlabs.ru> References: <1436525028-23963-1-git-send-email-aik@ozlabs.ru> Subject: [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: qemu-devel@nongnu.org Cc: Alexey Kardashevskiy , Alex Williamson , qemu-ppc@nongnu.org, David Gibson 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. 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) -- 2.4.0.rc3.8.gfb3e7d5