From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50433) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxH6X-00062l-NE for qemu-devel@nongnu.org; Tue, 26 May 2015 11:49:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YxH6S-0002Ay-Fg for qemu-devel@nongnu.org; Tue, 26 May 2015 11:49:21 -0400 Received: from mail-pd0-f177.google.com ([209.85.192.177]:33843) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxH6S-0002Ab-Ao for qemu-devel@nongnu.org; Tue, 26 May 2015 11:49:16 -0400 Received: by pdbki1 with SMTP id ki1so51996048pdb.1 for ; Tue, 26 May 2015 08:49:14 -0700 (PDT) Message-ID: <556495F4.7070808@ozlabs.ru> Date: Wed, 27 May 2015 01:49:08 +1000 From: Alexey Kardashevskiy 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> <55647D4C.6060008@redhat.com> <55648086.3010804@ozlabs.ru> <55648239.7070905@redhat.com> <55648A7F.9070100@ozlabs.ru> <55648C66.5030208@redhat.com> In-Reply-To: <55648C66.5030208@redhat.com> Content-Type: text/plain; charset=koi8-r; format=flowed 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: Paolo Bonzini , David Gibson Cc: Michael Roth , Alex Williamson , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Alexander Graf On 05/27/2015 01:08 AM, Paolo Bonzini wrote: > > > On 26/05/2015 17:00, Alexey Kardashevskiy wrote: >>>>> Why do you need different regions? Why can't you have always the same >>>>> IOMMU regions, and either: >>>> >>>> They may change a size. >>> >>> That's not a problem, there's memory_region_set_size for that. >> >> It was not there when I started doing this DDW :) If so, I can keep the >> existing structure and just set size to zero instead of >> memory_region_del_subregion(). > > del/add_subregion is okay. It's just init/unparent that is wrong. Yup, right, my bad, I do not need init/unparent and I still need del/add_subregion for setting an offset. > >> I need windows appear and disappear on a bus dynamically, that's it. The >> actual sPAPRTCETable objects exist always. > > Great. > >> Aliases will do the job as far as I can tell. > > Then you can choose between init_alias/add/del/unparent(alias) and > del/set_size/add which Michael has mentioned. The latter is probably > cleaner and faster. > >> sPAPRTCETable stores the actual table and if I want it to migrate, the >> destination QEMU must have the object created-and-vmstate_register'ated. >> But the table (and class) may be absent or present on the source side so >> I need to start the destination with or without -device sPAPRTCETable, >> and if I need to create this object, I need to make it a child of a PHB >> and last time I checked - there is no command line interface for linking >> children. > > Yup, understood now. > >> But I started thinking that always having 2 sPAPRTCETable objects (some >> may be "disabled") it not better than a single sPAPRTCETable with >> multiple TCE tables... > > Whatever works best for you. Either is okay. Yeah... multiple sPAPRTCETables and set_size() it is then. A single sPAPRTCETable has a problem that if I need to migrate multiple tables - vmstate will look ugly (especially for backward compatibility). -- Alexey