From nobody Wed Nov 12 03:41:38 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1568363912; cv=none; d=zoho.com; s=zohoarc; b=Y2CZz7eyvYaFxjijlRqSWKJj4UdImABciAHItLCcwUjRpNq5Y5+lydi4AqXaDPdjYOFKlwFXhN548TLqJS4ags83klPDiaF0Wkbj4LAaf0BFZnWj+ziZ8bpEYRckJ419AEHVzFfV0wubGN522E1/eewHIyDPwZvOwOd6KUStyd8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568363912; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=lx3p17+6QK/E3juKa5vIr8sCBz0nltT6if4RMCVjrlg=; b=F0+HO6W3zY8w83yVnnFvUAOD02hlE1OnJ7wE1xhZlsP381rbaZXtfYzxJSsb7C6nPPFz3Pnq32N5f2QFfbmxUJv2UTfzA/o/+o78818+MrOf+wVJuPzs7GnzS+MkoM+UvmxSI8GPwbIEn3W4si5wgs7Bk0KNsXL+1W0BAEAdYAg= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1568363912363754.3051044596313; Fri, 13 Sep 2019 01:38:32 -0700 (PDT) Received: from localhost ([::1]:41332 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i8h63-0006wU-5u for importer@patchew.org; Fri, 13 Sep 2019 04:38:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46284) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i8h4K-0005GI-Lq for qemu-devel@nongnu.org; Fri, 13 Sep 2019 04:36:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i8h4J-0007wD-3r for qemu-devel@nongnu.org; Fri, 13 Sep 2019 04:36:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36274) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i8h4F-0007tN-N3; Fri, 13 Sep 2019 04:36:35 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0387A307CDFC; Fri, 13 Sep 2019 08:36:35 +0000 (UTC) Received: from laptop.redhat.com (ovpn-116-33.ams2.redhat.com [10.36.116.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9A5B760E3E; Fri, 13 Sep 2019 08:36:32 +0000 (UTC) From: Eric Auger To: eric.auger.pro@gmail.com, eric.auger@redhat.com, qemu-devel@nongnu.org, qemu-arm@nongnu.org, peter.maydell@linaro.org, pbonzini@redhat.com, alex.williamson@redhat.com, peterx@redhat.com Date: Fri, 13 Sep 2019 10:36:10 +0200 Message-Id: <20190913083615.14719-2-eric.auger@redhat.com> In-Reply-To: <20190913083615.14719-1-eric.auger@redhat.com> References: <20190913083615.14719-1-eric.auger@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Fri, 13 Sep 2019 08:36:35 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v1 1/6] memory: allow memory_region_register_iommu_notifier() to fail X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mst@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Currently, when a notifier is attempted to be registered and its flags are not supported (especially the MAP one) by the IOMMU MR, we generally abruptly exit in the IOMMU code. The failure could be handled more nicely in the caller and especially in the VFIO code. So let's allow memory_region_register_iommu_notifier() to fail as well as notify_flag_changed() callback. All sites implementing the callback are updated. This patch does not yet remove the exit(1) in the intel_iommu and amd_iommu code. Signed-off-by: Eric Auger --- hw/arm/smmuv3.c | 8 +++++--- hw/i386/amd_iommu.c | 7 ++++--- hw/i386/intel_iommu.c | 7 ++++--- hw/ppc/spapr_iommu.c | 7 ++++--- include/exec/memory.h | 18 +++++++++++++----- memory.c | 28 ++++++++++++++++++---------- 6 files changed, 48 insertions(+), 27 deletions(-) diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c index db051dcac8..d7a86fc505 100644 --- a/hw/arm/smmuv3.c +++ b/hw/arm/smmuv3.c @@ -1469,9 +1469,9 @@ static void smmuv3_class_init(ObjectClass *klass, voi= d *data) dc->realize =3D smmu_realize; } =20 -static void smmuv3_notify_flag_changed(IOMMUMemoryRegion *iommu, - IOMMUNotifierFlag old, - IOMMUNotifierFlag new) +static int smmuv3_notify_flag_changed(IOMMUMemoryRegion *iommu, + IOMMUNotifierFlag old, + IOMMUNotifierFlag new) { SMMUDevice *sdev =3D container_of(iommu, SMMUDevice, iommu); SMMUv3State *s3 =3D sdev->smmu; @@ -1483,6 +1483,7 @@ static void smmuv3_notify_flag_changed(IOMMUMemoryReg= ion *iommu, =20 warn_report("SMMUv3 does not support notification on MAP: " "device %s will not function properly", pcidev->name); + return -EINVAL; } =20 if (old =3D=3D IOMMU_NOTIFIER_NONE) { @@ -1492,6 +1493,7 @@ static void smmuv3_notify_flag_changed(IOMMUMemoryReg= ion *iommu, trace_smmuv3_notify_flag_del(iommu->parent_obj.name); QLIST_REMOVE(sdev, next); } + return 0; } =20 static void smmuv3_iommu_memory_region_class_init(ObjectClass *klass, diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c index 08884523e2..137ba367db 100644 --- a/hw/i386/amd_iommu.c +++ b/hw/i386/amd_iommu.c @@ -1466,9 +1466,9 @@ static const MemoryRegionOps mmio_mem_ops =3D { } }; =20 -static void amdvi_iommu_notify_flag_changed(IOMMUMemoryRegion *iommu, - IOMMUNotifierFlag old, - IOMMUNotifierFlag new) +static int amdvi_iommu_notify_flag_changed(IOMMUMemoryRegion *iommu, + IOMMUNotifierFlag old, + IOMMUNotifierFlag new) { AMDVIAddressSpace *as =3D container_of(iommu, AMDVIAddressSpace, iommu= ); =20 @@ -1478,6 +1478,7 @@ static void amdvi_iommu_notify_flag_changed(IOMMUMemo= ryRegion *iommu, PCI_FUNC(as->devfn)); exit(1); } + return 0; } =20 static void amdvi_init(AMDVIState *s) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index 75ca6f9c70..7a89ea9ba1 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -2921,9 +2921,9 @@ static IOMMUTLBEntry vtd_iommu_translate(IOMMUMemoryR= egion *iommu, hwaddr addr, return iotlb; } =20 -static void vtd_iommu_notify_flag_changed(IOMMUMemoryRegion *iommu, - IOMMUNotifierFlag old, - IOMMUNotifierFlag new) +static int vtd_iommu_notify_flag_changed(IOMMUMemoryRegion *iommu, + IOMMUNotifierFlag old, + IOMMUNotifierFlag new) { VTDAddressSpace *vtd_as =3D container_of(iommu, VTDAddressSpace, iommu= ); IntelIOMMUState *s =3D vtd_as->iommu_state; @@ -2942,6 +2942,7 @@ static void vtd_iommu_notify_flag_changed(IOMMUMemory= Region *iommu, } else if (new =3D=3D IOMMU_NOTIFIER_NONE) { QLIST_REMOVE(vtd_as, next); } + return 0; } =20 static int vtd_post_load(void *opaque, int version_id) diff --git a/hw/ppc/spapr_iommu.c b/hw/ppc/spapr_iommu.c index e87b3d50f7..8d3b38f90b 100644 --- a/hw/ppc/spapr_iommu.c +++ b/hw/ppc/spapr_iommu.c @@ -205,9 +205,9 @@ static int spapr_tce_get_attr(IOMMUMemoryRegion *iommu, return -EINVAL; } =20 -static void spapr_tce_notify_flag_changed(IOMMUMemoryRegion *iommu, - IOMMUNotifierFlag old, - IOMMUNotifierFlag new) +static int spapr_tce_notify_flag_changed(IOMMUMemoryRegion *iommu, + IOMMUNotifierFlag old, + IOMMUNotifierFlag new) { struct SpaprTceTable *tbl =3D container_of(iommu, SpaprTceTable, iommu= ); =20 @@ -216,6 +216,7 @@ static void spapr_tce_notify_flag_changed(IOMMUMemoryRe= gion *iommu, } else if (old !=3D IOMMU_NOTIFIER_NONE && new =3D=3D IOMMU_NOTIFIER_N= ONE) { spapr_tce_set_need_vfio(tbl, false); } + return 0; } =20 static int spapr_tce_table_post_load(void *opaque, int version_id) diff --git a/include/exec/memory.h b/include/exec/memory.h index 2dd810259d..504c19ecd9 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -288,10 +288,14 @@ typedef struct IOMMUMemoryRegionClass { * @iommu: the IOMMUMemoryRegion * @old_flags: events which previously needed to be notified * @new_flags: events which now need to be notified + * + * Returns 0 on success, or a negative errno; in particular + * returns -EINVAL if the new flag bitmap is not supported by the + * IOMMU memory region. */ - void (*notify_flag_changed)(IOMMUMemoryRegion *iommu, - IOMMUNotifierFlag old_flags, - IOMMUNotifierFlag new_flags); + int (*notify_flag_changed)(IOMMUMemoryRegion *iommu, + IOMMUNotifierFlag old_flags, + IOMMUNotifierFlag new_flags); /* Called to handle memory_region_iommu_replay(). * * The default implementation of memory_region_iommu_replay() is to @@ -1067,13 +1071,17 @@ void memory_region_notify_one(IOMMUNotifier *notifi= er, * memory_region_register_iommu_notifier: register a notifier for changes = to * IOMMU translation entries. * + * Returns 0 on success, or a negative errno otherwise. In particular, + * -EINVAL indicates that at least one of the attributes of the notifier + * is not supported (flag/range) by the IOMMU memory region. + * * @mr: the memory region to observe * @n: the IOMMUNotifier to be added; the notify callback receives a * pointer to an #IOMMUTLBEntry as the opaque value; the pointer * ceases to be valid on exit from the notifier. */ -void memory_region_register_iommu_notifier(MemoryRegion *mr, - IOMMUNotifier *n); +int memory_region_register_iommu_notifier(MemoryRegion *mr, + IOMMUNotifier *n); =20 /** * memory_region_iommu_replay: replay existing IOMMU translations to diff --git a/memory.c b/memory.c index 61a254c3f9..699a3d61a6 100644 --- a/memory.c +++ b/memory.c @@ -1837,33 +1837,37 @@ bool memory_region_is_logging(MemoryRegion *mr, uin= t8_t client) return memory_region_get_dirty_log_mask(mr) & (1 << client); } =20 -static void memory_region_update_iommu_notify_flags(IOMMUMemoryRegion *iom= mu_mr) +static int memory_region_update_iommu_notify_flags(IOMMUMemoryRegion *iomm= u_mr) { IOMMUNotifierFlag flags =3D IOMMU_NOTIFIER_NONE; IOMMUNotifier *iommu_notifier; IOMMUMemoryRegionClass *imrc =3D IOMMU_MEMORY_REGION_GET_CLASS(iommu_m= r); + int ret =3D 0; =20 IOMMU_NOTIFIER_FOREACH(iommu_notifier, iommu_mr) { flags |=3D iommu_notifier->notifier_flags; } =20 if (flags !=3D iommu_mr->iommu_notify_flags && imrc->notify_flag_chang= ed) { - imrc->notify_flag_changed(iommu_mr, - iommu_mr->iommu_notify_flags, - flags); + ret =3D imrc->notify_flag_changed(iommu_mr, + iommu_mr->iommu_notify_flags, + flags); } =20 - iommu_mr->iommu_notify_flags =3D flags; + if (!ret) { + iommu_mr->iommu_notify_flags =3D flags; + } + return ret; } =20 -void memory_region_register_iommu_notifier(MemoryRegion *mr, - IOMMUNotifier *n) +int memory_region_register_iommu_notifier(MemoryRegion *mr, + IOMMUNotifier *n) { IOMMUMemoryRegion *iommu_mr; + int ret; =20 if (mr->alias) { - memory_region_register_iommu_notifier(mr->alias, n); - return; + return memory_region_register_iommu_notifier(mr->alias, n); } =20 /* We need to register for at least one bitfield */ @@ -1874,7 +1878,11 @@ void memory_region_register_iommu_notifier(MemoryReg= ion *mr, n->iommu_idx < memory_region_iommu_num_indexes(iommu_mr)); =20 QLIST_INSERT_HEAD(&iommu_mr->iommu_notify, n, node); - memory_region_update_iommu_notify_flags(iommu_mr); + ret =3D memory_region_update_iommu_notify_flags(iommu_mr); + if (ret) { + QLIST_REMOVE(n, node); + } + return ret; } =20 uint64_t memory_region_iommu_get_min_page_size(IOMMUMemoryRegion *iommu_mr) --=20 2.20.1 From nobody Wed Nov 12 03:41:38 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1568364098; cv=none; d=zoho.com; s=zohoarc; b=EQFtGrcY5s4DpLJ3hro9X1BVDtuCX3IKBYigFQCdr5wr3xOInMOj6nxWKxP0f4aScC77GuxY3/jedXgU75kX6+Zz6s5DHrKq7vetgGW6nQqJe2weF2YSjjVmkpRQ6v/z78npNL3Ta7lBk0pvvtlU6qPbrz+aP4PHv0nejW+D9BE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568364098; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=17+6090PQIPDr6ZvOhE7jTG5x63df14ldFloFN3eCvQ=; b=Lf2Z16TQn8MOCWYq0JDnVim8EXFpbBwMyPEcdXb73Gc44RFwQENX6cNNadx09koM4x6oOXTKv/xb/GP08qCrvFH/PSpGChFPL6mv73VAp6XL3tvty4+SxNaaHddtMr+/NXU++pgwYZUUyYN4O7dwJ+F2ivrn6LVEOBDps4Uwk/U= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1568364098178840.9922255570979; Fri, 13 Sep 2019 01:41:38 -0700 (PDT) Received: from localhost ([::1]:41356 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i8h96-0001U2-SO for importer@patchew.org; Fri, 13 Sep 2019 04:41:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46341) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i8h4Y-0005bP-9A for qemu-devel@nongnu.org; Fri, 13 Sep 2019 04:36:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i8h4X-000897-5j for qemu-devel@nongnu.org; Fri, 13 Sep 2019 04:36:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56072) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i8h4V-00087H-2p; Fri, 13 Sep 2019 04:36:51 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6275730860BF; Fri, 13 Sep 2019 08:36:50 +0000 (UTC) Received: from laptop.redhat.com (ovpn-116-33.ams2.redhat.com [10.36.116.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5B35260F80; Fri, 13 Sep 2019 08:36:35 +0000 (UTC) From: Eric Auger To: eric.auger.pro@gmail.com, eric.auger@redhat.com, qemu-devel@nongnu.org, qemu-arm@nongnu.org, peter.maydell@linaro.org, pbonzini@redhat.com, alex.williamson@redhat.com, peterx@redhat.com Date: Fri, 13 Sep 2019 10:36:11 +0200 Message-Id: <20190913083615.14719-3-eric.auger@redhat.com> In-Reply-To: <20190913083615.14719-1-eric.auger@redhat.com> References: <20190913083615.14719-1-eric.auger@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Fri, 13 Sep 2019 08:36:50 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v1 2/6] vfio/common: Handle memory_region_register_iommu_notifier() failure X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mst@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Now memory_region_register_iommu_notifier() is allowed to fail, let's handle the returned value in vfio_listener_region_add(). This will allow to remove the error handling (exit) in the IOMMUs that implement a notify_flag_changed() that sometimes cannot accept the MAP flag. Signed-off-by: Eric Auger --- hw/vfio/common.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/vfio/common.c b/hw/vfio/common.c index 3e03c495d8..d57d72cfb9 100644 --- a/hw/vfio/common.c +++ b/hw/vfio/common.c @@ -630,9 +630,13 @@ static void vfio_listener_region_add(MemoryListener *l= istener, section->offset_within_region, int128_get64(llend), iommu_idx); - QLIST_INSERT_HEAD(&container->giommu_list, giommu, giommu_next); =20 - memory_region_register_iommu_notifier(section->mr, &giommu->n); + ret =3D memory_region_register_iommu_notifier(section->mr, &giommu= ->n); + if (ret) { + g_free(giommu); + goto fail; + } + QLIST_INSERT_HEAD(&container->giommu_list, giommu, giommu_next); memory_region_iommu_replay(giommu->iommu, &giommu->n); =20 return; --=20 2.20.1 From nobody Wed Nov 12 03:41:38 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1568364188; cv=none; d=zoho.com; s=zohoarc; b=bN58aAjqCrwE8w9sWO2Mg2zub+7sCpFx7NBrwIYm6e+hYxcJXSmyL3uRm+XmgwAjHF8MeUXlcAtTiJhVzweptcfNL6nwBowq1h7hCeuDR8FBwrvRQFVOpYxQxQvW2dNUZVbrtk+MGHWHN7lue+lMU7tMEU3uoXWol1gpPe28sYo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568364188; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=p+IbM5/QArsdPPi4D9l7FzyjVenOPxdMziJRFYUTPx0=; b=SmLQEq9JCNdWe+s6tq8B6x8UJPwTznpVQjKaWYVh8ScU53lOLS7P/gWy0+aH+KjdTR4YbiIBVeaN2le9QzdixRgaExGI0f7YNYVPLqjPGeuF3bpHwWBMHZLs014HiRQok80l+kbFM/MLT7w21XtSorxejlbamgUm4zO217yGaao= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1568364188415710.1836909426694; Fri, 13 Sep 2019 01:43:08 -0700 (PDT) Received: from localhost ([::1]:41370 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i8hAZ-0003lP-AO for importer@patchew.org; Fri, 13 Sep 2019 04:43:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46366) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i8h4a-0005eN-IF for qemu-devel@nongnu.org; Fri, 13 Sep 2019 04:36:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i8h4Z-0008AH-L7 for qemu-devel@nongnu.org; Fri, 13 Sep 2019 04:36:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59132) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i8h4X-000894-KI; Fri, 13 Sep 2019 04:36:53 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E2E71300BEA6; Fri, 13 Sep 2019 08:36:52 +0000 (UTC) Received: from laptop.redhat.com (ovpn-116-33.ams2.redhat.com [10.36.116.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id B713A60F80; Fri, 13 Sep 2019 08:36:50 +0000 (UTC) From: Eric Auger To: eric.auger.pro@gmail.com, eric.auger@redhat.com, qemu-devel@nongnu.org, qemu-arm@nongnu.org, peter.maydell@linaro.org, pbonzini@redhat.com, alex.williamson@redhat.com, peterx@redhat.com Date: Fri, 13 Sep 2019 10:36:12 +0200 Message-Id: <20190913083615.14719-4-eric.auger@redhat.com> In-Reply-To: <20190913083615.14719-1-eric.auger@redhat.com> References: <20190913083615.14719-1-eric.auger@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Fri, 13 Sep 2019 08:36:52 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v1 3/6] exec: assert on memory_region_register_iommu_notifier() failure X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mst@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" memory_region_register_iommu_notifier now returns an error in case of failure. Assert in such a case. Signed-off-by: Eric Auger --- exec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/exec.c b/exec.c index 235d6bc883..da30251a2b 100644 --- a/exec.c +++ b/exec.c @@ -692,7 +692,8 @@ static void tcg_register_iommu_notifier(CPUState *cpu, 0, HWADDR_MAX, iommu_idx); - memory_region_register_iommu_notifier(notifier->mr, ¬ifier->n); + assert(!memory_region_register_iommu_notifier(notifier->mr, + ¬ifier->n)); } =20 if (!notifier->active) { --=20 2.20.1 From nobody Wed Nov 12 03:41:38 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1568363939; cv=none; d=zoho.com; s=zohoarc; b=P9dpZ3xnjCgR/SprZn3NLnamVebCcSquz1WcF0DPnNeNkvrRIo8GGCWCG6KbISKwTYbJrTOokaDyNFmnl63PUqcxKcK/HACajo8osnu3FV8tySIR8oFSeinRyf5HWszKgwthRbdrq+zCAen3uWLfvcBZ1LJtwfsEQDGAaSeAXwA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568363939; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=MZc0sC0tZXLovBuSiumccirCyb9sz6BRuca3GWfCr3E=; b=TCk9TxsoQ2akD0Y9QHvO3rJi4JWsdSXReRqyv7XLwop2dhbut52TLHhu/EgAm5Zm4PM7J3t06hii4xwoQRRNDKpwkF1VuCz8PTfUbI5Otq8YFS6Eje27920louJioHGndHIoyRDUPuDAbVWF8YL/UBetbfmZ92t5kIeMpazrpJg= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1568363939224304.9823457018025; Fri, 13 Sep 2019 01:38:59 -0700 (PDT) Received: from localhost ([::1]:41334 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i8h6X-0007Zt-KE for importer@patchew.org; Fri, 13 Sep 2019 04:38:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46413) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i8h4f-0005kZ-Ca for qemu-devel@nongnu.org; Fri, 13 Sep 2019 04:37:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i8h4e-0008CA-D2 for qemu-devel@nongnu.org; Fri, 13 Sep 2019 04:37:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43044) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i8h4c-0008BA-AD; Fri, 13 Sep 2019 04:36:58 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A2DE410C0922; Fri, 13 Sep 2019 08:36:57 +0000 (UTC) Received: from laptop.redhat.com (ovpn-116-33.ams2.redhat.com [10.36.116.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4661D60F80; Fri, 13 Sep 2019 08:36:53 +0000 (UTC) From: Eric Auger To: eric.auger.pro@gmail.com, eric.auger@redhat.com, qemu-devel@nongnu.org, qemu-arm@nongnu.org, peter.maydell@linaro.org, pbonzini@redhat.com, alex.williamson@redhat.com, peterx@redhat.com Date: Fri, 13 Sep 2019 10:36:13 +0200 Message-Id: <20190913083615.14719-5-eric.auger@redhat.com> In-Reply-To: <20190913083615.14719-1-eric.auger@redhat.com> References: <20190913083615.14719-1-eric.auger@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.66]); Fri, 13 Sep 2019 08:36:57 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v1 4/6] vhost: assert on memory_region_register_iommu_notifier() failure X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mst@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" memory_region_register_iommu_notifier now returns an error in case of failure. Assert in such a case. Signed-off-by: Eric Auger --- hw/virtio/vhost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index 34accdf615..9b5551fc4d 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -696,7 +696,7 @@ static void vhost_iommu_region_add(MemoryListener *list= ener, iommu->iommu_offset =3D section->offset_within_address_space - section->offset_within_region; iommu->hdev =3D dev; - memory_region_register_iommu_notifier(section->mr, &iommu->n); + assert(!memory_region_register_iommu_notifier(section->mr, &iommu->n)); QLIST_INSERT_HEAD(&dev->iommu_list, iommu, iommu_next); /* TODO: can replay help performance here? */ } --=20 2.20.1 From nobody Wed Nov 12 03:41:38 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1568364258; cv=none; d=zoho.com; s=zohoarc; b=Nv4V3iuvzeRjYMAHB5zSnz8OkduOPPnduWCj8E4QDd0kBlMy8ElNYep7m4AtcanSpjb54kwpz53KcGUWedKRFioqd6uMXVB5UrMwMFnVAq8sPBUwvYLyaOpKfVxDivf293dkIoXDFTF5035Fk/i5Tg3h3KI+nyyMoeBgtTqUZ+g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568364258; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=dXuZIba3IHNaGBtDbBt2pmvhrEw6RdPsx/vKf8BwbOA=; b=bZzFjJpViVC98FNHySqGz2FnWT+TGbXTscmENd64eKeTfqm1eMclBcSKWcrKu/Bwraxo11/bvO690z4ttwxyurP5+FdUX/xip/xakUyIZDp+gZol6wqNaKOLWJFmuZZtt/kEu2+pys73br3cGtu6k3tDYNqzcYhqJibrn80uOhM= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1568364258461528.9654894532923; Fri, 13 Sep 2019 01:44:18 -0700 (PDT) Received: from localhost ([::1]:41380 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i8hBX-0004jp-QR for importer@patchew.org; Fri, 13 Sep 2019 04:44:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46467) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i8h4v-00066n-9z for qemu-devel@nongnu.org; Fri, 13 Sep 2019 04:37:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i8h4u-0008J0-Ay for qemu-devel@nongnu.org; Fri, 13 Sep 2019 04:37:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50080) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i8h4s-0008HU-3H; Fri, 13 Sep 2019 04:37:14 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6795D18CB8EA; Fri, 13 Sep 2019 08:37:13 +0000 (UTC) Received: from laptop.redhat.com (ovpn-116-33.ams2.redhat.com [10.36.116.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id 03A4C60F80; Fri, 13 Sep 2019 08:36:57 +0000 (UTC) From: Eric Auger To: eric.auger.pro@gmail.com, eric.auger@redhat.com, qemu-devel@nongnu.org, qemu-arm@nongnu.org, peter.maydell@linaro.org, pbonzini@redhat.com, alex.williamson@redhat.com, peterx@redhat.com Date: Fri, 13 Sep 2019 10:36:14 +0200 Message-Id: <20190913083615.14719-6-eric.auger@redhat.com> In-Reply-To: <20190913083615.14719-1-eric.auger@redhat.com> References: <20190913083615.14719-1-eric.auger@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.63]); Fri, 13 Sep 2019 08:37:13 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v1 5/6] intel_iommu: Let vtd_iommu_notify_flag_changed() fail X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mst@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" In case a MAP notifier is attempted to be registered without caching mode, let's simply return an error. This latter now is handled in the VFIO code. Signed-off-by: Eric Auger --- 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 7a89ea9ba1..2f66d6882c 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -2931,7 +2931,7 @@ static int vtd_iommu_notify_flag_changed(IOMMUMemoryR= egion *iommu, if (!s->caching_mode && new & IOMMU_NOTIFIER_MAP) { error_report("We need to set caching-mode=3Don for intel-iommu to = enable " "device assignment with IOMMU protection."); - exit(1); + return -EINVAL; } =20 /* Update per-address-space notifier flags */ --=20 2.20.1 From nobody Wed Nov 12 03:41:38 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1568364066; cv=none; d=zoho.com; s=zohoarc; b=iEoqzWfvzeob+e7oSyfsrywsQy46EtWb6aHdtApQdoRS3tFinvIEy3x7TWE2dtW7nsw8tCqhL+LGMUzWRqgJ+WmS4olvuBr+UiamZ82plbU+mdTf6o1u823flJHuxd4mVpg8wg/79hMM34uviWFpw19geWFTS9iiTUeHcrbmAZE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568364066; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=nCbChdrLyaLbkeV86imhEZZQMfLmIqNy8p3AMtqNx3w=; b=LpSEd4IcpMmYIzs8UeramyyCNkhF9TfFj9FmKVZodqXUCUb11Bidj7BxV3Gr1qBaypF6lNlUYli1OXA/V18malYnkFpFCWSEeN6TrpUBRjeoa4dfUuJmCds1WAzfhcsYHAqJ6S6h07A3atMTmgvlysrUKiXBaUmysAoyDvQuty4= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 15683640666524.327156458357763; Fri, 13 Sep 2019 01:41:06 -0700 (PDT) Received: from localhost ([::1]:41354 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i8h8b-00015W-Bo for importer@patchew.org; Fri, 13 Sep 2019 04:41:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46493) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i8h4x-00069u-Ot for qemu-devel@nongnu.org; Fri, 13 Sep 2019 04:37:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i8h4w-0008K2-S1 for qemu-devel@nongnu.org; Fri, 13 Sep 2019 04:37:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38432) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i8h4u-0008Iw-MK; Fri, 13 Sep 2019 04:37:16 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EB85B8342DF; Fri, 13 Sep 2019 08:37:15 +0000 (UTC) Received: from laptop.redhat.com (ovpn-116-33.ams2.redhat.com [10.36.116.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id BF0D060F80; Fri, 13 Sep 2019 08:37:13 +0000 (UTC) From: Eric Auger To: eric.auger.pro@gmail.com, eric.auger@redhat.com, qemu-devel@nongnu.org, qemu-arm@nongnu.org, peter.maydell@linaro.org, pbonzini@redhat.com, alex.williamson@redhat.com, peterx@redhat.com Date: Fri, 13 Sep 2019 10:36:15 +0200 Message-Id: <20190913083615.14719-7-eric.auger@redhat.com> In-Reply-To: <20190913083615.14719-1-eric.auger@redhat.com> References: <20190913083615.14719-1-eric.auger@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.69]); Fri, 13 Sep 2019 08:37:16 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v1 6/6] amd_iommu: Let amdvi_iommu_notify_flag_changed() fail X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mst@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" In case a MAP notifier is attempted to be registered, let's simply return an error. This latter now is handled in the VFIO code. Signed-off-by: Eric Auger --- hw/i386/amd_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c index 137ba367db..09dee48fac 100644 --- a/hw/i386/amd_iommu.c +++ b/hw/i386/amd_iommu.c @@ -1476,7 +1476,7 @@ static int amdvi_iommu_notify_flag_changed(IOMMUMemor= yRegion *iommu, error_report("device %02x.%02x.%x requires iommu notifier which is= not " "currently supported", as->bus_num, PCI_SLOT(as->devf= n), PCI_FUNC(as->devfn)); - exit(1); + return -EINVAL; } return 0; } --=20 2.20.1