]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
MIPS: mm: Suppress TLB uniquification on EHINV hardware
authorMaciej W. Rozycki <macro@orcam.me.uk>
Fri, 10 Apr 2026 00:52:58 +0000 (01:52 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 18 Apr 2026 08:35:56 +0000 (10:35 +0200)
commit 74283cfe216392c7b776ebf6045b5b15ed9dffcd upstream.

Hardware that supports the EHINV feature, mandatory for R6 ISA and FTLB
implementation, lets software mark TLB entries invalid, which eliminates
the need to ensure no duplicate matching entries are ever created.  This
feature is already used by local_flush_tlb_all(), via the UNIQUE_ENTRYHI
macro, making the preceding call to r4k_tlb_uniquify() superfluous.

The next change will also modify uniquification code such that it'll
become incompatible with the FTLB and MMID features, as well as MIPSr6
CPUs that do not implement 4KiB pages.

Therefore prevent r4k_tlb_uniquify() from being used on EHINV hardware,
as denoted by `cpu_has_tlbinv'.

Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/mips/mm/tlb-r4k.c

index d9631f3b6460d3dbf6ba590c2a60849d894b9b67..3669895a85bf2ef0d616b39662aed6187af1e052 100644 (file)
@@ -630,7 +630,8 @@ static void r4k_tlb_configure(void)
        temp_tlb_entry = current_cpu_data.tlbsize - 1;
 
        /* From this point on the ARC firmware is dead.  */
-       r4k_tlb_uniquify();
+       if (!cpu_has_tlbinv)
+               r4k_tlb_uniquify();
        local_flush_tlb_all();
 
        /* Did I tell you that ARC SUCKS?  */