linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 4.19 01/33] MIPS: Ingenic: Disable broken BTB lookup optimization.
@ 2019-09-29 17:33 Sasha Levin
  2019-09-29 17:33 ` [PATCH AUTOSEL 4.19 02/33] clk: jz4740: Add TCU clock Sasha Levin
                   ` (31 more replies)
  0 siblings, 32 replies; 35+ messages in thread
From: Sasha Levin @ 2019-09-29 17:33 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Zhou Yanjie, Paul Burton, linux-mips, ralf, paul, jhogan, malat,
	gregkh, tglx, allison, syq, chenhc, jiaxun.yang, Sasha Levin

From: Zhou Yanjie <zhouyanjie@zoho.com>

[ Upstream commit 053951dda71ecb4b554a2cdbe26f5f6f9bee9dd2 ]

In order to further reduce power consumption, 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.

Signed-off-by: Zhou Yanjie <zhouyanjie@zoho.com>
Signed-off-by: Paul Burton <paul.burton@mips.com>
Cc: linux-mips@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: ralf@linux-mips.org
Cc: paul@crapouillou.net
Cc: jhogan@kernel.org
Cc: malat@debian.org
Cc: gregkh@linuxfoundation.org
Cc: tglx@linutronix.de
Cc: allison@lohutok.net
Cc: syq@debian.org
Cc: chenhc@lemote.com
Cc: jiaxun.yang@flygoat.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/mips/include/asm/mipsregs.h | 4 ++++
 arch/mips/kernel/cpu-probe.c     | 7 +++++++
 2 files changed, 11 insertions(+)

diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h
index 01df9ad62fb83..1bb9448777c5c 100644
--- a/arch/mips/include/asm/mipsregs.h
+++ b/arch/mips/include/asm/mipsregs.h
@@ -688,6 +688,9 @@
 #define MIPS_CONF7_IAR		(_ULCAST_(1) << 10)
 #define MIPS_CONF7_AR		(_ULCAST_(1) << 16)
 
+/* Ingenic Config7 bits */
+#define MIPS_CONF7_BTB_LOOP_EN	(_ULCAST_(1) << 4)
+
 /* Config7 Bits specific to MIPS Technologies. */
 
 /* Performance counters implemented Per TC */
@@ -2774,6 +2777,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 b/arch/mips/kernel/cpu-probe.c
index d535fc706a8b3..25cd8737e7fe0 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -1879,6 +1879,13 @@ static inline void cpu_probe_ingenic(struct cpuinfo_mips *c, unsigned int cpu)
 		c->cputype = CPU_JZRISC;
 		c->writecombine = _CACHE_UNCACHED_ACCELERATED;
 		__cpu_name[cpu] = "Ingenic JZRISC";
