From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54565) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vj9ZR-0001aP-LI for qemu-devel@nongnu.org; Wed, 20 Nov 2013 10:20:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vj9ZK-00077L-7I for qemu-devel@nongnu.org; Wed, 20 Nov 2013 10:20:01 -0500 Received: from cantor2.suse.de ([195.135.220.15]:58940 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vj9ZJ-000776-T9 for qemu-devel@nongnu.org; Wed, 20 Nov 2013 10:19:54 -0500 Message-ID: <528CD315.8070700@suse.de> Date: Wed, 20 Nov 2013 16:19:49 +0100 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] ARM cpu object, setting properties from board model List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell , QEMU Developers Cc: Igor Mammedov Am 19.11.2013 21:01, schrieb Peter Maydell: > I find myself with a use case where I would like to set > a CPU object property from the board model init function > (specifically, I'd like the board model to be able to say > "this CPU will boot via PSCI so if you're KVM then start > it appropriately"). >=20 > I could just reach in and fiddle with the ARMCPU field > the way hw/arm/highback.c does with reset_cbar (and in fact > that's what I'm likely to do for the moment). However it > seems like it would be nicer for it to be an official > QOM property. This is alas not currently possible because > cpu_arm_init() does both 'init' and 'realize', and once > you've called it it's too late to set properties. >=20 > Andreas -- did you have any thoughts/plans/code in this area? > Splitting the realize part out of cpu_arm_init(), or > providing a cpu_arm_init_dont_realize() [ugh], would be > easy to code but is it going in the right direction? My first thought without reviewing the code is to just inline object_new() followed by object_property_set_bool() in the machine - that's what I've done for my downstream rl78, where I needed to postpone realizing the CPU until the firmware blob had been loaded (similar to armv7m, you may remember pointing me to that example :)). You are free to split cpu_arm_init() into calling a non-realizing function, followed by the realization step, then you can reuse that in multiple places if needed. Mid-term I intend cpu_*_init() to not realize the CPU - for boards that is waiting on the recursive realization support, so that only *-user would need to manually realize the CPU. I would by contrast caution not to blindly use global properties for cpu_arm_init() since mixed cores are getting more and more common. For x86 that is much less problematic. Regards, Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg