From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
To: Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: "Maciej W. Rozycki" <macro@orcam.me.uk>,
linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@kernel.org
Subject: Re: [PATCH v2] MIPS: mm: tlb-r4k: Uniquify TLB entries on init
Date: Wed, 16 Jul 2025 20:04:35 +0200 [thread overview]
Message-ID: <aHfpszi6l_YRSOjY@alpha.franken.de> (raw)
In-Reply-To: <20250607-tlb-fix-v2-1-6751eccd86f1@flygoat.com>
On Sat, Jun 07, 2025 at 01:43:56PM +0100, Jiaxun Yang wrote:
> 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>
> ---
> Changes in v2:
> - Cycle ASID instead of ENTRYHI index in case of collison.
> - Avoid int over flow UB (Maciej)
> - Link to v1: https://lore.kernel.org/r/20250605-tlb-fix-v1-1-4af496f17b2f@flygoat.com
> ---
> arch/mips/mm/tlb-r4k.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 55 insertions(+), 1 deletion(-)
applied to mips-next.
Thomas.
--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]
prev parent reply other threads:[~2025-07-16 18:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-07 12:43 [PATCH v2] MIPS: mm: tlb-r4k: Uniquify TLB entries on init Jiaxun Yang
2025-06-24 8:42 ` Jiaxun Yang
2025-07-16 18:04 ` Thomas Bogendoerfer [this message]
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=aHfpszi6l_YRSOjY@alpha.franken.de \
--to=tsbogend@alpha.franken.de \
--cc=jiaxun.yang@flygoat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=macro@orcam.me.uk \
--cc=stable@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.