From patchwork Fri Feb 14 07:21:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 11381815 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 02BF0139A for ; Fri, 14 Feb 2020 07:24:18 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CD0BD2187F for ; Fri, 14 Feb 2020 07:24:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="M3icoKnD"; dkim=pass (1024-bit key) header.d=sharedspace.onmicrosoft.com header.i=@sharedspace.onmicrosoft.com header.b="KFgQ5J0t" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CD0BD2187F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:35630 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2VKj-00050l-2L for patchwork-qemu-devel@patchwork.kernel.org; Fri, 14 Feb 2020 02:24:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52107) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2VIf-00024E-Qe for qemu-devel@nongnu.org; Fri, 14 Feb 2020 02:22:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2VIe-00043h-OS for qemu-devel@nongnu.org; Fri, 14 Feb 2020 02:22:09 -0500 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:45274) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j2VIa-0003xQ-M3; Fri, 14 Feb 2020 02:22:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1581664925; x=1613200925; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=sdmk7a5KXpxrXvmScNDo/qzuUy1KsT2G9tzvP6RiQCw=; b=M3icoKnDxWKbN9tEWLFIyxsZgUPwPlcI3YbbA3YJg9yB/fSWD+w6iEc/ FPFAhX5maF8la+E1D0SzR5oeIOQTJgbFop3qLJshQio4Fg96Ee9LE0a9Q sharvS2NQwIykhbFH4IzhAfLAo3x/NUkMGirdX0D0c0kvgk7li3Fdk5cv fAXO0tv0y8ywF6Y1KBgGbBNDwMlgmbJtZlVX6ra3ENET/mf/wXY8bQwIa zP81fW+LPHBg7LGgDhr5Fv04JSvjssND4j4u7lJfcxqDxAehupksS4RpI +sxNhCUKFrgSYyws0VfrGs3InrwnCcXSqkUVUnKbDyQ3SXClNSvSVh/oT Q==; IronPort-SDR: FetsdmEe8nc1w1O2wHiAQPpD6qwuPwyamxjfynQ/MNPi8NsOHW6Bk5U51uhK0iIyY8HZAIBwYR d0QP5YTH/RkguLn0G5Qqft1EipzgjUia6PckbKDBhuq95hgJLVtTGz8Dt6DGmPE0R8YAZXglHN W7tlf6+DSdy3e9orpAGYYiqTdbCJy4gJlqPVl5G6Dc+Y2clfMTvUqEvvxdYN1uIEHeacAjmfKx AAOMcNZvomihhyBN+nApWxfY8b8Juw4aZWrqsL0GJfyh90B2PeiTyXcsIpWFCRMCoz9JtkZ1UB roY= X-IronPort-AV: E=Sophos;i="5.70,439,1574092800"; d="scan'208";a="131289868" Received: from mail-dm6nam12lp2171.outbound.protection.outlook.com (HELO NAM12-DM6-obe.outbound.protection.outlook.com) ([104.47.59.171]) by ob1.hgst.iphmx.com with ESMTP; 14 Feb 2020 15:22:03 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cldc20sp4xB36XJaI3IzIPZe6MKc5f+Otsb6v1ofaDq6XLzqoegHtH3HkH637v/YcyLDySWtOwp35cCRUw0yj6O15BAo3vPYawbikyN+QuDBW33wwVUYM37wdDkoI7x3tK5IW2fHeZjFUURKLHGioeg5TGJeg5MhS69yqVK+JyhoIw3V+t1z5vUJj5WMoMunVwUL0Cd6mpoldgfak5L2E/F+z8w9o3uKpPO4rIA+1c8gbHL30CMHagLv3mp+Ho6clqMXXittcj2o8Xc3AsRPWtANiNYZ8D7ok3BSVdRn7U/dd9ftkdA2M1wxYk1/8LeY9B+zKjwswAV9P0nQk+RWFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NOPQkkLSS+/fwdjqpHB5eseaQyBeFgWRXKjn41/E1zI=; b=M8y5aeAMHEKPi0YIkHbiiW7ZRJ8Kjn7q+M9X8/OB/ueH8pcBUhTV5rTLUoRqjZnVzib2gQ0nP/ABqxceLvksyLe14j0hblyqJC0IHXGqo2U5ge72pPn//OiEXwYQoRifArr+nGEqc7LjoIo2CatrfH3UN7uSWkhwjLOmsaEaxBlWj8S5gQ4YdGX2ZAEDYoVivkZ5Bq/s373Jj+LsBgBjIWsTHMsrgwPqAizoua1rNtlwEL0QLPvxJTl+un78ZSgSIlYP1Y3i+EHOqr6bHBVnMF513SWt95bbCi1fOE3SC1EgsYyW96THpQDEtt/ibf8IXiBSeaGTk+3nM0WOxjxCtQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wdc.com; dmarc=pass action=none header.from=wdc.com; dkim=pass header.d=wdc.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector2-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NOPQkkLSS+/fwdjqpHB5eseaQyBeFgWRXKjn41/E1zI=; b=KFgQ5J0tkphV5dO88X5psvhcUTj/VmO7Diz3JitYqNE27vG+jEubRdngks4v6X8ke5coGWO5hVoTza8GPUxLPrEjiilwx1S6A7IxoWxR8Qbumk9gArJiP+sA2L7xPQ6EbTmpEKNrE4lnEsRyFjaqHegseHcGuiCaqKDWixpM038= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Anup.Patel@wdc.com; Received: from MN2PR04MB6061.namprd04.prod.outlook.com (20.178.246.15) by MN2PR04MB6288.namprd04.prod.outlook.com (52.132.169.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.23; Fri, 14 Feb 2020 07:22:01 +0000 Received: from MN2PR04MB6061.namprd04.prod.outlook.com ([fe80::a9a0:3ffa:371f:ad89]) by MN2PR04MB6061.namprd04.prod.outlook.com ([fe80::a9a0:3ffa:371f:ad89%7]) with mapi id 15.20.2729.025; Fri, 14 Feb 2020 07:22:01 +0000 From: Anup Patel To: Peter Maydell , Palmer Dabbelt , Alistair Francis , Sagar Karandikar Subject: [PATCH 1/3] hw/riscv: Add optional symbol callback ptr to riscv_load_firmware() Date: Fri, 14 Feb 2020 12:51:25 +0530 Message-Id: <20200214072127.64330-2-anup.patel@wdc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200214072127.64330-1-anup.patel@wdc.com> References: <20200214072127.64330-1-anup.patel@wdc.com> X-ClientProxiedBy: MA1PR0101CA0015.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::25) To MN2PR04MB6061.namprd04.prod.outlook.com (2603:10b6:208:d8::15) MIME-Version: 1.0 Received: from wdc.com (106.51.31.230) by MA1PR0101CA0015.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.23 via Frontend Transport; Fri, 14 Feb 2020 07:21:57 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [106.51.31.230] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 2a8d40f5-c72c-4e98-ef5f-08d7b11e956a X-MS-TrafficTypeDiagnostic: MN2PR04MB6288: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: WDCIPOUTBOUND: EOP-TRUE X-MS-Oob-TLC-OOBClassifiers: OLM:1417; X-Forefront-PRVS: 03137AC81E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(346002)(376002)(39860400002)(366004)(396003)(199004)(189003)(110136005)(478600001)(54906003)(316002)(52116002)(1076003)(7696005)(66946007)(36756003)(16526019)(8676002)(4326008)(81156014)(1006002)(44832011)(55236004)(8886007)(2906002)(956004)(26005)(66556008)(66476007)(8936002)(2616005)(5660300002)(86362001)(186003)(55016002)(81166006)(6666004)(32040200004); DIR:OUT; SFP:1102; SCL:1; SRVR:MN2PR04MB6288; H:MN2PR04MB6061.namprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vx661lO2YG3WPBCjoSWCQ2LbGEjQLglyhqRf5vpceU5cWZhK5YdgxqhpPDb7a4+735GsyAALnUF33xBNYi4s7LmIJOQobp4fBRXCeo8xMleR7lGyXc4ut2ITry0BiL76UaPBHb47RtkBItTneLBbaIWn0W5GZBEDKXNEdZ86eFE/vLwzv+ZBgOFp8yD/uiu+CrmSgqoc9MeMASrmDvWIBT4MxzUzzkpuwvLVGAmfcrP5i/vHF7CmGnJdmrD0HsJ0k2UFGgdbw9ez+81YuXz7QOUgtWkT8S5GjJXVs+DdZrM3GRcvPTp+WthetWDfsBI9pZ1SeqYcrkJ/lR/uaS0Dkbxqlzzy+8U01UQ3WtFXunxco2LdiDTKamMOcAzsWTx7h3WeZIeuLqnbA1fZG+8wXOTM0X0r3Uza14hmgyhUvnnRsB+zV0kPCeIgL0WFQ0OUnEOCOVMWi1Klo3VnPyz9fj2OQI8TEs9cH4s6IrZnryCFThwsUemfe8E3q77Z3vg3 X-MS-Exchange-AntiSpam-MessageData: TTYd4DsAjpQRBcesoiZrSroKbqg1f5y4lz451q/2y3VPWYXGN0Ol1+/N+rmv5TwALfEA1GOIPABlCAsY1ON+khGErMron2WZ2bZmxAmL7uFxL4+dNM0sze09L7Rvr/839Ji5n4mXhB76svf+eW3lhA== X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2a8d40f5-c72c-4e98-ef5f-08d7b11e956a X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Feb 2020 07:22:01.4430 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: TvTL+aKIs1Att5j4876DQ1h2hVBpdjWU/rVrVyuwhPIS5+bd+BHoZhrMPhLloum0E6KtBkk4dkEMX+4qoj+Gzw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR04MB6288 X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 216.71.154.45 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Atish Patra , Anup Patel , qemu-riscv@nongnu.org, qemu-devel@nongnu.org, Anup Patel Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" This patch adds an optional function pointer, "sym_cb", to riscv_load_firmware() which provides the possibility to access the symbol table during kernel loading. The pointer is ignored, if supplied with flat (non-elf) firmware image. The Spike board requires it locate the HTIF symbols from firmware ELF passed via "-bios" option. Signed-off-by: Anup Patel Reviewed-by: Alistair Francis --- hw/riscv/boot.c | 13 ++++++++----- hw/riscv/sifive_u.c | 2 +- hw/riscv/virt.c | 2 +- include/hw/riscv/boot.h | 6 ++++-- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/hw/riscv/boot.c b/hw/riscv/boot.c index 027303d2a3..7ec94dc701 100644 --- a/hw/riscv/boot.c +++ b/hw/riscv/boot.c @@ -36,7 +36,8 @@ void riscv_find_and_load_firmware(MachineState *machine, const char *default_machine_firmware, - hwaddr firmware_load_addr) + hwaddr firmware_load_addr, + symbol_fn_t sym_cb) { char *firmware_filename = NULL; @@ -76,7 +77,7 @@ void riscv_find_and_load_firmware(MachineState *machine, if (firmware_filename) { /* If not "none" load the firmware */ - riscv_load_firmware(firmware_filename, firmware_load_addr); + riscv_load_firmware(firmware_filename, firmware_load_addr, sym_cb); g_free(firmware_filename); } } @@ -96,12 +97,14 @@ char *riscv_find_firmware(const char *firmware_filename) } target_ulong riscv_load_firmware(const char *firmware_filename, - hwaddr firmware_load_addr) + hwaddr firmware_load_addr, + symbol_fn_t sym_cb) { uint64_t firmware_entry, firmware_start, firmware_end; - if (load_elf(firmware_filename, NULL, NULL, NULL, &firmware_entry, - &firmware_start, &firmware_end, 0, EM_RISCV, 1, 0) > 0) { + if (load_elf_ram_sym(firmware_filename, NULL, NULL, NULL, + &firmware_entry, &firmware_start, &firmware_end, 0, + EM_RISCV, 1, 0, NULL, true, sym_cb) > 0) { return firmware_entry; } diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c index 0140e95732..0c84215f42 100644 --- a/hw/riscv/sifive_u.c +++ b/hw/riscv/sifive_u.c @@ -341,7 +341,7 @@ static void riscv_sifive_u_init(MachineState *machine) create_fdt(s, memmap, machine->ram_size, machine->kernel_cmdline); riscv_find_and_load_firmware(machine, BIOS_FILENAME, - memmap[SIFIVE_U_DRAM].base); + memmap[SIFIVE_U_DRAM].base, NULL); if (machine->kernel_filename) { uint64_t kernel_entry = riscv_load_kernel(machine->kernel_filename, diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index c44b865959..90a5bfef63 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -476,7 +476,7 @@ static void riscv_virt_board_init(MachineState *machine) mask_rom); riscv_find_and_load_firmware(machine, BIOS_FILENAME, - memmap[VIRT_DRAM].base); + memmap[VIRT_DRAM].base, NULL); if (machine->kernel_filename) { uint64_t kernel_entry = riscv_load_kernel(machine->kernel_filename, diff --git a/include/hw/riscv/boot.h b/include/hw/riscv/boot.h index df80051fbc..474a940ad5 100644 --- a/include/hw/riscv/boot.h +++ b/include/hw/riscv/boot.h @@ -24,10 +24,12 @@ void riscv_find_and_load_firmware(MachineState *machine, const char *default_machine_firmware, - hwaddr firmware_load_addr); + hwaddr firmware_load_addr, + symbol_fn_t sym_cb); char *riscv_find_firmware(const char *firmware_filename); target_ulong riscv_load_firmware(const char *firmware_filename, - hwaddr firmware_load_addr); + hwaddr firmware_load_addr, + symbol_fn_t sym_cb); target_ulong riscv_load_kernel(const char *kernel_filename, symbol_fn_t sym_cb); hwaddr riscv_load_initrd(const char *filename, uint64_t mem_size, From patchwork Fri Feb 14 07:21:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 11381811 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C5C0C1820 for ; Fri, 14 Feb 2020 07:22:57 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9C0DC2187F for ; Fri, 14 Feb 2020 07:22:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="HyElCl4d"; dkim=pass (1024-bit key) header.d=sharedspace.onmicrosoft.com header.i=@sharedspace.onmicrosoft.com header.b="CYKCmXMH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9C0DC2187F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:35608 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2VJQ-0003SA-Sg for patchwork-qemu-devel@patchwork.kernel.org; Fri, 14 Feb 2020 02:22:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52146) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2VIl-00029q-Mm for qemu-devel@nongnu.org; Fri, 14 Feb 2020 02:22:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2VIk-0004DP-Kj for qemu-devel@nongnu.org; Fri, 14 Feb 2020 02:22:15 -0500 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:14555) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j2VIh-00044h-6f; Fri, 14 Feb 2020 02:22:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1581664931; x=1613200931; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=YjCTXHezOVLFDooZkPJzdfDny5vRw/HCQyAxyBXHGEY=; b=HyElCl4dZmDWTT00HOYRnDpFs5cDpf/cFqFxqV4eFHbSmEsnC59/UmDr ZlLKuyqP3l4PXiYhVizKQf9X22x8I78cdioNi4u2aNHqujquBAFI7p61x OIz5ZJNn7H9K9T8DlHcyze5ZhPc0U3aYI4ay4rkEZDrcrXiD7YQ2hxs3w ROz/lybZquPj3pOu9qy5HQHM3t94ppEPovR+/sSR0Phvj5ZQ1oLyBDR0+ Kg2KEEFndk2iFECtn/adS8yWBQj8RMnPSuT4WAB9AVkVtxGfs5SL4ydYW ZWFM5rSobQqaYMGoqdoW+21njt64kng58zv4qL3pd+kEfIWl1eqcxIJg2 Q==; IronPort-SDR: LelLP4ixCVHoehVOnoDLYHjs4vaKd7qw/8CwtP3wZEOTy9dP8rM8zCmxjTLzOgdLPcAv0gS0Lo OgQ6Lsr8UtKBeqPb9KfZTHBEeyM7IfXrcZYa/n1NUBwS1IVbzjOy6mNnXXrEXfnWrbOZSo3V4x UC7N5Wfr2ERcWpxthfMFeadgQGJtH8vFck/BP4RtE8g2+uFJaHqDn7BFf0gH34U2CdtI4dlxUt 6MStGSQYDV9it2jIDKd7zz9Yig4ypQ/XAVvrnaKmxPhm06XdP8DvMsfuRSnb9a7KZ5Ss1giKo3 kvg= X-IronPort-AV: E=Sophos;i="5.70,439,1574092800"; d="scan'208";a="134205083" Received: from mail-dm6nam12lp2177.outbound.protection.outlook.com (HELO NAM12-DM6-obe.outbound.protection.outlook.com) ([104.47.59.177]) by ob1.hgst.iphmx.com with ESMTP; 14 Feb 2020 15:22:09 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PgwKwBEMzz6GxFjgWM2ME1hJdctio0pLbarwTbp3XZlTNzAjXvI1AkKLqY30GDWUI6FnAtuayRI4riWFD9VoAxbR5d5FJ2JDaml/4Depr5HqaZ98KqbcEYW8sugTfywWHYUJrfVZuIF15idj0cDIrLzxsjPVbwI5D7VCUxfETMwGmk91rpmWSwDVfEYQnbQljWgiOycIlmJn2fVwNFrHAmgR2KUkNH9+1sjmTdO8uhgg7+XpeNBBu6Fll9g1lzyDqqzZrv00LslpYDarxd/XedbdcWyl/A5m9LERwCQoKEQ/CcGpR+TO+Ixgm+f+AgyYyzSxTKze3ZY5zjJuJczYGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8KldUSXrRbZP7oM7jgWvNMHmehtZ98ROrsNtNL+l25s=; b=NOLhkS3q9grSDTKbbQD88oK4Q2AvunxaaZ77EK5t9tI7DCoONwMOLVBhJIPUj3i0XpWer9+klnSZ+S4jDwIprS0qUusnDG5OWmkxWP7bDQnqktbqsrgwY8uU1gOJPde0zZpA+Aq5oGg0RZSLM6X4gBIlp+08qU3tpdKbJttIOifwj3WwbyWwMvRgsCtiqbh+llNQbXuTBrwt+NZ015aCP1GdegkJ07GsXHHk6t4267nuYaS0W8BkWTkXcvlq659MD7YdNd6qUXQ3TES4Dd/ZZMOtxyOmaW56mC7m9MNbWt7jNXTXXt0n8qTRFL7Lg0NL0M5vaj2HjPzxla7Vy6Qxjw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wdc.com; dmarc=pass action=none header.from=wdc.com; dkim=pass header.d=wdc.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector2-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8KldUSXrRbZP7oM7jgWvNMHmehtZ98ROrsNtNL+l25s=; b=CYKCmXMH62dTP3/gyBHbaG+vS/RIblbCIkEA/uCNgmT+0BVTuncq2/gzUZGjBMPsiJDs0aePASAIx/g2teR0PHx9vhjt9fKBR5m8E3JO1VIkWiEYI9NN7Eo3H3BSDwdfYcissmu0JlonLoqtD1oNpKR72TxTq3afkJXK3o1ncs4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Anup.Patel@wdc.com; Received: from MN2PR04MB6061.namprd04.prod.outlook.com (20.178.246.15) by MN2PR04MB6288.namprd04.prod.outlook.com (52.132.169.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.23; Fri, 14 Feb 2020 07:22:07 +0000 Received: from MN2PR04MB6061.namprd04.prod.outlook.com ([fe80::a9a0:3ffa:371f:ad89]) by MN2PR04MB6061.namprd04.prod.outlook.com ([fe80::a9a0:3ffa:371f:ad89%7]) with mapi id 15.20.2729.025; Fri, 14 Feb 2020 07:22:07 +0000 From: Anup Patel To: Peter Maydell , Palmer Dabbelt , Alistair Francis , Sagar Karandikar Subject: [PATCH 2/3] hw/riscv/spike: Allow loading firmware separately using -bios option Date: Fri, 14 Feb 2020 12:51:26 +0530 Message-Id: <20200214072127.64330-3-anup.patel@wdc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200214072127.64330-1-anup.patel@wdc.com> References: <20200214072127.64330-1-anup.patel@wdc.com> X-ClientProxiedBy: MA1PR0101CA0015.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::25) To MN2PR04MB6061.namprd04.prod.outlook.com (2603:10b6:208:d8::15) MIME-Version: 1.0 Received: from wdc.com (106.51.31.230) by MA1PR0101CA0015.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.23 via Frontend Transport; Fri, 14 Feb 2020 07:22:03 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [106.51.31.230] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: d843a3b1-541f-4c26-f6e1-08d7b11e991d X-MS-TrafficTypeDiagnostic: MN2PR04MB6288: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: WDCIPOUTBOUND: EOP-TRUE X-MS-Oob-TLC-OOBClassifiers: OLM:93; X-Forefront-PRVS: 03137AC81E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(346002)(376002)(39860400002)(366004)(396003)(199004)(189003)(110136005)(478600001)(54906003)(316002)(52116002)(1076003)(7696005)(66946007)(36756003)(16526019)(8676002)(4326008)(81156014)(1006002)(44832011)(55236004)(8886007)(2906002)(956004)(26005)(66556008)(66476007)(8936002)(2616005)(5660300002)(86362001)(186003)(55016002)(81166006)(6666004)(32040200004); DIR:OUT; SFP:1102; SCL:1; SRVR:MN2PR04MB6288; H:MN2PR04MB6061.namprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: atlXZihIX+ZMZOJiM1uTDsuYXpyY07OEhqR7i6uJEDM4bA3z/VN1rktheNbqFHwgzdWLkNuApbX1K77aCeabd8XkbEby52YJs+WjouusNMn1A2omm9tb6gk6yb8m234Sp7mUiQt07lpswtZPrmuPkU2L86Xo9LK/m/CyJ4eLYkLrcHp/m1or7LhsJSVvfL4TyWBofaHSzm0J92pGjW05KdaXkp1oKcCu3YNzTXbbYBJto8oBbAMzyRcVFbfxvu0HmsxkSGfxNcj+Ycoat3yMpqRVuoqRZhy03wNDQR9LhTtWt47/rOzn2gSSDyUhT5k7mbGVxIdGfBTVhWHZdjCWOCqwnJRR/76uD4XUhzrqu5o0US4GB0FPUmk0r5onLL9m97bPvSD8vECq5/2lVD+xM8G5fzaeIEv1bkq72QEdqmOyAvEpDzZnolRH0UyjjlOFSj4H76WRxtVSlAxH1k4VXLvcjkeB0S5CtxLHqBZ4AsVFmlPwcZtzx1tSFQN4L/nY X-MS-Exchange-AntiSpam-MessageData: 0Nlaqx+kRGeyllYgxxTOkSWOuCpw29JaHWFweN5P0HVD94cUchNMbe9NkuBgIm7pPURkLATDUCMqb4UUTiXVpTWsmBMw1W4KG7uvB5uf6DVAWxAtBoIo3ZFd9lHcUMRozshUuzWybpif4Lf3bHKCkw== X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: d843a3b1-541f-4c26-f6e1-08d7b11e991d X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Feb 2020 07:22:07.5975 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: DRnj1e60Lh6Q3t7yr8tTeCkYpsJMGQ8zv9DQMcV/rpT3A9T8nO7t1r4fN2vZJhDzKq9pRD4Gq8jx9cu0tiotVQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR04MB6288 X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 216.71.153.141 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Atish Patra , Anup Patel , qemu-riscv@nongnu.org, qemu-devel@nongnu.org, Anup Patel Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" This patch extends Spike machine support to allow loading OpenSBI firmware (fw_jump.elf) separately using -bios option. Signed-off-by: Anup Patel Reviewed-by: Alistair Francis --- hw/riscv/spike.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/hw/riscv/spike.c b/hw/riscv/spike.c index 8823681783..060a86f922 100644 --- a/hw/riscv/spike.c +++ b/hw/riscv/spike.c @@ -45,6 +45,12 @@ #include +#if defined(TARGET_RISCV32) +# define BIOS_FILENAME "opensbi-riscv32-spike-fw_jump.elf" +#else +# define BIOS_FILENAME "opensbi-riscv64-spike-fw_jump.elf" +#endif + static const struct MemmapEntry { hwaddr base; hwaddr size; @@ -183,8 +189,24 @@ static void spike_board_init(MachineState *machine) memory_region_add_subregion(system_memory, memmap[SPIKE_MROM].base, mask_rom); + riscv_find_and_load_firmware(machine, BIOS_FILENAME, + memmap[SPIKE_DRAM].base, + htif_symbol_callback); + if (machine->kernel_filename) { - riscv_load_kernel(machine->kernel_filename, htif_symbol_callback); + uint64_t kernel_entry = riscv_load_kernel(machine->kernel_filename, + htif_symbol_callback); + + if (machine->initrd_filename) { + hwaddr start; + hwaddr end = riscv_load_initrd(machine->initrd_filename, + machine->ram_size, kernel_entry, + &start); + qemu_fdt_setprop_cell(s->fdt, "/chosen", + "linux,initrd-start", start); + qemu_fdt_setprop_cell(s->fdt, "/chosen", "linux,initrd-end", + end); + } } /* reset vector */ From patchwork Fri Feb 14 07:21:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 11381817 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8B042139A for ; Fri, 14 Feb 2020 07:24:24 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 616312187F for ; Fri, 14 Feb 2020 07:24:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="SUiR3V6d"; dkim=pass (1024-bit key) header.d=sharedspace.onmicrosoft.com header.i=@sharedspace.onmicrosoft.com header.b="hwiPLnY8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 616312187F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:35634 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2VKp-0005AR-DY for patchwork-qemu-devel@patchwork.kernel.org; Fri, 14 Feb 2020 02:24:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52187) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2VIp-0002GY-Hw for qemu-devel@nongnu.org; Fri, 14 Feb 2020 02:22:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2VIo-0004Id-Iy for qemu-devel@nongnu.org; Fri, 14 Feb 2020 02:22:19 -0500 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:45300) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j2VIm-0004FI-6a; Fri, 14 Feb 2020 02:22:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1581664937; x=1613200937; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=b0pmzSsDhT7gX+NebTupjIXf2AnJNhohnxsqzoXtTic=; b=SUiR3V6dmEdz1rI1ttqRodiYMS9gTokwe2mYcuJ8LekVP9HlA8Oh5owY z25AIDImsy5qPaeAD4KHbelP+dgzLtKUsznATpD7Bov0TjBSIa+cCJmI8 xR9GcusyFGe7MjaEPlP2vOYAQLBVx5ZedMM4BMQull6l3HDxLVn/7SYJd ps87Uxwnzha8lPAY9fGlkui7BxCJ6bRVdsve92uzZ0JYyU67/XpCK6lFR WBAtyh5v7w/8veFWP66I0CVgaET9eL1vJcR2q30fVsZm4q7MpJ7Wne2wK +DDeOo2ycat+ERKCrLG/WW6JjW+tgiLQcxktRU1NYoa9yujTcfaZ65YNc w==; IronPort-SDR: AZ7M/Xw6vQHEBRWqXJXTft3xPWPzPcrwHhWWMC4cafaIbIK1dBafaCPsXwAMMEZ6UJxIa037Gn sQts9f2O48JN8SPf/yfunLngjxdLkmCcudy9+bsw468MbB0Fy3VW7qdjPCiWFtU5/aEbqcFduI Sd2SAt7qREPbqHOBTGukgZij09UH2nPyN2V2GpljeljMhUfZcP5uLEHguVS/6i/VwVRP79bXIc RwhIGLPT5fGzVbpGW9A6TUTlPKeEkpy2LVI5+XNECFWipq3Dgkgen800FjPSzvzuA+fgmwhLE5 Kuo= X-IronPort-AV: E=Sophos;i="5.70,439,1574092800"; d="scan'208";a="131289875" Received: from mail-dm6nam12lp2170.outbound.protection.outlook.com (HELO NAM12-DM6-obe.outbound.protection.outlook.com) ([104.47.59.170]) by ob1.hgst.iphmx.com with ESMTP; 14 Feb 2020 15:22:15 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=POEGboh7xZSgJpgfDNxNI6tIRm+YAwoPDGcvfdLyyIqlhCOdgkLKyhA2to7CG3YMp29G5JC+q6JcZEj4Mv1b6tySZoxgj6sZgfZqeK0J2f7u2GRIZRT5lCTrGFsz3y+2SYzM5Q8epVwgOQxOTx1AySHqYRM86Om0fBGJU/FZ6RkE/mKM/EJK83kIIONIDcGsVVKQ/q4n/gjWz9GMZDsxn0UqAfPl1LWH3R7H/oT8+a3KNog926lNLQxvUtNqM359fbtGN3zbfh58hSQHUsE+8fHQAX6twB2YTBZaQk0/8pODbNheCBi9z+VgwrjXM5kdM+NLhKqqy6YDD5PfaXgHLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MGk173WuRUlWDVEV2Da9UJ3AE1WKlQ9G9E1ZfLWaCaE=; b=gk+4sP/LMJL++4hL0WKJsAGiWd+sh0hbTMKPwhgbmT9agOVWXPDHHLc3GV5FqJaWNiUrFfK3UQPi4hBLRjylWHS07FQ+5CcuNU7eGYNK8fgTBcFOWxhkHSaNqV8sqwNFVn2gVO/zcpmDgMzWIJ3En3cuCdDPZU9r99jA8EoP8fUo0FR/U5SBxtvnRmHjRE8ReU9spjTgwtB/cztOGJLkhtAv3GvlFGAj7K+y3RBx6vpvqQQESlHq2Xa5In8HDLc/Ri8oA0O6w52zsVPl6Y5udwVE7hm37hMKYxpjQPvovPBW4uDQ4TP/M4dc75UsTR6y2LrVZ3YEPlbT+9vlUG5GhA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wdc.com; dmarc=pass action=none header.from=wdc.com; dkim=pass header.d=wdc.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector2-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MGk173WuRUlWDVEV2Da9UJ3AE1WKlQ9G9E1ZfLWaCaE=; b=hwiPLnY87ZsagIcJg7v7ImXaFQBApHi/4JGljoYOR2WsrCpgJ0FCA/wSwQnjekcAqCKdf05lERduFYR7sP7NlgVDA6sYWDhHi3cwl+LtNsRiaLhuoyU13N5utAo3CO09P54kB5ZMGAjdzWR8U7kqccqj10a6aGPxO/P7MndmMLg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Anup.Patel@wdc.com; Received: from MN2PR04MB6061.namprd04.prod.outlook.com (20.178.246.15) by MN2PR04MB6288.namprd04.prod.outlook.com (52.132.169.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.23; Fri, 14 Feb 2020 07:22:13 +0000 Received: from MN2PR04MB6061.namprd04.prod.outlook.com ([fe80::a9a0:3ffa:371f:ad89]) by MN2PR04MB6061.namprd04.prod.outlook.com ([fe80::a9a0:3ffa:371f:ad89%7]) with mapi id 15.20.2729.025; Fri, 14 Feb 2020 07:22:13 +0000 From: Anup Patel To: Peter Maydell , Palmer Dabbelt , Alistair Francis , Sagar Karandikar Subject: [PATCH 3/3] hw/riscv/spike: Allow more than one CPUs Date: Fri, 14 Feb 2020 12:51:27 +0530 Message-Id: <20200214072127.64330-4-anup.patel@wdc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200214072127.64330-1-anup.patel@wdc.com> References: <20200214072127.64330-1-anup.patel@wdc.com> X-ClientProxiedBy: MA1PR0101CA0015.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::25) To MN2PR04MB6061.namprd04.prod.outlook.com (2603:10b6:208:d8::15) MIME-Version: 1.0 Received: from wdc.com (106.51.31.230) by MA1PR0101CA0015.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.23 via Frontend Transport; Fri, 14 Feb 2020 07:22:09 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [106.51.31.230] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 3b45c916-a3da-4008-2378-08d7b11e9c72 X-MS-TrafficTypeDiagnostic: MN2PR04MB6288: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: WDCIPOUTBOUND: EOP-TRUE X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-Forefront-PRVS: 03137AC81E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(346002)(376002)(39860400002)(366004)(396003)(199004)(189003)(110136005)(478600001)(54906003)(316002)(52116002)(1076003)(7696005)(66946007)(36756003)(16526019)(8676002)(4326008)(4744005)(81156014)(1006002)(44832011)(55236004)(8886007)(2906002)(956004)(26005)(66556008)(66476007)(8936002)(2616005)(5660300002)(86362001)(186003)(55016002)(81166006)(6666004)(32040200004); DIR:OUT; SFP:1102; SCL:1; SRVR:MN2PR04MB6288; H:MN2PR04MB6061.namprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: d2oVMRC2/mQGjO9IS/ZVeMb94q9zRQ0kNJnjOCqW1nkATIL22RlR36e4iS47nSQRV5hqtzyjMmtPBBBl2TbU4V7CYahhNxfmUcqvsEogG+fqfnCdm5/fr/zORWjbEGGpyK538jxlirwuUx/IzRwFS3Mw6+s7itz/Bh5Tr0ONpa7OPEmEFo8QrJ1GDyg06sw4irihG2F2r/F5+sjWtUB8wdK5txDPt53K+oX8iq2L+WnfvqFHeflr8Pew2Dj2055d6LIv3GQYqmpNKwtqIHo7pWOmsVx1SvJG+H1W+wU4GEzaS0Oac3IHKE9qGM99aGtiQOrdk85vIZQGBDBywaQyW1Jf+qk+hvQ/DXrdgFzzfrZ06dG9YUGUv80Ao2FAyd9+nfwun8io6Bs6vm41bOeJOUJ7HCZzDyiy66cjN+hMJOFbh6krz8ULd/TCeqeMYBywtow8WDG9c1R/IoCJa+tSyQPH5LNeACOWCa51HjIitc1iParHogEMg/W5f3yepU/9 X-MS-Exchange-AntiSpam-MessageData: ku/s4C4uI+7ezBZYSpud+MG+qGYll8jEIFmRvCrHU90cRRzu7nnKvfUIqhpY23yqCF42f7YHmxbof3gI6rHxm3fYGN+HqgF+IXjyFVtErOKEfaFR8TFH1PXHs5n/UAWA9LkRtS+INvxbPnOAnDtTmQ== X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3b45c916-a3da-4008-2378-08d7b11e9c72 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Feb 2020 07:22:13.2013 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: u3H93okejwB4ryZi+GLlLiywC/5mvB94U4CbaHcqkjVEIsXBX0jW0inCAa4ogxxYgSLJpJ/mLBCnTM0JF1n9jg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR04MB6288 X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 216.71.154.45 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Atish Patra , Anup Patel , qemu-riscv@nongnu.org, qemu-devel@nongnu.org, Anup Patel Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Currently, the upstream Spike ISA simulator allows more than one CPUs so we update QEMU Spike machine on similar lines to allow more than one CPUs. The maximum number of CPUs for QEMU Spike machine is kept same as QEMU Virt machine. Signed-off-by: Anup Patel Reviewed-by: Alistair Francis --- hw/riscv/spike.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/riscv/spike.c b/hw/riscv/spike.c index 060a86f922..1eac0d9a83 100644 --- a/hw/riscv/spike.c +++ b/hw/riscv/spike.c @@ -469,7 +469,7 @@ static void spike_machine_init(MachineClass *mc) { mc->desc = "RISC-V Spike Board"; mc->init = spike_board_init; - mc->max_cpus = 1; + mc->max_cpus = 8; mc->is_default = 1; mc->default_cpu_type = SPIKE_V1_10_0_CPU; }