From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50780) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c16NJ-0005VD-Br for qemu-devel@nongnu.org; Mon, 31 Oct 2016 02:47:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c16NF-0008Hp-Cb for qemu-devel@nongnu.org; Mon, 31 Oct 2016 02:47:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42158) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c16NF-0008HT-73 for qemu-devel@nongnu.org; Mon, 31 Oct 2016 02:47:13 -0400 Date: Mon, 31 Oct 2016 14:47:19 +0800 From: Peter Xu Message-ID: <20161031064719.GB30738@pxdev.xzpeter.org> References: <1476719064-9242-1-git-send-email-bd.aviv@gmail.com> <20161017100736.68a56fd9@t450s.home> <20161020140608.0f373ea9@t450s.home> <20161021005005.GV11140@umbus.fritz.box> <20161021051708.GP15168@pxdev.xzpeter.org> <20161021084305.6f261879@t450s.home> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20161021084305.6f261879@t450s.home> Subject: Re: [Qemu-devel] [PATCH v4 RESEND 0/3] IOMMU: intel_iommu support map and unmap notifications List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Williamson Cc: David Gibson , "Aviv B.D." , qemu-devel@nongnu.org, "Michael S. Tsirkin" , Jan Kiszka On Fri, Oct 21, 2016 at 08:43:05AM -0600, Alex Williamson wrote: [...] > > > Well, I think that would work. But I think it would be better to fix > > > it from the other side: > > > > > > We add the range to be notified into the IOMMUNotifier structure and > > > filter based on that range in memory_region_notify_iommu. > > > > > > It means a little more list searching and filtering on notify, but it > > > avoids having to have another list and search on the VFIO side. I > > > think it will also better deal with cases where part of an IOMMU > > > mapped region is inaccessible due to an intermediate bridge. > > > > IIUC, this will still need to keep several VFIOGuestIOMMUs which > > contains exactly the same content? > > The contain different offsets since this is based on the section rather > than the MemoryRegion. Thanks, Though vfio_listener_region_add() is per memory region section, VFIOGuestIOMMU looks like to be for memory region? See in vfio_listener_region_add(): giommu->iommu_offset = section->offset_within_address_space - section->offset_within_region; Here VFIOGuestIOMMU.iommu_offset should be the offset of memory region (rather than memory region section offset), right? Thanks, -- peterx