From patchwork Tue Nov 8 08:08:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?C=C3=A9dric_Le_Goater?= X-Patchwork-Id: 692182 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tChp60lTSz9vF7 for ; Tue, 8 Nov 2016 19:10:54 +1100 (AEDT) Received: from localhost ([::1]:59050 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c41UX-0004hx-Rg for incoming@patchwork.ozlabs.org; Tue, 08 Nov 2016 03:10:49 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37640) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c41Sq-0003EQ-7Z for qemu-devel@nongnu.org; Tue, 08 Nov 2016 03:09:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c41Sn-0007mu-2f for qemu-devel@nongnu.org; Tue, 08 Nov 2016 03:09:04 -0500 Received: from 3.mo5.mail-out.ovh.net ([46.105.40.108]:55578) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c41Sm-0007lx-T8 for qemu-devel@nongnu.org; Tue, 08 Nov 2016 03:09:01 -0500 Received: from player688.ha.ovh.net (b7.ovh.net [213.186.33.57]) by mo5.mail-out.ovh.net (Postfix) with ESMTP id B21323F525 for ; Tue, 8 Nov 2016 09:08:59 +0100 (CET) Received: from hermes.kaod.org.com (LFbn-1-2234-107.w90-76.abo.wanadoo.fr [90.76.55.107]) (Authenticated sender: clg@kaod.org) by player688.ha.ovh.net (Postfix) with ESMTPSA id 72D7B20084; Tue, 8 Nov 2016 09:08:53 +0100 (CET) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-ppc@nongnu.org Date: Tue, 8 Nov 2016 09:08:05 +0100 Message-Id: <1478592490-29673-6-git-send-email-clg@kaod.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1478592490-29673-1-git-send-email-clg@kaod.org> References: <1478592490-29673-1-git-send-email-clg@kaod.org> MIME-Version: 1.0 X-Ovh-Tracer-Id: 9807432613916085075 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeelvddrleehgdduvddtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 46.105.40.108 Subject: [Qemu-devel] [PATCH v6 05/10] ppc/pnv: add a XICS object to the PowerNV machine X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexander Graf , qemu-devel@nongnu.org, Cedric Le Goater , David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Nothing more than a simple container object for the ICP and ICS. ICPs are still created by the XICS object for the moment. Signed-off-by: Cédric Le Goater --- David, Please note the qdev_set_parent_bus(). That is how the reset should be handled. I had done that before for the Aspeed SoC machine but I had forgotten ... hw/ppc/pnv.c | 10 ++++++++++ include/hw/ppc/pnv.h | 3 +++ 2 files changed, 13 insertions(+) diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index 6af34241f248..435af7cf4e48 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -411,6 +411,16 @@ static void ppc_powernv_init(MachineState *machine) } } + /* Create XICS which holds all the ICPs for each thread */ + object_initialize(&pnv->xics, sizeof(pnv->xics), TYPE_XICS_COMMON); + object_property_add_child(OBJECT(machine), "xics", OBJECT(&pnv->xics), + &error_fatal); + qdev_set_parent_bus(DEVICE(&pnv->xics), sysbus_get_default()); + object_property_set_int(OBJECT(&pnv->xics), smp_cores * smp_threads, + "nr_servers", &error_fatal); + object_property_set_bool(OBJECT(&pnv->xics), true, "realized", + &error_fatal); + /* We need some cpu model to instantiate the PnvChip class */ if (machine->cpu_model == NULL) { machine->cpu_model = "POWER8"; diff --git a/include/hw/ppc/pnv.h b/include/hw/ppc/pnv.h index 7bee658733db..cb9499728fda 100644 --- a/include/hw/ppc/pnv.h +++ b/include/hw/ppc/pnv.h @@ -22,6 +22,7 @@ #include "hw/boards.h" #include "hw/sysbus.h" #include "hw/ppc/pnv_lpc.h" +#include "hw/ppc/xics.h" #define TYPE_PNV_CHIP "powernv-chip" #define PNV_CHIP(obj) OBJECT_CHECK(PnvChip, (obj), TYPE_PNV_CHIP) @@ -113,6 +114,8 @@ typedef struct PnvMachineState { PnvChip **chips; ISABus *isa_bus; + + XICSState xics; } PnvMachineState; #define PNV_FDT_ADDR 0x01000000