From patchwork Fri Jul 10 10:43:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kardashevskiy X-Patchwork-Id: 493732 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A67611401AB for ; Fri, 10 Jul 2015 20:48:43 +1000 (AEST) Received: from localhost ([::1]:44038 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDVrF-0005Yv-Nh for incoming@patchwork.ozlabs.org; Fri, 10 Jul 2015 06:48:41 -0400 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 Received: from d23dlp03.au.ibm.com (202.81.31.214) by e23smtp06.au.ibm.com (202.81.31.212) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 10 Jul 2015 20:44:55 +1000 X-Helo: d23dlp03.au.ibm.com X-MailFrom: aik@ozlabs.ru X-RcptTo: qemu-ppc@nongnu.org Received: from d23relay07.au.ibm.com (d23relay07.au.ibm.com [9.190.26.37]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id E3F8B357804C; Fri, 10 Jul 2015 20:44:54 +1000 (EST) Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay07.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t6AAigMk62062704; Fri, 10 Jul 2015 20:44:55 +1000 Received: from d23av01.au.ibm.com (localhost [127.0.0.1]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t6AAiGMm019986; Fri, 10 Jul 2015 20:44:16 +1000 Received: from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.192.253.14]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t6AAiGpK019660; Fri, 10 Jul 2015 20:44:16 +1000 Received: from bran.ozlabs.ibm.com (unknown [9.192.254.114]) by ozlabs.au.ibm.com (Postfix) with ESMTP id 9A799A023F; Fri, 10 Jul 2015 20:43:52 +1000 (AEST) Received: from ka1.ozlabs.ibm.com (ka1.ozlabs.ibm.com [10.61.145.11]) by bran.ozlabs.ibm.com (Postfix) with ESMTP id 91F8FE38E6; Fri, 10 Jul 2015 20:43:52 +1000 (AEST) From: Alexey Kardashevskiy To: qemu-devel@nongnu.org Date: Fri, 10 Jul 2015 20:43:45 +1000 Message-Id: <1436525028-23963-3-git-send-email-aik@ozlabs.ru> X-Mailer: git-send-email 2.4.0.rc3.8.gfb3e7d5 In-Reply-To: <1436525028-23963-1-git-send-email-aik@ozlabs.ru> References: <1436525028-23963-1-git-send-email-aik@ozlabs.ru> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15071010-0021-0000-0000-0000017F795F X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 202.81.31.148 Cc: Alexey Kardashevskiy , Alex Williamson , qemu-ppc@nongnu.org, David Gibson Subject: [Qemu-devel] [PATCH qemu 2/5] vfio: Skip PCI BARs in memory listener X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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)