Received: from eggs.gnu.org ([2001:4830:134:3::10]:55986) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bfhll-0000xn-VB for qemu-devel@nongnu.org; Fri, 02 Sep 2016 02:16:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bfhli-00085O-II for qemu-devel@nongnu.org; Fri, 02 Sep 2016 02:16:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46530) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bfhli-00085D-Cv for qemu-devel@nongnu.org; Fri, 02 Sep 2016 02:16:02 -0400 Date: Fri, 2 Sep 2016 14:15:57 +0800 From: Peter Xu Message-ID: <20160902061557.GB18496@pxdev.xzpeter.org> References: <1472526419-5900-1-git-send-email-jasowang@redhat.com> <1472526419-5900-11-git-send-email-jasowang@redhat.com> <20160829213702.536df0df@t450s.home> <76fb2f05-4f9c-3e91-d301-3e0a6d4cabaf@redhat.com> <20160901022929.GA3558@pxdev.xzpeter.org> <20160831204342.77fbe728@t450s.home> <20160901035848.GC3558@pxdev.xzpeter.org> <20160902141504.05950823@voom.fritz.box> <20160902053733.GB10595@pxdev.xzpeter.org> <20160902161014.7e53530b@voom.fritz.box> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160902161014.7e53530b@voom.fritz.box> Subject: Re: [Qemu-devel] [PATCH for 2.8 10/11] Revert "intel_iommu: Throw hw_error on notify_started" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson Cc: Alex Williamson , Jason Wang , mst@redhat.com, qemu-devel@nongnu.org, pbonzini@redhat.com, cornelia.huck@de.ibm.com, wexu@redhat.com, vkaplans@redhat.com On Fri, Sep 02, 2016 at 04:10:14PM +1000, David Gibson wrote: > On Fri, 2 Sep 2016 13:37:33 +0800 > Peter Xu wrote: > > > On Fri, Sep 02, 2016 at 02:15:04PM +1000, David Gibson wrote: > > > What!? I see no reason you need a different notifier, just fix the > > > implementation of the current one. As a bonus this will also give you > > > working VFIO passthrough with vIOMMU on x86, something which should > > > work already, but doesn't. > > > > Hi, David, > > > > Do you mean that we can enhance the interface to suite the two needs? > > E.g., adding a "IOTLB notification type" definition: > > > > - "full": for those who is listening on all mapping changes including > > additions (VFIO use case) > > > > - "cache_only": for those who only cares about cache invalidations > > (device IOTLB, aka, vhost use case) > > > > We can: > > > > - add notify type when we register the notifiers (e.g., when VFIO > > registers IOMMU notifier, it should specify the type as "full", so > > it won't receive notification if it's device IOTLB invalidations). > > > > - pass this type when trigger the notification, so for each IOMMU > > notify handler, it can selectively disgard the notification. > > > > Not sure whether above makes sense. > > No, implement the full notifier, and a listener which only wants the > invalidates can just ignore callbacks which add new mappings. > > As I said, you'll need this to get VFIO working with vIOMMU which > someone is bound to want soon enough anyway. But for vhost cases, we do not need CM bit enabled. That might be the difference? I think we need to have vhost working even without CM bit. Device IOTLB should be able to achieve that. -- peterx