Received: from eggs.gnu.org ([208.118.235.92]:40789) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tl673-0002Fn-9b for qemu-devel@nongnu.org; Tue, 18 Dec 2012 17:58:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tl671-0006Hd-TG for qemu-devel@nongnu.org; Tue, 18 Dec 2012 17:58:13 -0500 Received: from cantor2.suse.de ([195.135.220.15]:34524 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tl671-0006HY-Jj for qemu-devel@nongnu.org; Tue, 18 Dec 2012 17:58:11 -0500 Message-ID: <50D0F4F6.4090500@suse.de> Date: Tue, 18 Dec 2012 23:57:58 +0100 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1355861053-11460-1-git-send-email-ehabkost@redhat.com> In-Reply-To: <1355861053-11460-1-git-send-email-ehabkost@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC 00/20] generic_cpu_init() and generic_cpu_create() functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: Peter Maydell , Paul Brook , Guan Xuetao , qemu-devel@nongnu.org, Igor Mammedov Am 18.12.2012 21:03, schrieb Eduardo Habkost: > This is just a proof of concept, of how I think we could gradually move= to > make the architectures share CPU creation/initialization code. >=20 > I have implemented a quick cpu_realize() function, just for testing, wh= ile we > don't have qdev realizefn support implemented. >=20 > I have converted the following targets to use generic_cpu_init(): openr= isc, arm, > m68k, unicore32. >=20 > To support other architectures with additional CPU lookup requirements > (automatically adding "-cpu" suffix, or CPU model aliases), we ca= n simply > add fields to CPUClass for the target-specific behavior, that can be us= ed by > generic_cpu_create(). Without having looked at the series yet, what I have been experiencing the last three rounds of CPU subclass conversions is that a per-target name -> ObjectClass mapping works pretty well to abstract target'isms. Therefore I was gonna pursue a CPUClass::find_by_name() hook or so as generalization. That would result in a name -> class, object_new(name(class)), env->cpu_model_str =3D name, realize scheme. That would leave us with the issues of QOM/device realization and of cpu_copy(). realize would in my mind allow us to register a realizefn in CPU class_init, automatically invoked by object_new, the targetted recursive realization allowing to drop any realize call from cpu_init() and with a couple explicit realization calls in *-user allowing us to repurpose cpu_init() for creation. But maybe I'm overlooking something or we're looking at different time frames. :-) Andreas > We can also extend generic_cpu_init() later to support > parsing of "+feature,-feature" feature strings, to set properties on th= e CPU > objects, like on x86. >=20 > Note that this series is completely untested except for checking if the= code > compiles. I am just using the series as a way to demonstrate what I hav= e in > mind. --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg