From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39982) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhBAP-00055B-3P for qemu-devel@nongnu.org; Tue, 06 Sep 2016 03:51:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bhBAL-0002v1-VZ for qemu-devel@nongnu.org; Tue, 06 Sep 2016 03:51:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51530) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhBAL-0002uv-QN for qemu-devel@nongnu.org; Tue, 06 Sep 2016 03:51:33 -0400 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> From: Paolo Bonzini Message-ID: <92b5128b-d6e2-5787-9cea-07fcf90d22a5@redhat.com> Date: Tue, 6 Sep 2016 09:51:28 +0200 MIME-Version: 1.0 In-Reply-To: <20160906052733.GA21051@pxdev.xzpeter.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit 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: Peter Xu 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 06/09/2016 07:27, Peter Xu wrote: > Maybe I haven't explained the idea very clearly, but device-IOTLB is > not a "flush" of whole device cache. It still needs a IOMMUTLBEntry, > and works just like how general IOMMU invalidations. E.g., we can do > device-IOTLB invalidation for a single 4K page. Yes, it can be FLUSHED_ENTRY and CHANGED_ENTRY or INVALIDATE_ENTRY/CHANGE_ENTRY. > However, I agree with you that the namings are confusing, maybe at > least we should introduce IOMMU_NOTIFIER_* macros, though instead of a > _FLUSH one, we can have: > > IOMMU_NOTIFIER_NONE = -1, > IOMMU_NOTIFIER_DEVICE_INVALIDATE = 0, > IOMMU_NOTIFIER_IOTLB_CHANGED = 1, I suggest making the names more similar: - two participles (invalidated/changed) or two imperatives (invalidate!/change!); - choose whether to keep the verb first ("invalidate device") or keep the noun first ("IOTLB changed"), and stick with one convention. > To clarify that these are two non-overlapped cases. If they are not overlapping, they really should be using a bitmask or multiple callbacks in a struct... Paolo