From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54810) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMAUT-0005y4-SA for qemu-devel@nongnu.org; Tue, 26 Aug 2014 02:44:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMAUM-00053U-9x for qemu-devel@nongnu.org; Tue, 26 Aug 2014 02:44:25 -0400 Date: Tue, 26 Aug 2014 16:16:56 +1000 From: David Gibson Message-ID: <20140826061656.GT9923@voom.redhat.com> References: <1408097555-28126-1-git-send-email-aik@ozlabs.ru> <1408097555-28126-7-git-send-email-aik@ozlabs.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2wYUONsACSj9OMJp" Content-Disposition: inline In-Reply-To: <1408097555-28126-7-git-send-email-aik@ozlabs.ru> Subject: Re: [Qemu-devel] [RFC PATCH v2 06/13] spapr_iommu: Implement free_table() helper List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy Cc: Alex Williamson , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Gavin Shan , Alexander Graf --2wYUONsACSj9OMJp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Aug 15, 2014 at 08:12:28PM +1000, Alexey Kardashevskiy wrote: > Every sPAPRTCETable object holds an IOMMU memory region which holds > a referenced to the sPAPRTCETable instance. So if we want to free > an sPAPRTCETable instance, calling object_unref() will not be enough > as embedded memory region will hold the reference and we need to break > the loop. >=20 > This adds a spapr_tce_free_table() helper which destroys the embedded > memory region and then calls object_unref() on the sPAPRTCETable instance > which will succeed now. The helper adds a new child under unique name > derived from LIOBN. >=20 > As we are here, fix spapr_tce_new_table() callers. > At the moment spapr_tce_new_table() references sPAPRTCETable twice - > once in object_new() and second time in object_property_add_child(). > The callers of spapr_tce_new_table() should take care of correct > referencing. So I've been trying to determine if there's any way to avoid this by not constructing the reference loop in the first place, but all the qom is breaking my brain. --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --2wYUONsACSj9OMJp Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJT/CZYAAoJEGw4ysog2bOSbwUP/A9szCW+r34q1Kpk2DKVbLUy suUxGJRrY8Iou/wkK06lFiFTM+euk6ojXVMMLAvQ9gNZLVSKpA/i9UhOtpPyN03E s9D7uKX+UhL7ldcloANAYfJQLQ26/xyABu8dOnFAeU/mnxDaHzwDZINa7FpUyISE SYkbgDCez/G4lKhT95+A514hDrQVF/EvTJtRNQ48nEWAU5JmG/OxLL/GMHeLIc3A /h3UUAnMgyhkX0siW+f5LR0U2Ve9VRX2qTTAr3RM8DbK+IjcAbYUroz4AyJ67F6N LmozA/9xbzfj034ALQoTvvBwHP7EDoYieOWaeLYPYMeHghkDoWVapWZrsgapWfKR eyPXOLuye8UCcpHdSE+YcYpWM/I/fO+W51DFvTEqjAMSH8o+lpf6Un2I+D+9jrID ydCoylaI+dptwf2PtKu2rJb6McpFenYqP39g3DHHV1N1oWbDwVEM5eg4EFXwJoK9 jpnA7t3fl0wT/wdtakw5dbTD5heJORN59tIPF5sTrC06rrn5cxcOX/N6szujAzNn 9omwKNhyXUNxZKUqU21E4ikGg+zPSoe2fBLJe45A/fXBFcmd12rANtTVtxk1vM2O ZCGSPhxWvg9Z3PM7svKVmVtE8JBZVFIh4fHN/XgS/4SoEH+pQymOWvaL2s7T1LBn TvY+2lIhF9wyX+D2rSHK =gPab -----END PGP SIGNATURE----- --2wYUONsACSj9OMJp--