From: "Jiaxun Yang" <jiaxun.yang@flygoat.com>
To: "Maciej W. Rozycki" <macro@orcam.me.uk>
Cc: "Thomas Bogendoerfer" <tsbogend@alpha.franken.de>,
"linux-mips@vger.kernel.org" <linux-mips@vger.kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] MIPS: mm: tlb-r4k: Uniquify TLB entries on init
Date: Sat, 07 Jun 2025 11:36:52 +0100 [thread overview]
Message-ID: <40ff6065-2f2b-4a07-b247-02e11fd46eb8@app.fastmail.com> (raw)
In-Reply-To: <alpine.DEB.2.21.2506070300430.1790@angie.orcam.me.uk>
在2025年6月7日周六 上午3:48,Maciej W. Rozycki写道:
> On Thu, 5 Jun 2025, Jiaxun Yang wrote:
>
>> +static unsigned long r4k_safe_entryhi(void)
>> +{
>> + int entry = current_cpu_data.tlbsize;
>> + int old_index;
>> +
>> + old_index = read_c0_index();
>> + while (entry >= 0) {
> [...]
>> + entry++;
>> + }
>
> Hmm, how is it supposed to work: you start from say 48 and then iterate
> until 0x80000000 before giving up? Also a signed overflow condition is UB
> pre-C23, so the compiler may well optimise the loop control away.
Ah sorry I didn't realise it's a UB. However, this loop is likely to be
terminated very early as it should be fairly easily to find a free EntryHi
value with TLBP.
>
> How did you verify this code?
Boot tested on Boston as well as M5150 simulation. I tried to manually setup a
TLB entry collision situation with Boot-MIPS.
>
> Maciej
Thanks
--
- Jiaxun
prev parent reply other threads:[~2025-06-07 10:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-05 10:02 Jiaxun Yang
2025-06-06 13:30 ` Jiaxun Yang
2025-06-07 2:48 ` Maciej W. Rozycki
2025-06-07 10:36 ` Jiaxun Yang [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=40ff6065-2f2b-4a07-b247-02e11fd46eb8@app.fastmail.com \
--to=jiaxun.yang@flygoat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=macro@orcam.me.uk \
--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®