mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pu Lehui <pulehui@huaweicloud.com>
To: kernel test robot <lkp@intel.com>,
	linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Alexandre Ghiti <alex@ghiti.fr>,
	"Masami Hiramatsu (Google)" <mhiramat@kernel.org>,
	"Steven Rostedt (Google)" <rostedt@goodmis.org>,
	Naresh Kamboju <naresh.kamboju@linaro.org>,
	Pu Lehui <pulehui@huawei.com>
Subject: Re: [PATCH] riscv: fgraph: Fix stack layout to match __arch_ftrace_regs argument of ftrace_return_to_handler
Date: Mon, 17 Mar 2025 11:06:24 +0800	[thread overview]
Message-ID: <18b3bbb9-0733-4f0a-b859-2aabceefbc67@huaweicloud.com> (raw)
In-Reply-To: <202503160820.dvqMpH0g-lkp@intel.com>


On 2025/3/16 9:16, kernel test robot wrote:
> Hi Pu,
> 
> kernel test robot noticed the following build errors:
> 
> [auto build test ERROR on linus/master]
> [also build test ERROR on v6.14-rc6 next-20250314]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch#_base_tree_information]
> 
> url:    https://github.com/intel-lab-lkp/linux/commits/Pu-Lehui/riscv-fgraph-Fix-stack-layout-to-match-__arch_ftrace_regs-argument-of-ftrace_return_to_handler/20250311-212440
> base:   linus/master
> patch link:    https://lore.kernel.org/r/20250311132243.2178271-1-pulehui%40huaweicloud.com
> patch subject: [PATCH] riscv: fgraph: Fix stack layout to match __arch_ftrace_regs argument of ftrace_return_to_handler
> config: riscv-randconfig-001-20250316 (https://download.01.org/0day-ci/archive/20250316/202503160820.dvqMpH0g-lkp@intel.com/config)
> compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project 87916f8c32ebd8e284091db9b70339df57fd1e90)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250316/202503160820.dvqMpH0g-lkp@intel.com/reproduce)
> 
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202503160820.dvqMpH0g-lkp@intel.com/
> 
> All errors (new ones prefixed by >>):
> 
>>> <instantiation>:1:14: error: operand must be a symbol with %lo/%pcrel_lo/%tprel_lo modifier or an integer in the range [-2048, 2047]
>     addi sp, sp, -FREGS_SIZE_ON_STACK
>                  ^
>     arch/riscv/kernel/mcount.S:73:2: note: while in macro instantiation
>      SAVE_RET_ABI_STATE
>      ^
>>> <instantiation>:2:17: error: unexpected token
>      sw ra, FREGS_RA(sp)
>                     ^
>     arch/riscv/kernel/mcount.S:73:2: note: while in macro instantiation
>      SAVE_RET_ABI_STATE
>      ^
>     <instantiation>:3:17: error: unexpected token
>      sw s0, FREGS_S0(sp)
>                     ^
>     arch/riscv/kernel/mcount.S:73:2: note: while in macro instantiation
>      SAVE_RET_ABI_STATE
>      ^
>     <instantiation>:4:17: error: unexpected token
>      sw a0, FREGS_A0(sp)
>                     ^
>     arch/riscv/kernel/mcount.S:73:2: note: while in macro instantiation
>      SAVE_RET_ABI_STATE
>      ^
>     <instantiation>:5:17: error: unexpected token
>      sw a1, FREGS_A1(sp)
>                     ^
>     arch/riscv/kernel/mcount.S:73:2: note: while in macro instantiation
>      SAVE_RET_ABI_STATE
>      ^
>     <instantiation>:6:15: error: operand must be a symbol with %lo/%pcrel_lo/%tprel_lo modifier or an integer in the range [-2048, 2047]
>      addi s0, sp, FREGS_SIZE_ON_STACK
>                   ^
>     arch/riscv/kernel/mcount.S:73:2: note: while in macro instantiation
>      SAVE_RET_ABI_STATE
>      ^
>     <instantiation>:1:16: error: unexpected token
>     lw ra, FREGS_RA(sp)
>                    ^
>     arch/riscv/kernel/mcount.S:77:2: note: while in macro instantiation
>      RESTORE_RET_ABI_STATE
>      ^
>>> <instantiation>:2:17: error: unexpected token
>      lw s0, FREGS_S0(sp)
>                     ^
>     arch/riscv/kernel/mcount.S:77:2: note: while in macro instantiation
>      RESTORE_RET_ABI_STATE
>      ^
>     <instantiation>:3:17: error: unexpected token
>      lw a0, FREGS_A0(sp)
>                     ^
>     arch/riscv/kernel/mcount.S:77:2: note: while in macro instantiation
>      RESTORE_RET_ABI_STATE
>      ^
>     <instantiation>:4:17: error: unexpected token
>      lw a1, FREGS_A1(sp)
>                     ^
>     arch/riscv/kernel/mcount.S:77:2: note: while in macro instantiation
>      RESTORE_RET_ABI_STATE
>      ^
>     <instantiation>:5:15: error: operand must be a symbol with %lo/%pcrel_lo/%tprel_lo modifier or an integer in the range [-2048, 2047]
>      addi sp, sp, FREGS_SIZE_ON_STACK
>                   ^
>     arch/riscv/kernel/mcount.S:77:2: note: while in macro instantiation
>      RESTORE_RET_ABI_STATE
>      ^
> 

Nice catch. The reason is that HAVE_DYNAMIC_FTRACE can be diabled when 
CONFIG_MMU=n, and lead to disable HAVE_DYNAMIC_FTRACE_WITH_ARGS. 
However, the current fgraph on riscv relies on the infrastructure of 
DYNAMIC_FTRACE_WITH_ARGS. So let's select HAVE_FUNCTION_GRAPH_TRACER 
depends on HAVE_DYNAMIC_FTRACE_WITH_ARGS. I will send new soon.


  reply	other threads:[~2025-03-17  3:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-11 13:22 Pu Lehui
2025-03-11 14:14 ` Alexandre Ghiti
2025-03-12 19:35 ` Björn Töpel
2025-03-16  1:16 ` kernel test robot
2025-03-17  3:06   ` Pu Lehui [this message]
2025-03-27  3:24 ` patchwork-bot+linux-riscv

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=18b3bbb9-0733-4f0a-b859-2aabceefbc67@huaweicloud.com \
    --to=pulehui@huaweicloud.com \
    --cc=alex@ghiti.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=lkp@intel.com \
    --cc=llvm@lists.linux.dev \
    --cc=mhiramat@kernel.org \
    --cc=naresh.kamboju@linaro.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=palmer@dabbelt.com \
    --cc=pulehui@huawei.com \
    --cc=rostedt@goodmis.org \
    /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

all inboxes | Powered by JetHome®