From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38812) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXYMS-0007LT-2H for qemu-devel@nongnu.org; Thu, 24 May 2012 09:45:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SXYMN-00066m-43 for qemu-devel@nongnu.org; Thu, 24 May 2012 09:45:51 -0400 Received: from cantor2.suse.de ([195.135.220.15]:49602 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXYMM-00066D-Na for qemu-devel@nongnu.org; Thu, 24 May 2012 09:45:46 -0400 Message-ID: <4FBE3B81.8080409@suse.de> Date: Thu, 24 May 2012 15:45:37 +0200 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <4FBE3359.6040407@redhat.com> In-Reply-To: <4FBE3359.6040407@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH qom-next 4/6] pc: move apic_mapped initialization into common apic init code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov , Peter Maydell Cc: aliguori@us.ibm.com, ehabkost@redhat.com, stefano stabellini , sw@weilnetz.de, mtosatti@redhat.com, qemu-devel@nongnu.org, agraf@suse.de, blauwirbel@gmail.com, avi@redhat.com, jan kiszka , anthony perard , pbonzini@redhat.com Am 24.05.2012 15:10, schrieb Igor Mammedov: > On 05/23/2012 11:26 PM, Peter Maydell wrote: >> On 23 May 2012 22:09, Igor Mammedov wrote: >>> For cpu-hotplug it was suggested to use device_add/del >>> interface for it. To do so in a generalized way hot-plugged cpu >>> should follow general QOM object creation sequence, i.e. >>> - create new cpu instance >>> - set properties >>> - realize instance >>> without creating precedent of special case for cpus in device_add/del >>> if possible. So goal is to have a self-sufficient cpu object that >>> doesn't require external hooks to create/initialize it. It looks >>> possible do so for target-i386 at least. >> >> I think your self-sufficient CPU object should probably be a >> container QOM object which contains the CPU core itself and >> the APIC device. Then the container object's initialisation >> can map the APIC device. >=20 > For x86 it would be artificial thing without a real hardware to > model after, that would needlessly complicate code and interface. > I'd rather avoid this. >=20 > Meanwhile I've found only two devices that do mapping inside > device's initfn :( >=20 > hw/lm32_sys.c > hw/bonito.c >=20 > and lm32_sys has comment: > /* Note: This device is not created in the board initialization, > * instead it has to be added with the -device parameter. Therefore= , > * the device maps itself. */ >=20 > So for some devices it's possible to do so. Simply put: Doing the mmio_map after qdev init is historical and no reason to keep doing so. It breaks the desired late-realize model. I believe Anthony's controversial series on GitHub with the "boilerplate" accessors that Peter so disliked tried to fix this? 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