From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B07FC19759 for ; Fri, 2 Aug 2019 01:26:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 39E662080C for ; Fri, 2 Aug 2019 01:26:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=crapouillou.net header.i=@crapouillou.net header.b="Wrb9nSrl" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730767AbfHBB0c (ORCPT ); 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 =