Re: [RFC PATCH v1 08/11] riscv: unwind_user: Support Minimal DWARF CFI and FP user unwinding

From: bot+bpf-ci

Date: Sun Nov 22 2026 - 19:39:56 EST


> riscv: unwind_user: Support Minimal DWARF CFI and FP user unwinding

TL;DR:
- Nits only: a comment names a nonexistent __compat_vdso_rt_sigreturn symbol
- The !CONFIG_MMU branch in the sigreturn unwinder looks like dead code, since
Kconfig requires MMU

> diff --git a/arch/riscv/kernel/compat_signal.c b/arch/riscv/kernel/compat_signal.c
> --- a/arch/riscv/kernel/compat_signal.c
> +++ b/arch/riscv/kernel/compat_signal.c

[ ... ]

> +#ifdef CONFIG_UNWIND_USER
> +/**
> + * compat_unwind_user_sigreturn() - Unwind an RV32 compat vDSO rt_sigreturn frame
> + * @state: Current user unwind state.
> + *
> + * Return: true if @state was at __compat_vdso_rt_sigreturn and advanced to the
> + * interrupted 32-bit user context, false otherwise.
> + */

This isn't a bug, but __compat_vdso_rt_sigreturn does not appear to exist
anywhere in the tree.

arch/riscv/kernel/compat_vdso/rt_sigreturn.S just includes
../vdso/rt_sigreturn.S, so the compat vDSO symbol is also
__vdso_rt_sigreturn, which COMPAT_VDSO_SYMBOL(mm->context.vdso,
rt_sigreturn) resolves through compat__vdso_rt_sigreturn_offset.

Could the comment say "the compat vDSO __vdso_rt_sigreturn" instead?

> diff --git a/arch/riscv/kernel/signal.c b/arch/riscv/kernel/signal.c
> --- a/arch/riscv/kernel/signal.c
> +++ b/arch/riscv/kernel/signal.c

[ ... ]

> +#ifdef CONFIG_UNWIND_USER

[ ... ]

> + frame = (struct rt_sigframe __user *)state->sp;
> +#ifdef CONFIG_MMU
> + if (!mm->context.vdso)
> + return false;
> + sigret = (unsigned long)VDSO_SYMBOL(mm->context.vdso, rt_sigreturn);
> +#else
> + sigret = (unsigned long)&frame->sigreturn_code;
> +#endif

Can the !CONFIG_MMU branch here ever be built?

This function is inside #ifdef CONFIG_UNWIND_USER, and UNWIND_USER is only
selected by HAVE_UNWIND_USER_FP and HAVE_UNWIND_USER_CFI. The Kconfig
change in this patch selects both only when MMU is set:

select HAVE_UNWIND_USER_CFI if MMU
select HAVE_UNWIND_USER_FP if MMU

So CONFIG_UNWIND_USER=y on riscv implies CONFIG_MMU=y, and the
&frame->sigreturn_code path can never be compiled or tested. Should the
#ifdef CONFIG_MMU / #else be dropped, leaving only the vDSO lookup? A
nommu variant could come together with the Kconfig change that enables it.


---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md

CI run summary: https://github.com/kernel-patches/bpf/actions/runs/45087188604