From: sashiko-bot@kernel.org
To: "Wang Han" <wanghan@linux.alibaba.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v4 RESEND 4/7] riscv: stacktrace: introduce stack-bound tracking helpers
Date: Mon, 29 Jun 2026 07:42:32 +0000 [thread overview]
Message-ID: <20260629074233.133DB1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260629072713.3273743-5-wanghan@linux.alibaba.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Unconditional reference to conditionally defined irq_stack_ptr causes a link-time error when CONFIG_IRQ_STACKS is disabled.
--
commit 64aa629bbd032157beeb94e2add8faf14c975e32
Author: Wang Han <wanghan@linux.alibaba.com>
riscv: stacktrace: introduce stack-bound tracking helpers
This commit introduces building blocks for a reliable stack unwinder
in RISC-V. It adds stack-bound tracking helpers such as stack_info
and unwind_state, along with accessors for IRQ, task, and overflow stacks.
> diff --git a/arch/riscv/include/asm/stacktrace.h b/arch/riscv/include/asm/stacktrace.h
> index b1495a7e06ce6..bc87c49403798 100644
> --- a/arch/riscv/include/asm/stacktrace.h
> +++ b/arch/riscv/include/asm/stacktrace.h
[ ... ]
> @@ -16,14 +21,70 @@ extern void notrace walk_stackframe(struct task_struct *task, struct pt_regs *re
> extern void dump_backtrace(struct pt_regs *regs, struct task_struct *task,
> const char *loglvl);
>
> -static inline bool on_thread_stack(void)
> +/*
> + * IRQ stack accessors
> + */
> +static inline struct stack_info stackinfo_get_irq(void)
> +{
> + unsigned long low = (unsigned long)raw_cpu_read(irq_stack_ptr);
[Severity: Low]
Will this cause a link error when CONFIG_IRQ_STACKS is disabled?
Looking at arch/riscv/kernel/irq.c, irq_stack_ptr is defined inside an
#ifdef CONFIG_IRQ_STACKS block. Since stackinfo_get_irq() unconditionally
references it here, it seems this might result in an undefined reference
to irq_stack_ptr during linking.
Should this accessor be conditionally compiled, or should it provide a
fallback when CONFIG_IRQ_STACKS is not set?
> + unsigned long high = low + IRQ_STACK_SIZE;
> +
> + return (struct stack_info) {
> + .low = low,
> + .high = high,
> + };
> +}
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260629072713.3273743-1-wanghan@linux.alibaba.com?part=4
next prev parent reply other threads:[~2026-06-29 7:42 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-29 7:27 [PATCH v4 RESEND 0/7] riscv: Add reliable stack unwinding for livepatch Wang Han
2026-06-29 7:27 ` [PATCH v4 RESEND 1/7] riscv: stacktrace: Add frame record metadata Wang Han
2026-06-29 7:27 ` [PATCH v4 RESEND 2/7] riscv: stacktrace: disable KASAN and KCOV instrumentation for stacktrace.o Wang Han
2026-06-29 7:27 ` [PATCH v4 RESEND 3/7] riscv: ftrace: always preserve s0 in dynamic ftrace register frame Wang Han
2026-06-29 7:27 ` [PATCH v4 RESEND 4/7] riscv: stacktrace: introduce stack-bound tracking helpers Wang Han
2026-06-29 7:42 ` sashiko-bot [this message]
2026-06-29 7:27 ` [PATCH v4 RESEND 5/7] riscv: stacktrace: switch to frame-pointer based unwinder Wang Han
2026-06-29 7:27 ` [PATCH v4 RESEND 6/7] riscv: Kconfig: enable HAVE_RELIABLE_STACKTRACE and HAVE_LIVEPATCH Wang Han
2026-06-29 7:27 ` [PATCH v4 RESEND 7/7] selftests/livepatch: Add RISC-V syscall wrapper prefix Wang Han
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=20260629074233.133DB1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=wanghan@linux.alibaba.com \
/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