From patchwork Fri Sep 23 05:02:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 9347405 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 38FDE6077A for ; Fri, 23 Sep 2016 05:08:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1608B2A765 for ; Fri, 23 Sep 2016 05:08:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E75BF2A9C6; Fri, 23 Sep 2016 05:08:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 88CC32A765 for ; Fri, 23 Sep 2016 05:08:04 +0000 (UTC) Received: from localhost ([::1]:40041 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bnIiR-0007wG-NA for patchwork-qemu-devel@patchwork.kernel.org; Fri, 23 Sep 2016 01:08:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36551) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bnIdK-0003Wx-2a for qemu-devel@nongnu.org; Fri, 23 Sep 2016 01:02:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bnIdJ-00057I-8B for qemu-devel@nongnu.org; Fri, 23 Sep 2016 01:02:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58022) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bnIdJ-00057B-2v for qemu-devel@nongnu.org; Fri, 23 Sep 2016 01:02:45 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 843407EAB9; Fri, 23 Sep 2016 05:02:44 +0000 (UTC) Received: from pxdev.xzpeter.org.com (dhcp-15-192.nay.redhat.com [10.66.15.192]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u8N52V1I028308; Fri, 23 Sep 2016 01:02:41 -0400 From: Peter Xu To: qemu-devel@nongnu.org Date: Fri, 23 Sep 2016 13:02:28 +0800 Message-Id: <1474606948-14391-4-git-send-email-peterx@redhat.com> In-Reply-To: <1474606948-14391-1-git-send-email-peterx@redhat.com> References: <1474606948-14391-1-git-send-email-peterx@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 23 Sep 2016 05:02:44 +0000 (UTC) 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 v7 3/3] intel_iommu: allow UNMAP notifiers 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: mst@redhat.com, jasowang@redhat.com, peterx@redhat.com, vkaplans@redhat.com, alex.williamson@redhat.com, wexu@redhat.com, pbonzini@redhat.com, cornelia.huck@de.ibm.com, dgibson@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Intel vIOMMU is still lacking of a complete IOMMU notifier mechanism. Before that is achieved, let's open a door for vhost DMAR support, which only requires cache invalidations (UNMAP operations). Meanwhile, converting hw_error() to error_report() and exit(1), to make the error messages clean and obvious (so no CPU registers will be dumped). Reviewed-by: David Gibson Signed-off-by: Peter Xu --- hw/i386/intel_iommu.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index 9d49be7..e4c3681 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -1980,10 +1980,14 @@ static void vtd_iommu_notify_flag_changed(MemoryRegion *iommu, { VTDAddressSpace *vtd_as = container_of(iommu, VTDAddressSpace, iommu); - hw_error("Device at bus %s addr %02x.%d requires iommu notifier which " - "is currently not supported by intel-iommu emulation", - vtd_as->bus->qbus.name, PCI_SLOT(vtd_as->devfn), - PCI_FUNC(vtd_as->devfn)); + if (new & IOMMU_NOTIFIER_MAP) { + error_report("Device at bus %s addr %02x.%d requires iommu " + "notifier which is currently not supported by " + "intel-iommu emulation", + vtd_as->bus->qbus.name, PCI_SLOT(vtd_as->devfn), + PCI_FUNC(vtd_as->devfn)); + exit(1); + } } static const VMStateDescription vtd_vmstate = {