* Re: [PATCH] riscv: Require clang-17 or newer for kCFI
[not found] <20250612-riscv-require-clang-17-for-kcfi-v1-1-216f7cd7d87f@kernel.org>
@ 2025-06-12 20:16 ` Sami Tolvanen
0 siblings, 0 replies; only message in thread
From: Sami Tolvanen @ 2025-06-12 20:16 UTC (permalink / raw)
To: Nathan Chancellor
Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
linux-riscv, llvm, patches
Hi Nathan,
On Thu, Jun 12, 2025 at 12:57 PM Nathan Chancellor <nathan@kernel.org> wrote:
>
> After the combination of commit c217157bcd1d ("riscv: Implement
> HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS"), which starts using
> '-fpatchable-function-entry=M,N', and commit d0262e907e29 ("riscv:
> ftrace: support PREEMPT"), which allows CONFIG_DYNAMIC_FTRACE to be
> enabled by allmodconfig, allmodconfig builds with clang-16 begin
> crashing in the generic LLVM kCFI pass (see [1] for the stack trace).
>
> clang-17 avoids this crash by moving to target-specific lowering of the
> kCFI operand bundles [2]. Require clang-17 to select CONFIG_CFI_CLANG to
> avoid this crash.
>
> Fixes: c217157bcd1d ("riscv: Implement HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS")
> Link: https://godbolt.org/z/xG39Pn16o [1]
> Link: https://github.com/llvm/llvm-project/commit/62fa708ceb027713b386c7e0efda994f8bdc27e2 [2]
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
> arch/riscv/Kconfig | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> index 36061f4732b7..d71ea0f4466f 100644
> --- a/arch/riscv/Kconfig
> +++ b/arch/riscv/Kconfig
> @@ -63,7 +63,8 @@ config RISCV
> select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
> select ARCH_STACKWALK
> select ARCH_SUPPORTS_ATOMIC_RMW
> - select ARCH_SUPPORTS_CFI_CLANG
> + # clang >= 17: https://github.com/llvm/llvm-project/commit/62fa708ceb027713b386c7e0efda994f8bdc27e2
> + select ARCH_SUPPORTS_CFI_CLANG if CLANG_VERSION >= 170000
> select ARCH_SUPPORTS_DEBUG_PAGEALLOC if MMU
> select ARCH_SUPPORTS_HUGE_PFNMAP if TRANSPARENT_HUGEPAGE
> select ARCH_SUPPORTS_HUGETLBFS if MMU
LGTM. Thanks!
Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Sami
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-06-12 20:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20250612-riscv-require-clang-17-for-kcfi-v1-1-216f7cd7d87f@kernel.org>
2025-06-12 20:16 ` [PATCH] riscv: Require clang-17 or newer for kCFI Sami Tolvanen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).