+		/*
+		 * 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);
 		break;
 	default:
 		panic("Unknown Ingenic Processor ID!");
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2019-10-05 23:01 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-29 17:33 [PATCH AUTOSEL 4.19 01/33] MIPS: Ingenic: Disable broken BTB lookup optimization Sasha Levin
2019-09-29 17:33 ` [PATCH AUTOSEL 4.19 02/33] clk: jz4740: Add TCU clock Sasha Levin
2019-09-29 17:33 ` [PATCH AUTOSEL 4.19 03/33] MIPS: tlbex: Explicitly cast _PAGE_NO_EXEC to a boolean Sasha Levin
2019-09-29 17:33 ` [PATCH AUTOSEL 4.19 04/33] i2c-cht-wc: Fix lockdep warning Sasha Levin
2019-09-29 17:33 ` [PATCH AUTOSEL 4.19 05/33] mfd: intel-lpss: Remove D3cold delay Sasha Levin
2019-09-29 17:33 ` [PATCH AUTOSEL 4.19 06/33] PCI: tegra: Fix OF node reference leak Sasha Levin
2019-09-29 17:33 ` [PATCH AUTOSEL 4.19 07/33] HID: wacom: Fix several minor compiler warnings Sasha Levin
2019-09-29 17:33 ` [PATCH AUTOSEL 4.19 08/33] livepatch: Nullify obj->mod in klp_module_coming()'s error path Sasha Levin
2019-09-29 17:33 ` [PATCH AUTOSEL 4.19 09/33] ARM: 8898/1: mm: Don't treat faults reported from cache maintenance as writes Sasha Levin
2019-09-29 17:33 ` [PATCH AUTOSEL 4.19 10/33] soundwire: intel: fix channel number reported by hardware Sasha Levin
2019-09-29 17:33 ` [PATCH AUTOSEL 4.19 11/33] ARM: 8875/1: Kconfig: default to AEABI w/ Clang Sasha Levin
2019-09-29 17:34 ` [PATCH AUTOSEL 4.19 12/33] MIPS: lantiq: update the clock alias' for the mainline PCIe PHY driver Sasha Levin
2019-09-29 17:40   ` Martin Blumenstingl
2019-10-05 23:01     ` Sasha Levin
2019-09-29 17:34 ` [PATCH AUTOSEL 4.19 13/33] firmware: bcm47xx_nvram: Correct size_t printf format Sasha Levin
2019-09-29 17:34 ` [PATCH AUTOSEL 4.19 14/33] rtc: snvs: fix possible race condition Sasha Levin
2019-09-29 17:34 ` [PATCH AUTOSEL 4.19 15/33] rtc: pcf85363/pcf85263: fix regmap error in set_time Sasha Levin
2019-09-29 17:34 ` [PATCH AUTOSEL 4.19 16/33] HID: apple: Fix stuck function keys when using FN Sasha Levin
2019-09-29 17:34 ` [PATCH AUTOSEL 4.19 17/33] PCI: rockchip: Propagate errors for optional regulators Sasha Levin
2019-09-29 17:34 ` [PATCH AUTOSEL 4.19 18/33] PCI: histb: " Sasha Levin
2019-09-29 17:34 ` [PATCH AUTOSEL 4.19 19/33] PCI: imx6: " Sasha Levin
2019-09-29 17:34 ` [PATCH AUTOSEL 4.19 20/33] PCI: exynos: Propagate errors for optional PHYs Sasha Levin
2019-09-29 17:34 ` [PATCH AUTOSEL 4.19 21/33] security: smack: Fix possible null-pointer dereferences in smack_socket_sock_rcv_skb() Sasha Levin
2019-09-29 17:34 ` [PATCH AUTOSEL 4.19 22/33] ARM: 8903/1: ensure that usable memory in bank 0 starts from a PMD-aligned address Sasha Levin
2019-09-29 17:34 ` [PATCH AUTOSEL 4.19 23/33] fat: work around race with userspace's read via blockdev while mounting Sasha Levin
2019-09-29 17:34 ` [PATCH AUTOSEL 4.19 24/33] pktcdvd: remove warning on attempting to register non-passthrough dev Sasha Levin
2019-09-29 17:34 ` [PATCH AUTOSEL 4.19 25/33] hypfs: Fix error number left in struct pointer member Sasha Levin
2019-09-29 17:34 ` [PATCH AUTOSEL 4.19 26/33] crypto: hisilicon - Fix double free in sec_free_hw_sgl() Sasha Levin
2019-09-29 17:34 ` [PATCH AUTOSEL 4.19 27/33] kbuild: clean compressed initramfs image Sasha Levin
2019-09-29 17:34 ` [PATCH AUTOSEL 4.19 28/33] ocfs2: wait for recovering done after direct unlock request Sasha Levin
2019-09-29 17:34 ` [PATCH AUTOSEL 4.19 29/33] kmemleak: increase DEBUG_KMEMLEAK_EARLY_LOG_SIZE default to 16K Sasha Levin
2019-09-29 17:34 ` [PATCH AUTOSEL 4.19 30/33] arm64: consider stack randomization for mmap base only when necessary Sasha Levin
2019-09-29 17:34 ` [PATCH AUTOSEL 4.19 31/33] mips: properly account for stack randomization and stack guard gap Sasha Levin
2019-09-29 17:34 ` [PATCH AUTOSEL 4.19 32/33] arm: " Sasha Levin
2019-09-29 17:34 ` [PATCH AUTOSEL 4.19 33/33] arm: use STACK_TOP when computing mmap base address Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).