From: Paul Walmsley <pjw@kernel.org>
To: 许佳凯 <xujiakai2025@iscas.ac.cn>, "Nathan Chancellor" <nathan@kernel.org>
Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
Paul Walmsley <pjw@kernel.org>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Alexandre Ghiti <alex@ghiti.fr>,
namcao@linutronix.de
Subject: Re: [PATCH] riscv: fix KUnit test_kprobes crash when building with Clang
Date: Sat, 15 Nov 2025 22:15:19 -0700 (MST) [thread overview]
Message-ID: <621798fc-68bc-504c-755f-0a2f1f83d1c2@kernel.org> (raw)
In-Reply-To: <738dd4e2.ff73.19a7cd7b4d5.Coremail.xujiakai2025@iscas.ac.cn>
[-- Attachment #1: Type: text/plain, Size: 1165 bytes --]
+ 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@iscas.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
[-- Attachment #2: Type: text/plain, Size: 161 bytes --]
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2025-11-16 5:15 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-13 10:51 [PATCH] riscv: fix KUnit test_kprobes crash when building with Clang 许佳凯
2025-11-16 5:15 ` Paul Walmsley [this message]
2025-11-17 3:03 ` Jiakai Xu
2025-11-18 20:21 ` Paul Walmsley
2025-11-19 1:38 ` Nathan Chancellor
2025-11-19 3:33 ` Jiakai Xu
2025-11-19 3:01 ` Jiakai Xu
2025-11-22 1:10 ` Paul Walmsley
2025-12-26 3:31 ` Jiakai Xu
2025-11-18 21:10 ` patchwork-bot+linux-riscv
2025-11-26 9:23 ` Nam Cao
2025-11-26 18:08 ` Nam Cao
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=621798fc-68bc-504c-755f-0a2f1f83d1c2@kernel.org \
--to=pjw@kernel.org \
--cc=alex@ghiti.fr \
--cc=aou@eecs.berkeley.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=namcao@linutronix.de \
--cc=nathan@kernel.org \
--cc=palmer@dabbelt.com \
--cc=xujiakai2025@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