From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:60870) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UI6SP-0003uh-P1 for qemu-devel@nongnu.org; Tue, 19 Mar 2013 20:00:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UI6SO-00047p-P2 for qemu-devel@nongnu.org; Tue, 19 Mar 2013 20:00:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:4778) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UI6SO-00047j-Ff for qemu-devel@nongnu.org; Tue, 19 Mar 2013 20:00:40 -0400 Message-ID: <5148FC1C.9040001@redhat.com> Date: Wed, 20 Mar 2013 01:00:28 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1363628125-5310-1-git-send-email-pbonzini@redhat.com> <5147572E.8040501@redhat.com> <51475A00.8070304@redhat.com> <5147738F.7070803@redhat.com> <51482F56.4070604@redhat.com> <51483DAB.4040101@redhat.com> <5148E56A.4010105@redhat.com> <5148F64D.3080705@redhat.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 00/35] hw/ reorganization, part 2 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: "Edgar E. Iglesias" , Richard Henderson , qemu-devel@nongnu.org, =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= Il 20/03/2013 00:44, Peter Maydell ha scritto: > On 19 March 2013 23:35, Paolo Bonzini wrote: >> > Il 19/03/2013 23:34, Peter Maydell ha scritto: >>> >> On 19 March 2013 22:23, Paolo Bonzini wrote: >>>> >>> So, okay to put these in hw/arm and then I'll work on patches moving >>>> >>> cpu_arm_init to a*mpcore.c? >>> >> >>> >> Wrong way round. If you can't put the cpu_arm_init into the a*mpcore >>> >> in a way that doesn't make you want to put them in hw/arm/ then >>> >> it should wait until we've QOMified the CPU cores sufficiently >>> >> that we can do it properly. >> > >> > Does that include calling the CPU constructor something else than >> > cpu_arm_init (which is defined in target-arm/)? For me that would be >> > enough to put it in hw/arm. > The CPU should be created (and thus initialised and realised) the same > way as any other QOM object or device; the containers shouldn't need > to call cpu_arm_init directly. ARM is already quite good in that respect. However, until all architectures are converted cpu_*_init needs to remain because of user-mode targets (where the CPUs are created by common code, there is no board to encapsulate the target-specific differences). IMHO waiting for the demise of cpu_*_init is putting the cart before the horse, or another similar proverb. (Also, I don't see much difference between using a function in target-ARCH and using a TYPE_FOO define from target-ARCH. They are the same thing masked through RTTI. hw/ARCH should really be the bridge between target-ARCH and hw/everything-else, and a*mpcore.c fits in that description). Paolo