From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46451) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhDfV-0004PR-Q5 for qemu-devel@nongnu.org; Tue, 06 Sep 2016 06:31:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bhDfP-0003rg-Q4 for qemu-devel@nongnu.org; Tue, 06 Sep 2016 06:31:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49514) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhDfP-0003rc-LC for qemu-devel@nongnu.org; Tue, 06 Sep 2016 06:31:47 -0400 Date: Tue, 6 Sep 2016 18:31:42 +0800 From: Peter Xu Message-ID: <20160906103142.GG21051@pxdev.xzpeter.org> References: <1473060081-17835-1-git-send-email-peterx@redhat.com> <1473060081-17835-3-git-send-email-peterx@redhat.com> <2112298c-fe2a-c74f-7a68-a92625cd3533@redhat.com> <20160905083804.GB7761@pxdev.xzpeter.org> <20160906052733.GA21051@pxdev.xzpeter.org> <92b5128b-d6e2-5787-9cea-07fcf90d22a5@redhat.com> <20160906081737.GE21051@pxdev.xzpeter.org> <8a6c53f9-e3c4-f788-e794-30f28c184418@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <8a6c53f9-e3c4-f788-e794-30f28c184418@redhat.com> Subject: Re: [Qemu-devel] [PATCH 2/3] memory: add iommu_notify_flag List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org, mst@redhat.com, jasowang@redhat.com, vkaplans@redhat.com, alex.williamson@redhat.com, wexu@redhat.com, cornelia.huck@de.ibm.com, dgibson@redhat.com On Tue, Sep 06, 2016 at 10:19:14AM +0200, Paolo Bonzini wrote: > > > On 06/09/2016 10:17, Peter Xu wrote: > > After knowing the possibility that the two consumers might be > > mixturely used in the future (as David has mentioned), I'd vote for a > > bitmask for notification type: > > > > IOMMU_NOTIFIER_NONE = 0, > > IOMMU_NOTIFIER_INVALIDATION = 1, > > IOMMU_NOTIFIER_ADDITION = 2, > > ADDITION really should be "CHANGE" I think, so what about > IOMMU_NOTIFIER_INVALIDATE and IOMMU_NOTIFIER_CHANGE? For "CHANGE", it sounds like a unmap() + a map(). However I'd say "ADDITION" is nowhere better... Will use "CHANGE". > > For VFIO, would the "invalidate" and "add" callbacks use the same code > or different? Currently vfio_iommu_map_notify() should be handling both. Thanks, -- peterx