From nobody Tue Jul 1 10:08:50 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1491562974233407.3731014868496; Fri, 7 Apr 2017 04:02:54 -0700 (PDT) Received: from localhost ([::1]:50101 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cwRfJ-0001wV-3X for importer@patchew.org; Fri, 07 Apr 2017 07:02:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57102) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cwRdb-0000j9-8G for qemu-devel@nongnu.org; Fri, 07 Apr 2017 07:01:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cwRdY-0005dJ-D2 for qemu-devel@nongnu.org; Fri, 07 Apr 2017 07:01:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36170) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cwRdY-0005ct-85 for qemu-devel@nongnu.org; Fri, 07 Apr 2017 07:01:04 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 20CD586647; Fri, 7 Apr 2017 11:01:03 +0000 (UTC) Received: from pxdev.xzpeter.org.com (ovpn-8-43.pek2.redhat.com [10.72.8.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9FA35179FC; Fri, 7 Apr 2017 11:00:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 20CD586647 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=peterx@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 20CD586647 From: Peter Xu To: qemu-devel@nongnu.org Date: Fri, 7 Apr 2017 18:59:09 +0800 Message-Id: <1491562755-23867-4-git-send-email-peterx@redhat.com> In-Reply-To: <1491562755-23867-1-git-send-email-peterx@redhat.com> References: <1491562755-23867-1-git-send-email-peterx@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 07 Apr 2017 11:01:03 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v9 3/9] memory: provide iommu_replay_all() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: tianyu.lan@intel.com, kevin.tian@intel.com, mst@redhat.com, jan.kiszka@siemens.com, jasowang@redhat.com, peterx@redhat.com, alex.williamson@redhat.com, Marcel Apfelbaum , bd.aviv@gmail.com, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This is an "global" version of existing memory_region_iommu_replay() - we announce the translations to all the registered notifiers, instead of a specific one. Reviewed-by: David Gibson Reviewed-by: \"Michael S. Tsirkin\" Signed-off-by: Peter Xu --- include/exec/memory.h | 8 ++++++++ memory.c | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/include/exec/memory.h b/include/exec/memory.h index 07e43da..fb7dff3 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -713,6 +713,14 @@ void memory_region_iommu_replay(MemoryRegion *mr, IOMM= UNotifier *n, bool is_write); =20 /** + * memory_region_iommu_replay_all: replay existing IOMMU translations + * to all the notifiers registered. + * + * @mr: the memory region to observe + */ +void memory_region_iommu_replay_all(MemoryRegion *mr); + +/** * memory_region_unregister_iommu_notifier: unregister a notifier for * changes to IOMMU translation entries. * diff --git a/memory.c b/memory.c index 7496b3d..b4ed67b 100644 --- a/memory.c +++ b/memory.c @@ -1642,6 +1642,15 @@ void memory_region_iommu_replay(MemoryRegion *mr, IO= MMUNotifier *n, } } =20 +void memory_region_iommu_replay_all(MemoryRegion *mr) +{ + IOMMUNotifier *notifier; + + IOMMU_NOTIFIER_FOREACH(notifier, mr) { + memory_region_iommu_replay(mr, notifier, false); + } +} + void memory_region_unregister_iommu_notifier(MemoryRegion *mr, IOMMUNotifier *n) { --=20 2.7.4