From patchwork Fri Oct 20 22:05:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stafford Horne X-Patchwork-Id: 10021081 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 AE29A60211 for ; Fri, 20 Oct 2017 22:07:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A170028F6D for ; Fri, 20 Oct 2017 22:07:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9638528F70; Fri, 20 Oct 2017 22:07:24 +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=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 1E2B428F71 for ; Fri, 20 Oct 2017 22:07:24 +0000 (UTC) Received: from localhost ([::1]:55836 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5fRr-0001qu-AB for patchwork-qemu-devel@patchwork.kernel.org; Fri, 20 Oct 2017 18:07:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35339) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5fQP-0001pH-En for qemu-devel@nongnu.org; Fri, 20 Oct 2017 18:05:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5fQO-0003nT-LG for qemu-devel@nongnu.org; Fri, 20 Oct 2017 18:05:53 -0400 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]:54248) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e5fQO-0003nE-FF for qemu-devel@nongnu.org; Fri, 20 Oct 2017 18:05:52 -0400 Received: by mail-pf0-x243.google.com with SMTP id t188so12870027pfd.10 for ; Fri, 20 Oct 2017 15:05:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=KG+tV+UzuNzmkDQpoiqHccR0poq6UkPvs0EP8Zugk/A=; b=IZlit4Zo1M6K1tT7HD2vCEzo/WKIquLmcPNSreWnI6a3PInpwpNIP0dYoEJSf4pSj6 qXoS34/gLSBYG75nwHeEQAduKmeZrj/k1vSKsofGl3WYDUpKJxIS+lW0gTsHgMm+u8mc FDOdhxu180fRqOJbCz9kU+ZANyQ045yRnC42DjcN7HqwfTBM/o/3p4C3A2tzbqoNvgDE WiqMkc5ZbdWeylmu1w8qQ/6sUO9y5i3IzEEcH27e9PRDqBisGa79MvhuOMqDJRSGj06b xz9zIBDRrxvo/7H0Fj9rDYVQpbt+aLjSH20jPGNQ/1bfrDogSgji1rLfvaDpDKmpbqbd PaSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=KG+tV+UzuNzmkDQpoiqHccR0poq6UkPvs0EP8Zugk/A=; b=W1RTj8DWylFN8PdgFbscbw7OgXDcEeUjJpyRnHzY9oKYjrdPixplO++bqmL9r8mw9q CVQvA2D+nkiNj8anBRwVGx9oow4BkkmT1xrGAcwEusvXGHKuBOj9ejqCN2Bk7UXp3rVV 5/Xdwz4i54biLuLUCLlHDv2ZAQF3qLj2Lxop3iK5OF2G/Ms/jRdTMJ19LFl0MR4z55PG v31QNYm+I9au48FyUOCjSGuiETp/7eYUDA4pMxPp/XQT9Uz7kC4MEPCsT5wFNf2mIL/H Lh8EDF+4OYRz40DH6MNh35dSbwoRfJzgL+dCX+570H1pinls06+N4zMWVsoOrwyi5jJT aR/Q== X-Gm-Message-State: AMCzsaVye1p/0uzlOfGT523SH2jZsQ8ZOru5Xpe+qUFNe4ZAiibvaR+H 3ewlsibyafWLhQa83vE0tgI= X-Google-Smtp-Source: ABhQp+QPpw1doOC04x5BRCtno+SzWuPflhKoMTg3/uLRWHRjnGK/z58tp3bghcyPElVZBlizspk3UQ== X-Received: by 10.99.121.197 with SMTP id u188mr5774093pgc.416.1508537151600; Fri, 20 Oct 2017 15:05:51 -0700 (PDT) Received: from localhost (g183.61-45-92.ppp.wakwak.ne.jp. [61.45.92.183]) by smtp.gmail.com with ESMTPSA id z126sm3059368pfz.70.2017.10.20.15.05.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2017 15:05:51 -0700 (PDT) From: Stafford Horne To: Peter Maydell , QEMU Development Date: Sat, 21 Oct 2017 07:05:30 +0900 Message-Id: <20171020220533.29186-3-shorne@gmail.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171020220533.29186-1-shorne@gmail.com> References: <20171020220533.29186-1-shorne@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::243 Subject: [Qemu-devel] [PULL v2 2/5] target/openrisc: Make coreid and numcores variable 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: Stafford Horne Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Previously coreid and numcores were hard coded as 0 and 1 respectively as OpenRISC QEMU did not have multicore support. Multicore support is now being added so these registers need to have configured values. Reviewed-by: Richard Henderson Signed-off-by: Stafford Horne --- target/openrisc/sys_helper.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target/openrisc/sys_helper.c b/target/openrisc/sys_helper.c index abdef5d6a5..dc6e5cc7f2 100644 --- a/target/openrisc/sys_helper.c +++ b/target/openrisc/sys_helper.c @@ -23,6 +23,7 @@ #include "exec/exec-all.h" #include "exec/helper-proto.h" #include "exception.h" +#include "sysemu/sysemu.h" #define TO_SPR(group, number) (((group) << 11) + (number)) @@ -249,10 +250,10 @@ target_ulong HELPER(mfspr)(CPUOpenRISCState *env, return env->esr; case TO_SPR(0, 128): /* COREID */ - return 0; + return cpu->parent_obj.cpu_index; case TO_SPR(0, 129): /* NUMCORES */ - return 1; + return max_cpus; case TO_SPR(0, 1024) ... TO_SPR(0, 1024 + (16 * 32)): /* Shadow GPRs */ idx = (spr - 1024);