Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp306892ybi; Thu, 1 Aug 2019 19:31:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqzEGs/Hq+dDL3XjrcsQWjp+LrnxtK3rY5CbCqharbi9KJXcWwZqqzzhUxlCPt8QuNWbI8dY X-Received: by 2002:a63:3009:: with SMTP id w9mr48906072pgw.260.1564713068004; Thu, 01 Aug 2019 19:31:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564713067; cv=none; d=google.com; s=arc-20160816; b=kwsaz5DMMm2wi2YkkH/m2HM009It6rIyqXrpnDR/HMkDNSadn8J4IAyy+We20Vg+hr hj5DxaKu7ZTxTnECBWuQg/nfwQzL0sO4CbRcKfeszMdj/W/tpDGJ6HJn9+jB/otnqMqt it+FG3UQlVqkcA9wZHqLLezubcyTak2Iv7Apb3jSTB3v03zOraA+HhyICuWDc1JvRl1n h8fQrQaRyvQitZqejSg6TEXh5uvFaAOtxfvVh7SgOqKkYtcFYVjQAn9FlVkl84LERJdl 37oPW7/YdGeWh/A/W9haDe8RRHSacd9Z3C8SkeaL6wTFras5Pp2dTd8qGaE4dYjAso/V 1e9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:cc:to:subject:from:date :dkim-signature; bh=Tqs00IvwAUuNG1/o0XrrcExWnhM0hU9Bm1hUk2AUxSA=; b=WkVW268gb7HMng0A7ojLo8wtgDjM9Feu9iCkDWuQ1zXHDVewSnS7vnWT12OpUnPvPY nfalSSY8B4FFv6e+eo4sdxH1PUdllrBepy/kJUNrVzrIQ8p5zmJLnm6/VwEZ3BM2MFws NI0WkZnnHIkGm69DOyih42yvhPfoQMsAF4GuqKnBpF5qsLIjkkSB6mjAuZwfV1A5lTtm epUJ9d9mTcRYw9Rg+COip3at3RO6PSNV1TuN2zJDpUBZ0P7FsMI0v+ovjlOUIjbchkU1 A0z9WYyd9fSTG9vGArBItyvsLQiBf4wDfeTWtP0eluKIpU3iGnpeD39mBpfsWmReo2oa EK2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@crapouillou.net header.s=mail header.b=Wrb9nSrl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v20si5540122pjn.27.2019.08.01.19.30.52; Thu, 01 Aug 2019 19:31:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@crapouillou.net header.s=mail header.b=Wrb9nSrl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730691AbfHBB0c (ORCPT + 99 others); Thu, 1 Aug 2019 21:26:32 -0400 Received: from outils.crapouillou.net ([89.234.176.41]:42148 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727848AbfHBB0b (ORCPT ); Thu, 1 Aug 2019 21:26:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1564709188; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Tqs00IvwAUuNG1/o0XrrcExWnhM0hU9Bm1hUk2AUxSA=; b=Wrb9nSrl5dCse4Akk5HN5AhTvb8TejEDjIfYHy/A+ME5YeItHVZNcqraivenbMwCinNgij GLMIJK0sK0IRtBZBpoEoln2HUJyiQvXNf9ID5e1/k1Q3oVA6sPlfrsSii4ZEqO3E5zRAw6 CKlgxnAEYm/yQ2dphvfG13atXS4xh+A= Date: Thu, 01 Aug 2019 21:26:09 -0400 From: Paul Cercueil Subject: Re: [PATCH 2/2 v3] MIPS: Ingenic: Fix bugs when calculate bogomips/lpj. To: Zhou Yanjie Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, ralf@linux-mips.org, paul.burton@mips.com, jhogan@kernel.org, malat@debian.org, gregkh@linuxfoundation.org, tglx@linutronix.de, allison@lohutok.net, syq@debian.org, chenhc@lemote.com, jiaxun.yang@flygoat.com Message-Id: <1564709169.1988.0@crapouillou.net> In-Reply-To: <1564661791-47731-3-git-send-email-zhouyanjie@zoho.com> References: <1564498510-3751-1-git-send-email-zhouyanjie@zoho.com> <1564661791-47731-1-git-send-email-zhouyanjie@zoho.com> <1564661791-47731-3-git-send-email-zhouyanjie@zoho.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Zhou, Le jeu. 1 ao=FBt 2019 =E0 8:16, Zhou Yanjie a=20 =E9crit : > Enable BTB lookups for short loops to fix bugs when calculate > bogomips and loops_per_jiffy. The commit description and the code comment below seem to say two different things. Are we enabling the BTB lookup optimization, or not? Also, maybe change the commit title to something more meaningful, e.g. "MIPS: ingenic: Disable broken BTB lookup optimization" or similar. > Signed-off-by: Zhou Yanjie > --- > arch/mips/include/asm/mipsregs.h | 4 ++++ > arch/mips/kernel/cpu-probe.c | 7 +++++++ > 2 files changed, 11 insertions(+) >=20 > diff --git a/arch/mips/include/asm/mipsregs.h=20 > b/arch/mips/include/asm/mipsregs.h > index 1e6966e..bdbdc19 100644 > --- a/arch/mips/include/asm/mipsregs.h > +++ b/arch/mips/include/asm/mipsregs.h > @@ -689,6 +689,9 @@ > #define MIPS_CONF7_IAR (_ULCAST_(1) << 10) > #define MIPS_CONF7_AR (_ULCAST_(1) << 16) >=20 > +/* Ingenic Config7 bits */ > +#define MIPS_CONF7_BTB_LOOP_EN (_ULCAST_(1) << 4) > + > /* Config7 Bits specific to MIPS Technologies. */ >=20 > /* Performance counters implemented Per TC */ > @@ -2813,6 +2816,7 @@ __BUILD_SET_C0(status) > __BUILD_SET_C0(cause) > __BUILD_SET_C0(config) > __BUILD_SET_C0(config5) > +__BUILD_SET_C0(config7) > __BUILD_SET_C0(intcontrol) > __BUILD_SET_C0(intctl) > __BUILD_SET_C0(srsmap) > diff --git a/arch/mips/kernel/cpu-probe.c=20 > b/arch/mips/kernel/cpu-probe.c > index eb527a1..2bdd3e1 100644 > --- a/arch/mips/kernel/cpu-probe.c > +++ b/arch/mips/kernel/cpu-probe.c > @@ -1964,6 +1964,13 @@ static inline void cpu_probe_ingenic(struct=20 > cpuinfo_mips *c, unsigned int cpu) > c->cputype =3D CPU_XBURST; > c->writecombine =3D _CACHE_UNCACHED_ACCELERATED; > __cpu_name[cpu] =3D "Ingenic XBurst"; > + /* > + * The XBurst core by default attempts to avoid branch target > + * buffer lookups by detecting & special casing loops. This > + * feature will cause BogoMIPS and lpj calculate in error. > + * Set cp0 config7 bit 4 to disable this feature. > + */ > + set_c0_config7(MIPS_CONF7_BTB_LOOP_EN); Shouldn't it be MIPS_CONF7_BTB_LOOP_DIS then? Since the feature is disabled when the bit is set. > break; > default: > panic("Unknown Ingenic Processor ID!"); > -- > 2.7.4 >=20 >=20 =