From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47417) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxFSg-0002BO-UD for qemu-devel@nongnu.org; Tue, 26 May 2015 10:04:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YxFSc-0000QJ-KX for qemu-devel@nongnu.org; Tue, 26 May 2015 10:04:06 -0400 Message-ID: <55647D4C.6060008@redhat.com> Date: Tue, 26 May 2015 16:03:56 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1429964684-23872-1-git-send-email-aik@ozlabs.ru> <1429964684-23872-7-git-send-email-aik@ozlabs.ru> <55633A54.8080807@ozlabs.ru> <20150526024628.GA30620@voom.redhat.com> <5564359A.2070009@redhat.com> <556447BB.9000802@ozlabs.ru> <55644819.3000003@redhat.com> <55646803.8040007@ozlabs.ru> <55646C18.4000303@redhat.com> <5564750C.8000100@ozlabs.ru> <556475BD.50401@redhat.com> <55647843.4040609@ozlabs.ru> <556479B6.1010501@redhat.com> <55647C75.5000704@ozlabs.ru> In-Reply-To: <55647C75.5000704@ozlabs.ru> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH qemu v7 06/14] spapr_iommu: Introduce "enabled" state for TCE table List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy , David Gibson Cc: Michael Roth , Alex Williamson , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Alexander Graf On 26/05/2015 16:00, Alexey Kardashevskiy wrote: > On 05/26/2015 11:48 PM, Paolo Bonzini wrote: >> >> >> On 26/05/2015 15:42, Alexey Kardashevskiy wrote: >>> >>> >>> The next patch of this patchset changes: >>> spapr_tce_table_do_enable() >>> memory_region_init_iommu(&iommu) >>> memory_region_add_subregion(&root, &iommu) >>> >>> spapr_tce_table_disable() >>> memory_region_del_subregion(&root, &iommu) >>> object_unref(&iommu) >>> >>> These spapr_tce_xxx are called by request from the guest. &root is a >>> container and exists as long as sPAPRTCETable exists. >>> >>> Where do I get a leaking child property here? >> >> When you unref iommu and not unparent it. The next >> memory_region_init_iommu creates a second child property, and the first >> is gone. > > But when do I get this child property? In memory_region_add_subregion()? > And memory_region_del_subregion() does not do the opposite thing > (unparent)? In memory_region_init_iommu. >> What is different between the various IOMMU regions, so that you cannot >> create just one? > > There are two DMA windows on the same PCI bus (in hardware too), at > different offset and with a different page size. Why do you need different regions? Why can't you have always the same IOMMU regions, and either: 1) create/destroy an alias to that region 2) change the behavior of the translation function, while keeping a single region? Paolo