From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47392) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WMgJz-0003th-Oo for qemu-devel@nongnu.org; Sun, 09 Mar 2014 12:11:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WMgJs-0004rX-EZ for qemu-devel@nongnu.org; Sun, 09 Mar 2014 12:11:27 -0400 Received: from cantor2.suse.de ([195.135.220.15]:36164 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WMgJs-0004rR-8n for qemu-devel@nongnu.org; Sun, 09 Mar 2014 12:11:20 -0400 Message-ID: <531C92A5.1080604@suse.de> Date: Sun, 09 Mar 2014 17:11:17 +0100 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1393901749-5944-1-git-send-email-afaerber@suse.de> <531690FB.7060801@ozlabs.ru> <5316E094.2020508@suse.de> <53170A15.4060902@ozlabs.ru> In-Reply-To: <53170A15.4060902@ozlabs.ru> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH qom-cpu 0/6] cpu: Unifying features parsing List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy , qemu-devel@nongnu.org Cc: Igor Mammedov , Eduardo Habkost , Anthony Liguori , Peter Maydell Am 05.03.2014 12:27, schrieb Alexey Kardashevskiy: > On 03/05/2014 07:30 PM, Andreas F=C3=A4rber wrote: >> Am 05.03.2014 03:50, schrieb Alexey Kardashevskiy: >>> On 03/04/2014 01:55 PM, Andreas F=C3=A4rber wrote: >>>> Hello, >>>> >>>> Prompted by Alexey's desire for tweakable PowerPCCPU properties but = also by >>>> Peter's wish for ARMCPU properties, this series sets out to align cp= u_model >>>> parsing across targets. >>>> >>>> QemuOpts would've been nice to use, but on the one hand x86 and spar= c use >>>> QemuOpts-incompatible +foo and -foo syntax (which accumulate rather = than apply >>>> immediately) and on the other linux-user and bsd-user don't use Qemu= Opts at all. >>>> >>>> The x86 implementation is closest to the proposed API, save for some= laziness. >>>> SPARC is brought in line. And as fallback for the remaining targets = a new >>>> implementation, derived from x86 but supporting only key=3Dvalue for= mat, is added. >>>> >>>> To facilitate using this infrastructure, a generic CPU init function= is created. >>> >>> >>> Besides the fact that this patchset does not support dynamic properti= es >>> (added by object_property_add(), and I used it in my initial patchset= ), >> >> Why would that be? I am using QOM object_property_parse() just like on >> x86 where we do have a mix of static and dynamic properties. Maybe you >> are using object_property_add() in the wrong place? It should be used = in >> the instance_init function of the CPU - be it PowerPCCPU or a derived >> family/model - i.e. before cpu_ppc_init() returns. The same is necessa= ry >> to support -global. >=20 >=20 > cpu_ppc_init() calls cpu_generic_init() which does parsing before setti= ng > "realized" to "true". The only way to add a dynamic property here is to= put > object_property_add() in ppc_cpu_initfn() but it does not have CPU fami= ly > hooks (unlike realizefn). Adding "compat" for every PPC CPU is ... wron= g? >=20 > Where I tried adding dynamic property before is init_proc_POWER7 > (PowerPCCPUClass::init_proc) which is called from init_ppc_proc() which= is > called from ppc_cpu_realizefn() and this is too late. I see now that the family's TypeInfo only specifies a class_init but not an instance_init. >>> that works for SPAPR, just need to implement property statically (tes= ted). It's been really long ago... could you please point me to what exactly the property needs to be doing so that I get a feeling of whether a static property is a solution after all or whether I need to somehow tweak the family macro to allow for an instance_init? Like, does the property need to be settable after realize? Thanks, 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