From patchwork Mon Apr 15 22:12:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Igor Mammedov X-Patchwork-Id: 236746 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 9ABD92C00DD for ; Tue, 16 Apr 2013 08:18:28 +1000 (EST) Received: from localhost ([::1]:51827 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URrjG-0005Cs-OC for incoming@patchwork.ozlabs.org; Mon, 15 Apr 2013 18:18:26 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35077) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URreq-0006LU-RY for qemu-devel@nongnu.org; Mon, 15 Apr 2013 18:13:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1URrep-0008Dt-Sa for qemu-devel@nongnu.org; Mon, 15 Apr 2013 18:13:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36786) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URrep-0008Dn-Iv for qemu-devel@nongnu.org; Mon, 15 Apr 2013 18:13:51 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r3FMDjKt003467 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 15 Apr 2013 18:13:45 -0400 Received: from thinkpad.redhat.com (vpn-238-183.phx2.redhat.com [10.3.238.183]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r3FMCvIf027659; Mon, 15 Apr 2013 18:13:42 -0400 From: Igor Mammedov To: qemu-devel@nongnu.org Date: Tue, 16 Apr 2013 00:12:52 +0200 Message-Id: <1366063976-4909-13-git-send-email-imammedo@redhat.com> In-Reply-To: <1366063976-4909-1-git-send-email-imammedo@redhat.com> References: <1366063976-4909-1-git-send-email-imammedo@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: aliguori@us.ibm.com, ehabkost@redhat.com, mst@redhat.com, jan.kiszka@siemens.com, claudio.fontana@huawei.com, aderumier@odiso.com, lcapitulino@redhat.com, jfrei@linux.vnet.ibm.com, yang.z.zhang@intel.com, pbonzini@redhat.com, afaerber@suse.de, lig.fnst@cn.fujitsu.com, rth@twiddle.net Subject: [Qemu-devel] [PATCH 12/16] target-i386: cpu: attach ICC bus to CPU on its creation X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org ... 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ärber --- 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 #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 = NULL; + Object *icc_bus = object_resolve_path_type("icc-bus", TYPE_ICC_BUS, NULL); model_pieces = g_strsplit(cpu_model, ",", 2); if (!model_pieces[0]) { @@ -1619,6 +1621,10 @@ X86CPU *cpu_x86_create(const char *cpu_model, Error **errp) features = model_pieces[1]; cpu = X86_CPU(object_new(TYPE_X86_CPU)); + if (icc_bus) { + qdev_set_parent_bus(DEVICE(cpu), BUS(icc_bus)); + object_unref(OBJECT(cpu)); + } env = &cpu->env; env->cpu_model_str = cpu_model; @@ -2330,6 +2336,7 @@ static void x86_cpu_common_class_init(ObjectClass *oc, void *data) xcc->parent_realize = dc->realize; dc->realize = x86_cpu_realizefn; + dc->bus_type = TYPE_ICC_BUS; xcc->parent_reset = cc->reset; cc->reset = x86_cpu_reset;