From patchwork Sun Apr 23 22:40:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stafford Horne X-Patchwork-Id: 9695313 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 6B191601AE for ; Sun, 23 Apr 2017 22:45:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 733D226223 for ; Sun, 23 Apr 2017 22:45:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 63F6726530; Sun, 23 Apr 2017 22:45:05 +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 C1CE126223 for ; Sun, 23 Apr 2017 22:45:04 +0000 (UTC) Received: from localhost ([::1]:40838 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d2QFb-0002bC-U3 for patchwork-qemu-devel@patchwork.kernel.org; Sun, 23 Apr 2017 18:45:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55918) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d2QC5-0000Ui-IE for qemu-devel@nongnu.org; Sun, 23 Apr 2017 18:41:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d2QC4-0000Rf-Dk for qemu-devel@nongnu.org; Sun, 23 Apr 2017 18:41:25 -0400 Received: from mail-io0-x241.google.com ([2607:f8b0:4001:c06::241]:34999) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d2QC4-0000RO-91 for qemu-devel@nongnu.org; Sun, 23 Apr 2017 18:41:24 -0400 Received: by mail-io0-x241.google.com with SMTP id d203so43489179iof.2 for ; Sun, 23 Apr 2017 15:41:24 -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=EVOJ3u0nq3dSrv90f2dkOPo25aidjiLVI7bQ/JjNj/t1hzJF9gm3v0I4fZWBsjyKj1 bAdnPuvlxCLp7mhI8rGHzNNFnxcko0l0ER0BXWkLcrVpQxhbfVZU3JiczDUlYpiFPP9+ QjDH4AbMLydrThDsgumNdsSiKM/aiDy9ulZWAfVbxmo6tn/1cNuWw1bGMrODbVyS7uY6 DiKVEK+X0ASgD6peQZ9BwesKrPqb161Y1kPInngOl10m8tqoZ/QBR7ySdghdgnCJapp7 cpBVjNlwXsLXX64AvME43e1Bu7qC3xyP/31qoR1wZSbka6YTTbIkxBOWA1lxWRnWlmWI aAjA== 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=QfGhzX/WFh/5Oq96QAUPeRyOY9DRv6PTiY4pfKzNK3ici7oFRkrhp4BvMpqpeE6uPZ MocH9ETf5czvJMbH31jhdHsmaw/qFzVu3xL7nfaItaY2nXuNnpjjKMi0BVJih2jrfdzm MGgcqH4JERxSPyVtLKvTpRffhSh40vH1lkjTfUM8DmfKMCPcO6Yjxd7m9xIvjyEEI7sp zYtbKhV3CmGbXoT8yDfhrH54RGJnvON5n0qsXZq9osW/eE5dhbGDPGf4ljSFRz9ipgED ZkEloVmDCmkywx8fo3f4nk2bGVfkh4B7eM/3jm3wN0KzwQydZu6QHvnElwfxH19Kaw80 Ihcw== X-Gm-Message-State: AN3rC/4zWvFgMf9fxW4irEwZRGhTFGGBR4yO0N5ts7NxR0mWd98b6dRA MmIfqlIFHjiWHw== X-Received: by 10.98.217.80 with SMTP id s77mr22323840pfg.26.1492987283597; Sun, 23 Apr 2017 15:41:23 -0700 (PDT) Received: from localhost (z64.124-44-184.ppp.wakwak.ne.jp. [124.44.184.64]) by smtp.gmail.com with ESMTPSA id c7sm27089316pgn.24.2017.04.23.15.41.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 23 Apr 2017 15:41:23 -0700 (PDT) From: Stafford Horne To: QEMU Development Date: Mon, 24 Apr 2017 07:40:52 +0900 Message-Id: <4d3ebb3092f5ac66a58357cee15bd5432e77f2fe.1492986468.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:4001:c06::241 Subject: [Qemu-devel] [PATCH v2 4/9] 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 , Openrisc , "Tim \\'mithro\\' Ansell" 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;