From: Aurelien Jarno <aurelien@aurel32.net>
To: Vivian Wang <wangruikang@iscas.ac.cn>
Cc: Karl Mehltretter <kmehltretter@gmail.com>,
Andy Chiu <tchiu@tenstorrent.com>,
spacemit@lists.linux.dev, linux-riscv@lists.infradead.org
Subject: Re: Random corruption on SpacemiT K1 (and K3) with RVV
Date: Thu, 22 Oct 2026 18:53:41 +0200 [thread overview]
Message-ID: <ato_lUcnuZV30Mtj@aurel32.net> (raw)
In-Reply-To: <db540b00-a017-4c82-9a6c-93e862dcde67@iscas.ac.cn>
Hi,
Some small update on that. Sorry it takes time, it's just the bug
happens sporadically and I need a lot of testing to reach some
conclusion (and when I can't reproduce the bug, I am still not sure it
is not there).
On 2026-09-29 12:07, Vivian Wang wrote:
> On 9/28/26 12:32, Aurelien Jarno wrote:
> > Hi,
> >
> > On 2026-09-25 06:40, Aurelien Jarno wrote:
> >
> > [...]
> >
> > That said Han Gao pointed me to this patch:
> > https://lore.kernel.org/linux-riscv/20260807-vector_fpu_regs_status_rmw_fix-v1-1-0c16848b60db@intel.com/
> >
> > I have been testing it, and so far it seems to fix my issue with both
> > CONFIG_RISCV_ISA_V_PREEMPTIVE enable and disabled. Or maybe it just
> > hides the issue by changing the timing, as at this point, I haven't
> > fully understood how the bug fixed by this patch can completely explain
> > my observations.
>
> I don't know how that would cause what you have observed either, but it
> does superficially appears to fix a real bug.
>
> > Unfortunately, I have been able to reproduce the issue, even with this
> > patch applied. It just significantly reduces the frequency of the issue.
> >
> But this, I suppose, is still useful information that we just *might* be
> on the right track.
>
> Can you perhaps try this hacked together patch below and see if it does
> anything? I just put guard(preempt)() or something around a bunch of
> places I could find that access regs->status. It should apply to 7.1 and
> 7.2 as is. (The coding style is deliberately horrible to minimize diff
> lines and discourage others from shipping it)
>
> (This adds some more widely-scoped guards, and AFAICT /replaces/ the
> above linked patch from Guobin Zhang.)
Unfortunately that doesn't fix the problem. I am still able to reproduce
it with this patch :(
I also have tried with a 7.3 kernel, and I am still able to reproduce
the issue on both the K1 (the above usercopy issue or the not
reproducible GCC ICE) and the K3 (only not reproducible GCC ICE).
Disabling vector extension in the device tree fixes the issue in both
cases. However the LLVM JIT doesn't care if it is enabled or not, it
just matches by mvendorid / marchid / mimpid so you just get a SIGILL.
Regards
Aurelien
--
Aurelien Jarno GPG: 4096R/1DDD8C9B
aurelien@aurel32.net http://aurel32.net
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
prev parent reply other threads:[~2026-10-22 16:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-30 20:52 Random corruption on SpacemiT K1 with RVV and THP Aurelien Jarno
2026-09-08 4:42 ` Random corruption on SpacemiT K1 with RVV Aurelien Jarno
2026-09-09 16:45 ` Random corruption on SpacemiT K1 (and K3) " Aurelien Jarno
2026-09-15 21:14 ` Aurelien Jarno
2026-09-17 19:18 ` Palmer Dabbelt
2026-09-18 4:34 ` Aurelien Jarno
2026-09-22 21:33 ` Andy Chiu
2026-09-24 4:52 ` Aurelien Jarno
2026-09-24 6:15 ` Karl Mehltretter
2026-09-25 4:40 ` Aurelien Jarno
2026-09-28 4:32 ` Aurelien Jarno
2026-09-29 4:07 ` Vivian Wang
2026-10-22 16:53 ` Aurelien Jarno [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=ato_lUcnuZV30Mtj@aurel32.net \
--to=aurelien@aurel32.net \
--cc=kmehltretter@gmail.com \
--cc=linux-riscv@lists.infradead.org \
--cc=spacemit@lists.linux.dev \
--cc=tchiu@tenstorrent.com \
--cc=wangruikang@iscas.ac.cn \
/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