mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Cercueil <paul@crapouillou.net>
To: hunterlaux@gmail.com, Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org,
	Lars-Peter Clausen <lars@metafoo.de>
Subject: Re: [PATCH] MIPS: ingenic: Let Config.VI tell whether the icache is virtual
Date: Wed, 11 Nov 2026 17:23:31 +0100	[thread overview]
Message-ID: <1a6aac61cb167ce0eea611afe73e8c87782edd43.camel@crapouillou.net> (raw)
In-Reply-To: <20261110-mips-xburst-icache-vi-v1-1-efba689606dd@gmail.com>

Hi Hunter,

Le mardi 10 novembre 2026 à 21:09 -0700, Hunter Laux via B4 Relay a écrit :
> 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>

The docs I have do say that both caches are "virtually indexed, physically
tagged". So the patch looks good.

If anything it's missing a Fixes: tag (with stable@vger.kernel.org in Cc).

> ---
> 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

Don't remove it, set it to 0.

Cheers,
-Paul

>  #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,

  reply	other threads:[~2026-11-11 16:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-11  4:09 Hunter Laux via B4 Relay
2026-11-11 16:23 ` Paul Cercueil [this message]
2026-11-11 19:56   ` Hunter Laux
2026-11-16  6:20     ` Maciej W. Rozycki
2026-11-11 17:00 ` H. Nikolaus Schaller
2026-11-11 19:56   ` Hunter Laux

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1a6aac61cb167ce0eea611afe73e8c87782edd43.camel@crapouillou.net \
    --to=paul@crapouillou.net \
    --cc=hunterlaux@gmail.com \
    --cc=lars@metafoo.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=tsbogend@alpha.franken.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®