From nobody Fri Oct 24 13:10:44 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.zohomail.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 1519901602602481.4545266033774; Thu, 1 Mar 2018 02:53:22 -0800 (PST) Received: from localhost ([::1]:55518 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1erLpx-0007TO-Go for importer@patchew.org; Thu, 01 Mar 2018 05:53:21 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52667) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1erLlh-00048Y-Me for qemu-devel@nongnu.org; Thu, 01 Mar 2018 05:48:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1erLlf-0007gp-3o for qemu-devel@nongnu.org; Thu, 01 Mar 2018 05:48:57 -0500 Received: from mga14.intel.com ([192.55.52.115]:7314) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1erLle-0007fT-Qy for qemu-devel@nongnu.org; Thu, 01 Mar 2018 05:48:55 -0500 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Mar 2018 02:48:53 -0800 Received: from sky-dev.bj.intel.com ([10.238.144.105]) by orsmga003.jf.intel.com with ESMTP; 01 Mar 2018 02:48:52 -0800 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,408,1515484800"; d="scan'208";a="31611609" From: "Liu, Yi L" To: qemu-devel@nongnu.org, mst@redhat.com, david@gibson.dropbear.id.au Date: Thu, 1 Mar 2018 18:31:52 +0800 Message-Id: <1519900322-30263-3-git-send-email-yi.l.liu@linux.intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1519900322-30263-1-git-send-email-yi.l.liu@linux.intel.com> References: <1519900322-30263-1-git-send-email-yi.l.liu@linux.intel.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.55.52.115 Subject: [Qemu-devel] [PATCH v3 02/12] vfio: rename GuestIOMMU to be GuestIOMMUMR 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: pbonzini@redhat.com, alex.williamson@redhat.com, "Liu, Yi L" , eric.auger.pro@gmail.com 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 patch renames GuestIOMMU to GuestIOMMUMR as the existing GuestIOMMU is for MemoryRegion related notifiers. Signed-off-by: Liu, Yi L --- hw/vfio/common.c | 17 +++++++++-------- include/hw/vfio/vfio-common.h | 8 ++++---- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/hw/vfio/common.c b/hw/vfio/common.c index cbda506..06277d2 100644 --- a/hw/vfio/common.c +++ b/hw/vfio/common.c @@ -348,7 +348,7 @@ static bool vfio_get_vaddr(IOMMUTLBEntry *iotlb, void *= *vaddr, =20 static void vfio_iommu_map_notify(IOMMUMRNotifier *n, IOMMUTLBEntry *iotlb) { - VFIOGuestIOMMU *giommu =3D container_of(n, VFIOGuestIOMMU, n); + VFIOGuestIOMMUMR *giommu =3D container_of(n, VFIOGuestIOMMUMR, n); VFIOContainer *container =3D giommu->container; hwaddr iova =3D iotlb->iova + giommu->iommu_offset; bool read_only; @@ -504,7 +504,7 @@ static void vfio_listener_region_add(MemoryListener *li= stener, memory_region_ref(section->mr); =20 if (memory_region_is_iommu(section->mr)) { - VFIOGuestIOMMU *giommu; + VFIOGuestIOMMUMR *giommu; IOMMUMemoryRegion *iommu_mr =3D IOMMU_MEMORY_REGION(section->mr); =20 trace_vfio_listener_region_add_iommu(iova, end); @@ -526,7 +526,7 @@ static void vfio_listener_region_add(MemoryListener *li= stener, IOMMU_MR_EVENT_ALL, section->offset_within_region, int128_get64(llend)); - QLIST_INSERT_HEAD(&container->giommu_list, giommu, giommu_next); + QLIST_INSERT_HEAD(&container->giommu_mr_list, giommu, giommu_next); =20 memory_region_register_iommu_notifier(section->mr, &giommu->n); memory_region_iommu_replay(giommu->iommu, &giommu->n); @@ -593,9 +593,9 @@ static void vfio_listener_region_del(MemoryListener *li= stener, } =20 if (memory_region_is_iommu(section->mr)) { - VFIOGuestIOMMU *giommu; + VFIOGuestIOMMUMR *giommu; =20 - QLIST_FOREACH(giommu, &container->giommu_list, giommu_next) { + QLIST_FOREACH(giommu, &container->giommu_mr_list, giommu_next) { if (MEMORY_REGION(giommu->iommu) =3D=3D section->mr && giommu->n.start =3D=3D section->offset_within_region) { memory_region_unregister_iommu_notifier(section->mr, @@ -1017,7 +1017,7 @@ static int vfio_connect_container(VFIOGroup *group, A= ddressSpace *as, container =3D g_malloc0(sizeof(*container)); container->space =3D space; container->fd =3D fd; - QLIST_INIT(&container->giommu_list); + QLIST_INIT(&container->giommu_mr_list); QLIST_INIT(&container->hostwin_list); if (ioctl(fd, VFIO_CHECK_EXTENSION, VFIO_TYPE1_IOMMU) || ioctl(fd, VFIO_CHECK_EXTENSION, VFIO_TYPE1v2_IOMMU)) { @@ -1206,11 +1206,12 @@ static void vfio_disconnect_container(VFIOGroup *gr= oup) =20 if (QLIST_EMPTY(&container->group_list)) { VFIOAddressSpace *space =3D container->space; - VFIOGuestIOMMU *giommu, *tmp; + VFIOGuestIOMMUMR *giommu, *tmp; =20 QLIST_REMOVE(container, next); =20 - QLIST_FOREACH_SAFE(giommu, &container->giommu_list, giommu_next, t= mp) { + QLIST_FOREACH_SAFE(giommu, &container->giommu_mr_list, + giommu_next, tmp) { memory_region_unregister_iommu_notifier( MEMORY_REGION(giommu->iommu), &giommu->n); QLIST_REMOVE(giommu, giommu_next); diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h index 865e3e7..702a085 100644 --- a/include/hw/vfio/vfio-common.h +++ b/include/hw/vfio/vfio-common.h @@ -87,19 +87,19 @@ typedef struct VFIOContainer { * contiguous IOVA window. We may need to generalize that in * future */ - QLIST_HEAD(, VFIOGuestIOMMU) giommu_list; + QLIST_HEAD(, VFIOGuestIOMMUMR) giommu_mr_list; QLIST_HEAD(, VFIOHostDMAWindow) hostwin_list; QLIST_HEAD(, VFIOGroup) group_list; QLIST_ENTRY(VFIOContainer) next; } VFIOContainer; =20 -typedef struct VFIOGuestIOMMU { +typedef struct VFIOGuestIOMMUMR { VFIOContainer *container; IOMMUMemoryRegion *iommu; hwaddr iommu_offset; IOMMUMRNotifier n; - QLIST_ENTRY(VFIOGuestIOMMU) giommu_next; -} VFIOGuestIOMMU; + QLIST_ENTRY(VFIOGuestIOMMUMR) giommu_next; +} VFIOGuestIOMMUMR; =20 typedef struct VFIOHostDMAWindow { hwaddr min_iova; --=20 1.9.1