From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932720AbeARSzG (ORCPT ); Thu, 18 Jan 2018 13:55:06 -0500 Received: from us01smtprelay-2.synopsys.com ([198.182.60.111]:34841 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932089AbeARSzF (ORCPT ); Thu, 18 Jan 2018 13:55:05 -0500 Subject: Re: [PATCH] ARC: Add a knob to control usage of dual-issue To: Alexey Brodkin , "linux-snps-arc@lists.infradead.org" CC: "linux-kernel@vger.kernel.org" References: <20180118134831.41489-1-abrodkin@synopsys.com> From: Vineet Gupta Message-ID: <7d97edc0-d0ee-326b-bcd2-c6731aa953b2@synopsys.com> Date: Thu, 18 Jan 2018 10:54:56 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20180118134831.41489-1-abrodkin@synopsys.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [10.10.161.79] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/18/2018 05:48 AM, Alexey Brodkin wrote: > 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 But we need access to a debugger anyways to change this global variable. If you already have that won't it be better to change the aux register itself from the debugger itself. I don't really see how the global variable way of toggle adds any value here ? > > 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); >