From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60271) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZEfKo-00025c-Qo for qemu-devel@nongnu.org; Mon, 13 Jul 2015 11:08:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZEfKj-0002CA-5G for qemu-devel@nongnu.org; Mon, 13 Jul 2015 11:07:58 -0400 Received: from e23smtp02.au.ibm.com ([202.81.31.144]:45802) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZEfKi-00029c-HP for qemu-devel@nongnu.org; Mon, 13 Jul 2015 11:07:53 -0400 Received: from /spool/local by e23smtp02.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 14 Jul 2015 00:57:29 +1000 From: Alexey Kardashevskiy Date: Tue, 14 Jul 2015 00:56:18 +1000 Message-Id: <1436799381-16150-3-git-send-email-aik@ozlabs.ru> In-Reply-To: <1436799381-16150-1-git-send-email-aik@ozlabs.ru> References: <1436799381-16150-1-git-send-email-aik@ozlabs.ru> Subject: [Qemu-devel] [RFC PATCH qemu v2 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, Michael Roth , 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