From nobody Tue Apr 30 04:46:21 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) 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=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1512707349812130.3767767573463; Thu, 7 Dec 2017 20:29:09 -0800 (PST) Received: from localhost ([::1]:35506 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNAHI-0001f9-Ot for importer@patchew.org; Thu, 07 Dec 2017 23:28:48 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55967) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNAFi-0007sZ-OX for qemu-devel@nongnu.org; Thu, 07 Dec 2017 23:27:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eNAFh-0005T8-OL for qemu-devel@nongnu.org; Thu, 07 Dec 2017 23:27:10 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58656) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eNAFh-0005Sv-FW for qemu-devel@nongnu.org; Thu, 07 Dec 2017 23:27:09 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A64EF883C2 for ; Fri, 8 Dec 2017 04:27:08 +0000 (UTC) Received: from xz-mi.redhat.com (ovpn-12-61.pek2.redhat.com [10.72.12.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4230A5C3F9; Fri, 8 Dec 2017 04:27:04 +0000 (UTC) From: Peter Xu To: qemu-devel@nongnu.org Date: Fri, 8 Dec 2017 12:26:53 +0800 Message-Id: <20171208042654.10910-2-peterx@redhat.com> In-Reply-To: <20171208042654.10910-1-peterx@redhat.com> References: <20171208042654.10910-1-peterx@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 08 Dec 2017 04:27:08 +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 1/2] intel_iommu: remove X86_IOMMU_PCI_DEVFN_MAX 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: Jason Wang , peterx@redhat.com, "Michael S . Tsirkin" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_6 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" We have PCI_DEVFN_MAX now. Signed-off-by: Peter Xu Reviewed-by: Jason Wang Reviewed-by: Liu, Yi L --- hw/i386/intel_iommu.c | 10 +++++----- include/hw/i386/x86-iommu.h | 1 - 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index 3a5bb0bc2e..c1fa08d205 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -186,7 +186,7 @@ static void vtd_reset_context_cache(IntelIOMMUState *s) g_hash_table_iter_init(&bus_it, s->vtd_as_by_busptr); =20 while (g_hash_table_iter_next (&bus_it, NULL, (void**)&vtd_bus)) { - for (devfn_it =3D 0; devfn_it < X86_IOMMU_PCI_DEVFN_MAX; ++devfn_i= t) { + for (devfn_it =3D 0; devfn_it < PCI_DEVFN_MAX; ++devfn_it) { vtd_as =3D vtd_bus->dev_as[devfn_it]; if (!vtd_as) { continue; @@ -1002,7 +1002,7 @@ static void vtd_switch_address_space_all(IntelIOMMUSt= ate *s) =20 g_hash_table_iter_init(&iter, s->vtd_as_by_busptr); while (g_hash_table_iter_next(&iter, NULL, (void **)&vtd_bus)) { - for (i =3D 0; i < X86_IOMMU_PCI_DEVFN_MAX; i++) { + for (i =3D 0; i < PCI_DEVFN_MAX; i++) { if (!vtd_bus->dev_as[i]) { continue; } @@ -1294,7 +1294,7 @@ static void vtd_context_device_invalidate(IntelIOMMUS= tate *s, vtd_bus =3D vtd_find_as_from_bus_num(s, bus_n); if (vtd_bus) { devfn =3D VTD_SID_TO_DEVFN(source_id); - for (devfn_it =3D 0; devfn_it < X86_IOMMU_PCI_DEVFN_MAX; ++devfn_i= t) { + for (devfn_it =3D 0; devfn_it < PCI_DEVFN_MAX; ++devfn_it) { vtd_as =3D vtd_bus->dev_as[devfn_it]; if (vtd_as && ((devfn_it & mask) =3D=3D (devfn & mask))) { trace_vtd_inv_desc_cc_device(bus_n, VTD_PCI_SLOT(devfn_it), @@ -2699,7 +2699,7 @@ VTDAddressSpace *vtd_find_add_as(IntelIOMMUState *s, = PCIBus *bus, int devfn) *new_key =3D (uintptr_t)bus; /* No corresponding free() */ vtd_bus =3D g_malloc0(sizeof(VTDBus) + sizeof(VTDAddressSpace *) *= \ - X86_IOMMU_PCI_DEVFN_MAX); + PCI_DEVFN_MAX); vtd_bus->bus =3D bus; g_hash_table_insert(s->vtd_as_by_busptr, new_key, vtd_bus); } @@ -2982,7 +2982,7 @@ static AddressSpace *vtd_host_dma_iommu(PCIBus *bus, = void *opaque, int devfn) IntelIOMMUState *s =3D opaque; VTDAddressSpace *vtd_as; =20 - assert(0 <=3D devfn && devfn < X86_IOMMU_PCI_DEVFN_MAX); + assert(0 <=3D devfn && devfn < PCI_DEVFN_MAX); =20 vtd_as =3D vtd_find_add_as(s, bus, devfn); return &vtd_as->as; diff --git a/include/hw/i386/x86-iommu.h b/include/hw/i386/x86-iommu.h index ef89c0c646..7c71fc7470 100644 --- a/include/hw/i386/x86-iommu.h +++ b/include/hw/i386/x86-iommu.h @@ -31,7 +31,6 @@ #define X86_IOMMU_GET_CLASS(obj) \ OBJECT_GET_CLASS(X86IOMMUClass, obj, TYPE_X86_IOMMU_DEVICE) =20 -#define X86_IOMMU_PCI_DEVFN_MAX 256 #define X86_IOMMU_SID_INVALID (0xffff) =20 typedef struct X86IOMMUState X86IOMMUState; --=20 2.14.3 From nobody Tue Apr 30 04:46:21 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) 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=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1512707349703886.2199908201807; Thu, 7 Dec 2017 20:29:09 -0800 (PST) Received: from localhost ([::1]:35507 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNAHK-0001h3-4F for importer@patchew.org; Thu, 07 Dec 2017 23:28:50 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55978) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNAFl-00088w-HQ for qemu-devel@nongnu.org; Thu, 07 Dec 2017 23:27:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eNAFk-0005U1-PX for qemu-devel@nongnu.org; Thu, 07 Dec 2017 23:27:13 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44378) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eNAFk-0005Tr-JY for qemu-devel@nongnu.org; Thu, 07 Dec 2017 23:27:12 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C65B57970A for ; Fri, 8 Dec 2017 04:27:11 +0000 (UTC) Received: from xz-mi.redhat.com (ovpn-12-61.pek2.redhat.com [10.72.12.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3B745922F5; Fri, 8 Dec 2017 04:27:08 +0000 (UTC) From: Peter Xu To: qemu-devel@nongnu.org Date: Fri, 8 Dec 2017 12:26:54 +0800 Message-Id: <20171208042654.10910-3-peterx@redhat.com> In-Reply-To: <20171208042654.10910-1-peterx@redhat.com> References: <20171208042654.10910-1-peterx@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 08 Dec 2017 04:27:11 +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 2/2] intel_iommu: fix error param in string 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: Jason Wang , peterx@redhat.com, "Michael S . Tsirkin" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_6 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" It should be caching-mode. It may confuse people when it pops up. Signed-off-by: Peter Xu Reviewed-by: Jason Wang --- hw/i386/intel_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index c1fa08d205..fe15d3ba84 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -2327,7 +2327,7 @@ static void vtd_iommu_notify_flag_changed(IOMMUMemory= Region *iommu, IntelIOMMUNotifierNode *next_node =3D NULL; =20 if (!s->caching_mode && new & IOMMU_NOTIFIER_MAP) { - error_report("We need to set cache_mode=3D1 for intel-iommu to ena= ble " + error_report("We need to set caching-mode=3D1 for intel-iommu to e= nable " "device assignment with IOMMU protection."); exit(1); } --=20 2.14.3