From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:51550) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUMCT-0000Ck-Ix for qemu-devel@nongnu.org; Mon, 22 Apr 2013 15:14:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UUMCS-0008Nv-Fq for qemu-devel@nongnu.org; Mon, 22 Apr 2013 15:14:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38013) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUMCS-0008Nm-6w for qemu-devel@nongnu.org; Mon, 22 Apr 2013 15:14:52 -0400 Date: Mon, 22 Apr 2013 21:14:27 +0200 From: Igor Mammedov Message-ID: <20130422211427.16209d7a@nial.usersys.redhat.com> In-Reply-To: <517556E1.6030100@suse.de> References: <1366063976-4909-1-git-send-email-imammedo@redhat.com> <1366063976-4909-13-git-send-email-imammedo@redhat.com> <51755109.6020007@suse.de> <20130422172054.358142e3@nial.usersys.redhat.com> <517556E1.6030100@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 12/16] target-i386: cpu: attach ICC bus to CPU on its creation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?ISO-8859-1?B?RuRyYmVy?= Cc: aliguori@us.ibm.com, ehabkost@redhat.com, mst@redhat.com, jan.kiszka@siemens.com, claudio.fontana@huawei.com, qemu-devel@nongnu.org, aderumier@odiso.com, lcapitulino@redhat.com, jfrei@linux.vnet.ibm.com, yang.z.zhang@intel.com, pbonzini@redhat.com, lig.fnst@cn.fujitsu.com, rth@twiddle.net On Mon, 22 Apr 2013 17:27:29 +0200 Andreas F=E4rber wrote: > Am 22.04.2013 17:20, schrieb Igor Mammedov: > > On Mon, 22 Apr 2013 17:02:33 +0200 > > Andreas F=E4rber wrote: > >=20 > >> Am 16.04.2013 00:12, schrieb Igor Mammedov: > >>> ... during startup, so it would be possible to unplug it later > >>> and set bus_type to TYPE_ICC_BUS for X86CPU type to make device_add > >>> attach hotplugged CPU to ICC bus. > >>> > >>> Signed-off-by: Igor Mammedov > >> > >> Reviewed-by: Andreas F=E4rber > >> > >> But still one question... > >> > >>> --- > >>> target-i386/cpu.c | 7 +++++++ > >>> 1 file changed, 7 insertions(+) > >>> > >>> diff --git a/target-i386/cpu.c b/target-i386/cpu.c > >>> index 6d6c527..3b5f90b 100644 > >>> --- a/target-i386/cpu.c > >>> +++ b/target-i386/cpu.c > >>> @@ -41,6 +41,7 @@ > >>> #endif > >>> =20 > >>> #include "sysemu/sysemu.h" > >>> +#include "hw/i386/icc_bus.h" > >>> #ifndef CONFIG_USER_ONLY > >>> #include "hw/xen/xen.h" > >>> #include "hw/sysbus.h" > >>> @@ -1609,6 +1610,7 @@ X86CPU *cpu_x86_create(const char *cpu_model, > >>> Error **errp) gchar **model_pieces; > >>> char *name, *features; > >>> Error *error =3D NULL; > >>> + Object *icc_bus =3D object_resolve_path_type("icc-bus", TYPE_ICC= _BUS, > >>> NULL);=20 > >>> model_pieces =3D g_strsplit(cpu_model, ",", 2); > >>> if (!model_pieces[0]) { > >>> @@ -1619,6 +1621,10 @@ X86CPU *cpu_x86_create(const char *cpu_model, > >>> Error **errp) features =3D model_pieces[1]; > >>> =20 > >>> cpu =3D X86_CPU(object_new(TYPE_X86_CPU)); > >>> + if (icc_bus) { > >>> + qdev_set_parent_bus(DEVICE(cpu), BUS(icc_bus)); > >>> + object_unref(OBJECT(cpu)); > >>> + } > >>> env =3D &cpu->env; > >>> env->cpu_model_str =3D cpu_model; > >>> =20 > >> > >> You seem to be avoiding making lack of icc-bus an error although you a= dd > >> it for both PC and q35 PC - which non-ICC use cases are you thinking o= f? > > *-user targets, CPU is bus-less there. >=20 > Would you be opposed to #ifdef'ing it then? In particular I am asking > because of the NULL error argument to the resolve function - for softmmu > I would prefer to make lack of icc-bus a fatal error. I'm fine with ifdef-ing there, if there is not objections. I'll look at making it fatal error on softmmu >=20 > Andreas >=20