From patchwork Thu Jan 18 13:48:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Brodkin X-Patchwork-Id: 862905 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="k0DscZXE"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zMlfp2yrJz9s7F for ; Fri, 19 Jan 2018 00:48:50 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=3Sp1S5Z2q39QHynKGxUht8JgTH7QxsE6gxrN1rTbUsw=; b=k0D scZXEyV/049bXY6fYGK+isgtDN4QFQ6k23BlIEfFtQMQZOLGJdv2zlDvAac71h9mIwMImfy+SSKTV xqAOcWersM7i69cuN0rYkX/UjmG/xRfvodcXIjNLb2Oo+eumxcA6CiKM3aWcDVHnmrFFcAy7pzhoy 9dsijKuqE2X8UZA9wghwlmd18XpKfeivFT9/1XgRaKnPF+1LvS9qzTuhp3HIHNe8QRQszeAC64xnS Xsmm8tkoE+TKQjItvdtgdmRufk3x4I3Fd1ddOrZgoGMWvHWFO01xQJUZZNsWoNaSkJtG76kbzImEi VVdebxYutBcyZZ+rr+Qf+Ejn52dIdYQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1ecAYi-0006YD-Pa; Thu, 18 Jan 2018 13:48:48 +0000 Received: from smtprelay4.synopsys.com ([198.182.47.9] helo=smtprelay.synopsys.com) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1ecAYg-0006Xm-HF for linux-snps-arc@lists.infradead.org; Thu, 18 Jan 2018 13:48:47 +0000 Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by smtprelay.synopsys.com (Postfix) with ESMTP id 1941D24E13DC; Thu, 18 Jan 2018 05:48:36 -0800 (PST) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 05339B96; Thu, 18 Jan 2018 05:48:36 -0800 (PST) Received: from ru20arcgnu1.internal.synopsys.com (ru20arcgnu1.internal.synopsys.com [10.121.9.48]) by mailhost.synopsys.com (Postfix) with ESMTP id CF6E9B8F; Thu, 18 Jan 2018 05:48:34 -0800 (PST) From: Alexey Brodkin To: linux-snps-arc@lists.infradead.org Subject: [PATCH] ARC: Add a knob to control usage of dual-issue Date: Thu, 18 Jan 2018 16:48:31 +0300 Message-Id: <20180118134831.41489-1-abrodkin@synopsys.com> X-Mailer: git-send-email 2.11.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [198.182.47.9 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [198.182.47.9 listed in list.dnswl.org] -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vineet Gupta , Alexey Brodkin , linux-kernel@vger.kernel.org MIME-Version: 1.0 Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org HS48 core starts with dual-issue enabled but in some cases like debugging as well as benchmarking it might be useful to disable dual-issue for a particular run. Note: 1. To disable dual-issue user has to change a value of a global variable in target's memory right before start of Linu kernel execution (most probably via JTAG) 2. Disabling happens very early on boot and to get it back enabled it's required to restart Linux kernel. I.e. with this change we don't allow toggling dual-issue state in random moments of run-time Signed-off-by: Alexey Brodkin --- arch/arc/kernel/setup.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c index 9d27331fe69a..cf97f7d88934 100644 --- a/arch/arc/kernel/setup.c +++ b/arch/arc/kernel/setup.c @@ -31,6 +31,8 @@ #define FIX_PTR(x) __asm__ __volatile__(";" : "+r"(x)) +int dual_issue_enable = 1; + unsigned int intr_to_DE_cnt; /* Part of U-boot ABI: see head.S */ @@ -198,6 +200,17 @@ static void read_arc_build_cfg_regs(void) if (cpu->core.family >= 0x54) { unsigned int exec_ctrl; + if (!dual_issue_enable) { + /* + * Note: + * 1) Reset value in AUX_EXEC_CTRL is 0 + * 2) Reverse logic is used, + * i.e. by default (AUX_EXEC_CTRL=0) + * dual-issue is enabled. + */ + write_aux_reg(AUX_EXEC_CTRL, 1); + } + READ_BCR(AUX_EXEC_CTRL, exec_ctrl); cpu->extn.dual_enb = !(exec_ctrl & 1);