From patchwork Sun Apr 30 23:14:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stafford Horne X-Patchwork-Id: 9706253 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 6B44F602CA for ; Sun, 30 Apr 2017 23:16:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5D68B23E64 for ; Sun, 30 Apr 2017 23:16:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 50ED425EA6; Sun, 30 Apr 2017 23:16:33 +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 B2F6123E64 for ; Sun, 30 Apr 2017 23:16:32 +0000 (UTC) Received: from localhost ([::1]:46174 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d4y4t-0001yk-Tn for patchwork-qemu-devel@patchwork.kernel.org; Sun, 30 Apr 2017 19:16:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60411) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d4y3U-0001vQ-6D for qemu-devel@nongnu.org; Sun, 30 Apr 2017 19:15:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d4y3T-0006XR-D1 for qemu-devel@nongnu.org; Sun, 30 Apr 2017 19:15:04 -0400 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]:34172) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d4y3T-0006Wv-7E for qemu-devel@nongnu.org; Sun, 30 Apr 2017 19:15:03 -0400 Received: by mail-pf0-x244.google.com with SMTP id g23so25781357pfj.1 for ; Sun, 30 Apr 2017 16:15:03 -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 :in-reply-to:references; bh=dkFGGmR2gcm5Xi/ekdDkUxK5HozEtZKrS7V8dnqBy5M=; b=gA75A40aoejN8RQefJsACddEJVxyXTEtvxb1HbtPf39/6iNWBBUewj9IhVLwOf1jhJ lOEImhK0t/wdgn6n6JCGjEZNiQtKUk5st3+NrylxXoZk39OF69dFMEFldQqd2rPGD1nW DHAdTpwKMObaezgQ5USPQaxy8aJ6JIvT+mlvyzbZ/Jsc78aXO8zLf5bFpuJ2PsY9fYlk VJ/qOdOcuRuG/NClJR+rshOjERVR2OvRvPHW6LFyDQdQd1OSynyadkJH6JtEylWqOHv9 faGfqUb4RIptCvmugquPxYrd2/ljHQ6+Xy6WkIDPQDcy/rtwtwPkt63x3/sjmibm0S7J 7I8w== 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:in-reply-to:references; bh=dkFGGmR2gcm5Xi/ekdDkUxK5HozEtZKrS7V8dnqBy5M=; b=K3IGNroRA/nRltWl0J2lUqACzNPMl+HM59vg3W8xOxfG87UjeXmYMfL8JTk0Gn7xxD 97dRYo5ZlJCUryv+99vlCSeCADlFpYQgb3lA1zAxIfzcUhpFwXElhggsnCOPcz7lqNR5 boLI0OAYP3lQnNKiRLNH9zibeaOuZIw/V3U5008r9kLgFDebsT4oM4+2DgfpD3F2Nd9I rLRS64FaVdIPCXjOwKsy5ggm5dPsrVEzTkPhVzs4VfftDRLWCDOUtVe2x6kEwjALrSUC FVXj0Noy3g+sO3P349K7Qmy33ti/LTJunBSKC1c+EK/4Zx1aY39ezsaFpm1phanldNB7 BXpQ== X-Gm-Message-State: AN3rC/7bac7vfj/XLA6en8mTh2mHIxG6q2PewlPQ7VYOtcQVQLcjlWEe 8PX1TiP/Uq6KFaym X-Received: by 10.99.100.129 with SMTP id y123mr23442851pgb.217.1493594102518; Sun, 30 Apr 2017 16:15:02 -0700 (PDT) Received: from localhost (z209.124-44-183.ppp.wakwak.ne.jp. [124.44.183.209]) by smtp.gmail.com with ESMTPSA id q6sm19185777pfq.18.2017.04.30.16.15.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 30 Apr 2017 16:15:02 -0700 (PDT) From: Stafford Horne To: peter.maydell@linaro.org Date: Mon, 1 May 2017 08:14:19 +0900 Message-Id: <4d3ebb3092f5ac66a58357cee15bd5432e77f2fe.1493593744.git.shorne@gmail.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::244 Subject: [Qemu-devel] [PULL 05/11] target/openrisc: add numcores and coreid support 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 , QEMU Development Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP These are used to identify the processor in SMP system. Their definition has been defined in verilog cores but it not yet part of the spec but it will be soon. The proposal for this is available: https://openrisc.io/proposals/core-identifier-and-number-of-cores Reviewed-by: Richard Henderson Signed-off-by: Stafford Horne --- target/openrisc/sys_helper.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/target/openrisc/sys_helper.c b/target/openrisc/sys_helper.c index 6ba8162..e13666b 100644 --- a/target/openrisc/sys_helper.c +++ b/target/openrisc/sys_helper.c @@ -233,6 +233,12 @@ target_ulong HELPER(mfspr)(CPUOpenRISCState *env, case TO_SPR(0, 64): /* ESR */ return env->esr; + case TO_SPR(0, 128): /* COREID */ + return 0; + + case TO_SPR(0, 129): /* NUMCORES */ + return 1; + case TO_SPR(1, 512) ... TO_SPR(1, 512+DTLB_SIZE-1): /* DTLBW0MR 0-127 */ idx = spr - TO_SPR(1, 512); return env->tlb->dtlb[0][idx].mr;