From patchwork Tue Jul 17 20:28:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 10530573 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0F8E56020A for ; Tue, 17 Jul 2018 20:34:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0066A289B2 for ; Tue, 17 Jul 2018 20:34:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E903A2916D; Tue, 17 Jul 2018 20:34:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 70EC8289B2 for ; Tue, 17 Jul 2018 20:34:41 +0000 (UTC) Received: from localhost ([::1]:33177 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ffWgC-0004hx-4q for patchwork-qemu-devel@patchwork.kernel.org; Tue, 17 Jul 2018 16:34:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49515) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ffWac-0000LB-Ve for qemu-devel@nongnu.org; Tue, 17 Jul 2018 16:28:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ffWaZ-0005pP-OH for qemu-devel@nongnu.org; Tue, 17 Jul 2018 16:28:55 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:52367) by eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71) (envelope-from ) id 1ffWaZ-0005on-B9 for qemu-devel@nongnu.org; Tue, 17 Jul 2018 16:28:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1531859332; x=1563395332; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=W9bRzEGMy+Jky9nnCS0ilVuC88ZyPsCNeeD+GeO4ygA=; b=BdEch6ekDVSxV3Tvcu788H4oG9dyPlLbaa26Q04oT3Hdyt2jO0JIm1AS RScDImqvFhhq+s51MKM6jwz8EUA+8iClTmoA8Tr/3dLjH0Y9pe2NBivv2 X29A6fqyKG9H5CbzSfgbXzodqyaL6CN+er3kNPJ7Isv95uxLKoZw8sbm8 WD8ZStBu+Un5jFsTlomtkcRiAFfMJRAL0buBqIPPkM9i1+gEn9XLw8iPp taMwKpgGAPV9tJJQLtnwlNQJkwY+OacE2HQZO6UjxJGYTmMUfiSLsdoS7 a2je6fz4i9IR1zDnWaum/N2zy3SjgytZeXr3KPudvThOrDo/OIM7e24FZ w==; X-IronPort-AV: E=Sophos;i="5.51,366,1526313600"; d="scan'208";a="85582321" Received: from mail-bn3nam04lp0118.outbound.protection.outlook.com (HELO NAM04-BN3-obe.outbound.protection.outlook.com) ([216.32.180.118]) by ob1.hgst.iphmx.com with ESMTP; 18 Jul 2018 04:28:50 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-wdc-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=O04ttyAvflY7xNRuN1XMygf9ikVkKzXYM6fRCF9TB1A=; b=LhZBi3ebDy20xsy64ZR3y4d9n2kkHS6sPvmrpus2xE1RlrwaKSokqtTjW4LHJQeeVq9znU2ZreBN0t8G9uFymHBh0bV93I9S1SC/wEjaopXVogx6h1IncuIZmKOw5E6AAF8sft8qwJYzj0xvbgGMjpoVdhp32qXcVCBVXR7BDTM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Alistair.Francis@wdc.com; Received: from risc6-mainframe.int.fusionio.com (199.255.44.250) by CY4PR04MB0391.namprd04.prod.outlook.com (2603:10b6:903:b1::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.16; Tue, 17 Jul 2018 20:28:47 +0000 From: Alistair Francis To: qemu-devel@nongnu.org Date: Tue, 17 Jul 2018 13:28:39 -0700 Message-Id: <9495ff8a469ffcdeeaeaf3f0b59f999d20df8285.1531859179.git.alistair.francis@wdc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [199.255.44.250] X-ClientProxiedBy: BYAPR04CA0035.namprd04.prod.outlook.com (2603:10b6:a03:40::48) To CY4PR04MB0391.namprd04.prod.outlook.com (2603:10b6:903:b1::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 322ad8a2-9700-4625-2cbe-08d5ec23e6a2 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(48565401081)(5600053)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:CY4PR04MB0391; X-Microsoft-Exchange-Diagnostics: 1; CY4PR04MB0391; 3:eYVPsSMXrlFXTqnVTpogLH09y8Jc8/JZ9jMUzVA4Fex14Kalrg9FXw98cuTM/p3V0o+YKBnGNVLH4QoOUT5tIPN/TaSWCFl4lYq4sp4VS/p9J/sV8cTJQTwSBVs6zeOD8F7aPQiNnMOEB3STtsKgiNods3Dj41LPN7wuIXeuiG8QkoL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4Wygct2dmVN3hFXM/UF4xuFXkEwKFB/nnoUaKcam7CjTA1Ly8wBfN5IyOeqkKhl8Lw7IWRRvbZU7Pr0sij92sUK67CYUmxE4wvcdl8bbMTRLTwVknwFxDI3NH5Jb2k0M1l1d/6NIkN9/XP3AtKX7z4mSMCvecVN58935JUKLczjzYL55YtHputzrhFGy5; 4:JBMH4Nc2Gmdt3QxhEMSDkmiML8ZcLVEL1v6Xlbi7862iWhNmGpvqDHvhVhxWx9WoUyyDxD5G6R7I0dU1bPkP5I4qfegicijmttypynPESYlQZLp9OPY1xox9DZ8HgIzSomK9Xh7v65wQLl/QRSOJ1jlAvbh81rKmRqSvdM9IwNEmoHwsPB/DiGp1DDtclLNYEmWUd4oPQIWF3OLSGCilE1MSuL+9/Dk/2CV3aU+o3ddQTIRiRQC4KN1KhYXkzGrzNx7p6erDVDLQoaHRrJ2C0w== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(3231311)(944501410)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:CY4PR04MB0391; BCL:0; PCL:0; RULEID:; SRVR:CY4PR04MB0391; X-Forefront-PRVS: 073631BD3D X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(346002)(136003)(396003)(376002)(366004)(39860400002)(189003)(199004)(16586007)(478600001)(316002)(2351001)(50226002)(105586002)(106356001)(36756003)(72206003)(50466002)(6666003)(5660300001)(2906002)(6916009)(68736007)(2361001)(118296001)(26005)(386003)(6506007)(48376002)(52116002)(446003)(47776003)(11346002)(51416003)(81156014)(81166006)(8676002)(3846002)(76176011)(6116002)(66066001)(44832011)(2616005)(476003)(956004)(7736002)(486006)(97736004)(8936002)(305945005)(6486002)(86362001)(6512007)(25786009)(53936002)(4326008)(16526019)(186003); DIR:OUT; SFP:1102; SCL:1; SRVR:CY4PR04MB0391; H:risc6-mainframe.int.fusionio.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR04MB0391; 23:6z9WxjpjAcd4gH5jUTlltFJKvPZHmw4n9GdkvNowi?= =?us-ascii?Q?mKjbcD9cupQFtQYAqQNo6C9AXkiaNai1Ro5yG04VX214Pue9xiRj77nw0+9L?= =?us-ascii?Q?FFPclZ0Je4EHgWYuP5ckgyc5QbNsN5C6qmAJsKMLhk8QNx7jGDo8mziMmQaD?= =?us-ascii?Q?YK6mE0jnUrzimf2exTWCxwqc7pOWiXnp/PLmv0v3sMvvLx3tnvuGZL5Ntfco?= =?us-ascii?Q?19KzFJ2ss2ceUCoceDyMjzdMvQe73Cac/fqz3a1qlfpefDFyRqmtMBZduQa4?= =?us-ascii?Q?vh6swfgkGZ5J8v/p3rOk2LHqdPumQSbnQy1WOIk26smRC9SxLYpzY9oUni2C?= =?us-ascii?Q?IlKWURCGk8YPrxQLCq+gc384Fwa71+Ch9tZ4XAhBsmReqBvkJPu25joEF9jT?= =?us-ascii?Q?9aFukdTl25Z8Op2y9g8N0zRxs9irB1yNmIa8l13IU86T3wlO6K/8h1vKsYwG?= =?us-ascii?Q?kkZwUY7pq/wxHSeaZUxEVgBCSHdf1KDqklO7qO+A5nWOUZZbvxgAzV5wkhEa?= =?us-ascii?Q?42XbtRS7d6XHBgt70vKEsS8E1rdqQzRZ75TpBcOOgx1o2FvlC77xO51dLGEu?= =?us-ascii?Q?p0YqZ0Q3FqWQEwrwtfxQhtXBvngrdmjoAODiNEaqDR16mKyhJ4uXkDWbKYLq?= =?us-ascii?Q?/djt9kXTIFyoLvuDLHw3ocQKHVHd3DemZyUT9qZdwLIQ+gRRFyD7sCGkvY16?= =?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6W1I9K2RQtLx/FUJ5Yl5r0NUGb0Pc75Kufq390q6lAL+o1hwO/VfN2HASNDnnxCNSrqWyWiHjQailhTTRmVSOPl0bbOo68eSge41ob0YKiTnXb9r3rxy/lX1NpVykDpP0faEjUuYW8AO/tZM85t93T/DF1fR/sI= X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2018 20:28:47.8160 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 322ad8a2-9700-4625-2cbe-08d5ec23e6a2 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR04MB0391 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 216.71.154.45 Subject: [Qemu-devel] [PATCH v1 5/5] spike: Fix crash when introspecting the device 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: thuth@redhat.com, mjc@sifive.com, alistair.francis@wdc.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Use the new object_initialize_child() and sysbus_init_child_obj() to fix the issue. Signed-off-by: Alistair Francis Reviewed-by: Michael Clark --- hw/riscv/spike.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/hw/riscv/spike.c b/hw/riscv/spike.c index f94e2b6707..c8c056c50b 100644 --- a/hw/riscv/spike.c +++ b/hw/riscv/spike.c @@ -171,9 +171,8 @@ static void spike_v1_10_0_board_init(MachineState *machine) int i; /* Initialize SOC */ - object_initialize(&s->soc, sizeof(s->soc), TYPE_RISCV_HART_ARRAY); - object_property_add_child(OBJECT(machine), "soc", OBJECT(&s->soc), - &error_abort); + object_initialize_child(OBJECT(machine), "soc", &s->soc, sizeof(s->soc), + TYPE_RISCV_HART_ARRAY, &error_abort, NULL); object_property_set_str(OBJECT(&s->soc), SPIKE_V1_10_0_CPU, "cpu-type", &error_abort); object_property_set_int(OBJECT(&s->soc), smp_cpus, "num-harts", @@ -254,9 +253,8 @@ static void spike_v1_09_1_board_init(MachineState *machine) int i; /* Initialize SOC */ - object_initialize(&s->soc, sizeof(s->soc), TYPE_RISCV_HART_ARRAY); - object_property_add_child(OBJECT(machine), "soc", OBJECT(&s->soc), - &error_abort); + object_initialize_child(OBJECT(machine), "soc", &s->soc, sizeof(s->soc), + TYPE_RISCV_HART_ARRAY, &error_abort, NULL); object_property_set_str(OBJECT(&s->soc), SPIKE_V1_09_1_CPU, "cpu-type", &error_abort); object_property_set_int(OBJECT(&s->soc), smp_cpus, "num-harts",