mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] MIPS: ingenic: Let Config.VI tell whether the icache is virtual
@ 2026-11-11  4:09 Hunter Laux via B4 Relay
  2026-11-11 16:23 ` Paul Cercueil
  2026-11-11 17:00 ` H. Nikolaus Schaller
  0 siblings, 2 replies; 5+ messages in thread
From: Hunter Laux via B4 Relay @ 2026-11-11  4:09 UTC (permalink / raw)
  To: Paul Cercueil, Thomas Bogendoerfer
  Cc: linux-mips, linux-kernel, Lars-Peter Clausen, Hunter Laux

From: Hunter Laux <hunterlaux@gmail.com>

The Ingenic CPU support treats every XBurst instruction cache as
virtually tagged: the feature overrides fix cpu_has_vtag_icache to 1,
and the probe sets MIPS_CACHE_VTAG. The setting came in with the JZ4740
feature overrides in commit 83ccf69d8f11 ("MIPS: JZ4740: Add base
support for Ingenic JZ4740 System-on-a-Chip") without a stated reason,
and Ingenic's own kernels treat the icache as physically tagged.

Neither XBurst1 nor XBurst II has a virtually tagged icache. Both
programming manuals describe a physically tagged one and hardwire
Config.VI to 0, which the cache probe already reads. On the X2600, code
at a virtual address remapped to another page through the TLB alone
runs the new page, while the old line is still in the icache. XBurst1
has not been tested. Treating the icache as virtually tagged is
incorrect and costs needless icache flushes.

Drop both and leave it to Config.VI.

Cc: Lars-Peter Clausen <lars@metafoo.de>
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Hunter Laux <hunterlaux@gmail.com>
---
Lars, the override came with your JZ4740 support in 2010. On the off
chance you remember a reason for setting cpu_has_vtag_icache to 1,
I'd like to hear it.
---
 arch/mips/include/asm/mach-ingenic/cpu-feature-overrides.h | 1 -
 arch/mips/kernel/cpu-probe.c                               | 3 ---
 2 files changed, 4 deletions(-)

diff --git a/arch/mips/include/asm/mach-ingenic/cpu-feature-overrides.h b/arch/mips/include/asm/mach-ingenic/cpu-feature-overrides.h
index 7ace50127f..71c03f1dd4 100644
--- a/arch/mips/include/asm/mach-ingenic/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-ingenic/cpu-feature-overrides.h
@@ -27,7 +27,6 @@
 #define cpu_has_mips3d 0
 #define cpu_has_smartmips 0
 #define kernel_uses_llsc	1
-#define cpu_has_vtag_icache	1
 #define cpu_has_dc_aliases	0
 #define cpu_has_ic_fills_f_dc	0
 #define cpu_has_pindexed_dcache 0
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index 489612ed9d..bef92e6cd6 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -1763,9 +1763,6 @@ static inline void cpu_probe_ingenic(struct cpuinfo_mips *c, unsigned int cpu)
 	c->options &= ~MIPS_CPU_COUNTER;
 	BUG_ON(__builtin_constant_p(cpu_has_counter) && cpu_has_counter);
 
-	/* XBurst has virtually tagged icache */
-	c->icache.flags |= MIPS_CACHE_VTAG;
-
 	switch (c->processor_id & PRID_IMP_MASK) {
 
 	/* XBurst®1 with MXU1.0/MXU1.1 SIMD ISA */

---
base-commit: b3dfbde62cf1981c4638939c159dfd087b7a72e9
change-id: 20261110-mips-xburst-icache-vi-db10a8d03dd6

Best regards,
-- 
Hunter Laux <hunterlaux@gmail.com>



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

end of thread, other threads:[~2026-11-11 19:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-11  4:09 [PATCH] MIPS: ingenic: Let Config.VI tell whether the icache is virtual Hunter Laux via B4 Relay
2026-11-11 16:23 ` Paul Cercueil
2026-11-11 19:56   ` Hunter Laux
2026-11-11 17:00 ` H. Nikolaus Schaller
2026-11-11 19:56   ` Hunter Laux

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®