Received: from eggs.gnu.org ([2001:4830:134:3::10]:40543) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwCwF-0006ih-4g for qemu-devel@nongnu.org; Mon, 17 Oct 2016 14:47:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bwCwE-0003hr-El for qemu-devel@nongnu.org; Mon, 17 Oct 2016 14:47:07 -0400 Date: Mon, 17 Oct 2016 16:46:57 -0200 From: Eduardo Habkost Message-ID: <20161017184657.GY3275@thinpad.lan.raisama.net> References: <1476485569-6744-1-git-send-email-lvivier@redhat.com> <1476485569-6744-2-git-send-email-lvivier@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1476485569-6744-2-git-send-email-lvivier@redhat.com> Subject: Re: [Qemu-devel] [PATCH v3 1/3] exec: split cpu_exec_init() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Vivier Cc: Igor Mammedov , Bharata B Rao , David Gibson , Peter Maydell , Paolo Bonzini , Alexander Graf , Matthew Rosato , qemu-devel@nongnu.org, Richard Henderson , qemu-arm@nongnu.org, Greg Ungerer , Guan Xuetao , Jia Liu , Markus Armbruster , Artyom Tarasenko , "Edgar E . Iglesias" , Michael Walle , Chen Gang , Aurelien Jarno , Anthony Green , qemu-ppc@nongnu.org, Bastian Koppelmann , Greg Kurz , Max Filippov On Sat, Oct 15, 2016 at 12:52:47AM +0200, Laurent Vivier wrote: > Put in cpu_exec_initfn() what initializes the CPU, > and let in cpu_exec_init() what adds it to the environment. > > As cpu_exec_initfn() is called by all XX_cpu_initfn() call it > directly in cpu_common_initfn(). > cpu_exec_init() is now a realize function, it will be renamed > to cpu_exec_realizefn() and moved to the XX_cpu_realizefn() > function in a following patch. > > Signed-off-by: Laurent Vivier Confirmed that: * cpu->num_ases and cpu->as are never changed by architecture code before calling cpu_exec_init() * cpu_exec_exit() is called on cpu_common_finalize() * The cpu->memory reference will be dropped automatically because the property is registered using OBJ_PROP_LINK_UNREF_ON_RELEASE BTW, the cpu->as and cpu->num_ases lines are redundant, because QOM objects are guaranteed to be zeroed when allocated. Reviewed-by: Eduardo Habkost -- Eduardo