Linux Perf Users
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Wang Han" <wanghan@linux.alibaba.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v4 4/7] riscv: stacktrace: introduce stack-bound tracking helpers
Date: Mon, 29 Jun 2026 07:17:58 +0000	[thread overview]
Message-ID: <20260629071820.60EE01F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260629064228.3195856-5-wanghan@linux.alibaba.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Linker error for `irq_stack_ptr` when `CONFIG_IRQ_STACKS` is disabled.
--

commit 77c89ba9a3694750005502f08315093729bc5952
Author: Wang Han <wanghan@linux.alibaba.com>

riscv: stacktrace: introduce stack-bound tracking helpers

This commit introduces common stack unwinder types and helpers for RISC-V,
modeled after the arm64 implementation. It adds struct stack_info and accessors
for different stack types like IRQ, task, and overflow stacks. The unwinder
switch to use these helpers is planned for a follow-up commit.

> 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 linker error when CONFIG_IRQ_STACKS is disabled?

This unconditionally references irq_stack_ptr, which lacks a definition when
CONFIG_IRQ_STACKS is disabled. While these helpers aren't wired up to callers
in this commit, when they are used in the follow-up commit, could this break
the build for configurations with CONFIG_FRAME_POINTER=y and
CONFIG_IRQ_STACKS=n?

> +	unsigned long high = low + IRQ_STACK_SIZE;
> +
> +	return (struct stack_info) {
> +		.low = low,
> +		.high = high,
> +	};
> +}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260629064228.3195856-1-wanghan@linux.alibaba.com?part=4

      reply	other threads:[~2026-06-29  7:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-29  6:42 [PATCH v4 4/7] riscv: stacktrace: introduce stack-bound tracking helpers Wang Han
2026-06-29  7:17 ` sashiko-bot [this message]

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=20260629071820.60EE01F000E9@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