]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
MIPS: mm: tlb-r4k: Uniquify TLB entries on init
authorJiaxun Yang <jiaxun.yang@flygoat.com>
Sat, 7 Jun 2025 12:43:56 +0000 (13:43 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Aug 2025 10:14:13 +0000 (12:14 +0200)
commit1beca07bd954df3f3c727aa5e4ce0e992fce6dd2
tree29932501e62c44676096b9f3295810497595f79e
parent082a639b1c67b85393be050e8a74df4d064b4743
MIPS: mm: tlb-r4k: Uniquify TLB entries on init

commit 35ad7e181541aa5757f9f316768d3e64403ec843 upstream.

Hardware or bootloader will initialize TLB entries to any value, which
may collide with kernel's UNIQUE_ENTRYHI value. On MIPS microAptiv/M5150
family of cores this will trigger machine check exception and cause boot
failure. On M5150 simulation this could happen 7 times out of 1000 boots.

Replace local_flush_tlb_all() with r4k_tlb_uniquify() which probes each
TLB ENTRIHI unique value for collisions before it's written, and in case
of collision try a different ASID.

Cc: stable@kernel.org
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/mips/mm/tlb-r4k.c