From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38702) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bk5WK-0001iW-3y for qemu-devel@nongnu.org; Wed, 14 Sep 2016 04:26:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bk5WG-0004Ud-37 for qemu-devel@nongnu.org; Wed, 14 Sep 2016 04:26:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47068) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bk5WF-0004US-T1 for qemu-devel@nongnu.org; Wed, 14 Sep 2016 04:26:12 -0400 From: Peter Xu Date: Wed, 14 Sep 2016 16:25:48 +0800 Message-Id: <1473841548-26742-4-git-send-email-peterx@redhat.com> In-Reply-To: <1473841548-26742-1-git-send-email-peterx@redhat.com> References: <1473841548-26742-1-git-send-email-peterx@redhat.com> Subject: [Qemu-devel] [PATCH v5 3/3] intel_iommu: allow UNMAP notifiers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: dgibson@redhat.com, jasowang@redhat.com, mst@redhat.com, pbonzini@redhat.com, cornelia.huck@de.ibm.com, wexu@redhat.com, vkaplans@redhat.com, alex.williamson@redhat.com, peterx@redhat.com 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 = { -- 2.7.4