From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58580) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YISM9-0001JZ-8f for qemu-devel@nongnu.org; Mon, 02 Feb 2015 20:32:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YISM5-0000Hw-7p for qemu-devel@nongnu.org; Mon, 02 Feb 2015 20:32:45 -0500 Received: from mail-pa0-f49.google.com ([209.85.220.49]:62653) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YISM5-0000Hj-2U for qemu-devel@nongnu.org; Mon, 02 Feb 2015 20:32:41 -0500 Received: by mail-pa0-f49.google.com with SMTP id fa1so89525293pad.8 for ; Mon, 02 Feb 2015 17:32:39 -0800 (PST) Message-ID: <54D0252F.5040104@ozlabs.ru> Date: Tue, 03 Feb 2015 12:32:31 +1100 From: Alexey Kardashevskiy MIME-Version: 1.0 References: <1422523650-2888-1-git-send-email-aik@ozlabs.ru> <1422523650-2888-8-git-send-email-aik@ozlabs.ru> <20150202063723.GM28703@voom.fritz.box> In-Reply-To: <20150202063723.GM28703@voom.fritz.box> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4 07/18] spapr_iommu: Implement free_table() helper List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson Cc: Alex Williamson , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Alexander Graf -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 02/02/2015 05:37 PM, David Gibson wrote: > On Thu, Jan 29, 2015 at 08:27:19PM +1100, 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. >> >> 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. >> >> 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. >> >> Signed-off-by: Alexey Kardashevskiy > > Reviewed-by: David Gibson > > With the caveat that I don't know the QOM refcounting model well > enough to really analyze if this is correct. It's not obviously > wrong, and doesn't look like it will break anything in the actual > PAPR related code. I am redoing this part to always keep sPAPRTCETable and not free them on every reboot so you can ignore this type of problems now. Thanks! - -- Alexey -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJU0CUvAAoJEIYTPdgrwSC5mpcP+wa3vulve++JX06UWbTsaarV nXQhWsKHAFQZmQYzRzyUwl00JEIp14NZ9dzBXEaAIutQmiFDeNA7a3QCHpnkt2Ei JJzzzK5ygjcX9H2RP+hzaoJkHxdFKMQ9TREKe86IsHYw34rREzfS/Li6PkTm+LSo 3jnnd1k0GGB9AX/hwvDHHcdQRpio2sI0lG7WH3R8FDbHAHo/YW3JvrPL3iTDpNDA HYR9Hy4JynzQIGJhzYFkmODEjUbLtn/c/xIYVZJDNdDdLETF1sK+iTpbinxtPe5n JsKGncsFmZGKotJ3ZAjPxogdYhqtvq5/VsUpc2jHlC4QKgEsVLqUm5cfu+hl5a00 w/4W9tB+lqbFFvTxNAOokYPnWaD+NJZ3DY03vsCKRk16/MrMjdfMpsj/m3ai6pAx Pc/A2JfZ30SjqbFBLQJZKBDKQ9JARp7F/S60s7iW2D4ELRChdprcb/cE/gVGoWFV DYKpPRtdzjNNtjMLNd6OuWVu3LItcfz42VQwxrwjyZOIIgpdpOM1hBBXqMjhOykW gFtlf/zEDAxQ9cl0RrjH9gC1UwnP7w+slvspa5MNghnFKByHBOwUW9bNpDc2xcp2 9I6j1yjxI81Si96uGFj8Ba2LzBGaTzVIbiSsnV2cvZKirNAN/Gnm9lcgwOOMKA09 QAx4oiji73rE6GzBZxFx =o1mo -----END PGP SIGNATURE-----