[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <621798fc-68bc-504c-755f-0a2f1f83d1c2@kernel.org>
Date: Sat, 15 Nov 2025 22:15:19 -0700 (MST)
From: Paul Walmsley <pjw@...nel.org>
To: 许佳凯 <xujiakai2025@...as.ac.cn>,
Nathan Chancellor <nathan@...nel.org>
cc: linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org,
Paul Walmsley <pjw@...nel.org>, Palmer Dabbelt <palmer@...belt.com>,
Albert Ou <aou@...s.berkeley.edu>, Alexandre Ghiti <alex@...ti.fr>,
namcao@...utronix.de
Subject: Re: [PATCH] riscv: fix KUnit test_kprobes crash when building with
Clang
+ Nam Cao, Nathan Chancellor
On Thu, 13 Nov 2025, 许佳凯 wrote:
> Clang misaligns the test_kprobes_addresses and test_kprobes_functions
> arrays, or does not export local labels by default. Both can cause
> kmalloc_array() allocation errors and KUnit failures.
>
> This patch fixes the issue by:
> - Adding .section .rodata to explicitly place arrays in the read-only data segment.
> - Adding .align 3 to align arrays to 8 bytes.
> - Adding .globl to probe labels to ensure symbols are visible.
>
> For detailed debug and analysis, see:
> https://github.com/j1akai/temp/blob/main/20251113/readme.md
>
> Signed-off-by: Jiakai Xu <xujiakai2025@...as.ac.cn>
Hello Jiakai Xu,
Thanks for the patch. Have you reported this difference in behavior to
the Clang/LLVM folks so they can render an opinion on it? We can consider
this as a short term workaround if it's indeed a toolchain issue, but I'd
like to hear from the LLVM folks.
Also: could you please include the narrative from your page
https://github.com/j1akai/temp/blob/main/20251113/readme.md
in the patch description, just in case that URL eventually becomes
unavailable?
thanks,
- Paul
Powered by blists - more mailing lists