All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Masami Hiramatsu <mhiramat@kernel.org>,
	Jiri Olsa <jolsa@redhat.com>, Alexei Starovoitov <ast@kernel.org>
Cc: kbuild-all@lists.01.org, Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	netdev@vger.kernel.org, bpf@vger.kernel.org,
	lkml <linux-kernel@vger.kernel.org>,
	Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>
Subject: Re: [PATCH v4 5/9] ARM: rethook: Add rethook arm implementation
Date: Tue, 25 Jan 2022 03:24:14 +0800	[thread overview]
Message-ID: <202201250328.drn6ia3n-lkp@intel.com> (raw)
In-Reply-To: <164304061932.1680787.11603911228891618150.stgit@devnote2>

Hi Masami,

I love your patch! Yet something to improve:

[auto build test ERROR on rostedt-trace/for-next]
[also build test ERROR on arm64/for-next/core tip/x86/core linus/master v5.17-rc1 next-20220124]
[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]

url:    https://github.com/0day-ci/linux/commits/Masami-Hiramatsu/fprobe-Introduce-fprobe-function-entry-exit-probe/20220125-001253
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git for-next
config: arm-aspeed_g5_defconfig (https://download.01.org/0day-ci/archive/20220125/202201250328.drn6ia3n-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/df6df88bb474db78d80fc5619d39b25ec15d5d16
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Masami-Hiramatsu/fprobe-Introduce-fprobe-function-entry-exit-probe/20220125-001253
        git checkout df6df88bb474db78d80fc5619d39b25ec15d5d16
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arm SHELL=/bin/bash arch/arm/kernel/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   arch/arm/kernel/stacktrace.c: In function 'unwind_frame':
>> arch/arm/kernel/stacktrace.c:71:56: error: 'struct stackframe' has no member named 'tsk'
      71 |                 frame->pc = rethook_find_ret_addr(frame->tsk, frame->fp,
         |                                                        ^~
>> arch/arm/kernel/stacktrace.c:72:57: error: 'struct stackframe' has no member named 'kr_cur'
      72 |                                                   &frame->kr_cur);
         |                                                         ^~


vim +71 arch/arm/kernel/stacktrace.c

    12	
    13	#if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND)
    14	/*
    15	 * Unwind the current stack frame and store the new register values in the
    16	 * structure passed as argument. Unwinding is equivalent to a function return,
    17	 * hence the new PC value rather than LR should be used for backtrace.
    18	 *
    19	 * With framepointer enabled, a simple function prologue looks like this:
    20	 *	mov	ip, sp
    21	 *	stmdb	sp!, {fp, ip, lr, pc}
    22	 *	sub	fp, ip, #4
    23	 *
    24	 * A simple function epilogue looks like this:
    25	 *	ldm	sp, {fp, sp, pc}
    26	 *
    27	 * When compiled with clang, pc and sp are not pushed. A simple function
    28	 * prologue looks like this when built with clang:
    29	 *
    30	 *	stmdb	{..., fp, lr}
    31	 *	add	fp, sp, #x
    32	 *	sub	sp, sp, #y
    33	 *
    34	 * A simple function epilogue looks like this when built with clang:
    35	 *
    36	 *	sub	sp, fp, #x
    37	 *	ldm	{..., fp, pc}
    38	 *
    39	 *
    40	 * Note that with framepointer enabled, even the leaf functions have the same
    41	 * prologue and epilogue, therefore we can ignore the LR value in this case.
    42	 */
    43	int notrace unwind_frame(struct stackframe *frame)
    44	{
    45		unsigned long high, low;
    46		unsigned long fp = frame->fp;
    47	
    48		/* only go to a higher address on the stack */
    49		low = frame->sp;
    50		high = ALIGN(low, THREAD_SIZE);
    51	
    52	#ifdef CONFIG_CC_IS_CLANG
    53		/* check current frame pointer is within bounds */
    54		if (fp < low + 4 || fp > high - 4)
    55			return -EINVAL;
    56	
    57		frame->sp = frame->fp;
    58		frame->fp = *(unsigned long *)(fp);
    59		frame->pc = *(unsigned long *)(fp + 4);
    60	#else
    61		/* check current frame pointer is within bounds */
    62		if (fp < low + 12 || fp > high - 4)
    63			return -EINVAL;
    64	
    65		/* restore the registers from the stack frame */
    66		frame->fp = *(unsigned long *)(fp - 12);
    67		frame->sp = *(unsigned long *)(fp - 8);
    68		frame->pc = *(unsigned long *)(fp - 4);
    69	#endif
    70		if (IS_ENABLED(CONFIG_RETHOOK) && is_rethook_trampoline(frame->pc))
  > 71			frame->pc = rethook_find_ret_addr(frame->tsk, frame->fp,
  > 72							  &frame->kr_cur);
    73	#ifdef CONFIG_KRETPROBES
    74		if (is_kretprobe_trampoline(frame->pc))
    75			frame->pc = kretprobe_find_ret_addr(frame->tsk,
    76						(void *)frame->fp, &frame->kr_cur);
    77	#endif
    78	
    79		return 0;
    80	}
    81	#endif
    82	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH v4 5/9] ARM: rethook: Add rethook arm implementation
Date: Tue, 25 Jan 2022 03:24:14 +0800	[thread overview]
Message-ID: <202201250328.drn6ia3n-lkp@intel.com> (raw)
In-Reply-To: <164304061932.1680787.11603911228891618150.stgit@devnote2>

[-- Attachment #1: Type: text/plain, Size: 5028 bytes --]

Hi Masami,

I love your patch! Yet something to improve:

[auto build test ERROR on rostedt-trace/for-next]
[also build test ERROR on arm64/for-next/core tip/x86/core linus/master v5.17-rc1 next-20220124]
[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]

url:    https://github.com/0day-ci/linux/commits/Masami-Hiramatsu/fprobe-Introduce-fprobe-function-entry-exit-probe/20220125-001253
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git for-next
config: arm-aspeed_g5_defconfig (https://download.01.org/0day-ci/archive/20220125/202201250328.drn6ia3n-lkp(a)intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/df6df88bb474db78d80fc5619d39b25ec15d5d16
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Masami-Hiramatsu/fprobe-Introduce-fprobe-function-entry-exit-probe/20220125-001253
        git checkout df6df88bb474db78d80fc5619d39b25ec15d5d16
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arm SHELL=/bin/bash arch/arm/kernel/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   arch/arm/kernel/stacktrace.c: In function 'unwind_frame':
>> arch/arm/kernel/stacktrace.c:71:56: error: 'struct stackframe' has no member named 'tsk'
      71 |                 frame->pc = rethook_find_ret_addr(frame->tsk, frame->fp,
         |                                                        ^~
>> arch/arm/kernel/stacktrace.c:72:57: error: 'struct stackframe' has no member named 'kr_cur'
      72 |                                                   &frame->kr_cur);
         |                                                         ^~


vim +71 arch/arm/kernel/stacktrace.c

    12	
    13	#if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND)
    14	/*
    15	 * Unwind the current stack frame and store the new register values in the
    16	 * structure passed as argument. Unwinding is equivalent to a function return,
    17	 * hence the new PC value rather than LR should be used for backtrace.
    18	 *
    19	 * With framepointer enabled, a simple function prologue looks like this:
    20	 *	mov	ip, sp
    21	 *	stmdb	sp!, {fp, ip, lr, pc}
    22	 *	sub	fp, ip, #4
    23	 *
    24	 * A simple function epilogue looks like this:
    25	 *	ldm	sp, {fp, sp, pc}
    26	 *
    27	 * When compiled with clang, pc and sp are not pushed. A simple function
    28	 * prologue looks like this when built with clang:
    29	 *
    30	 *	stmdb	{..., fp, lr}
    31	 *	add	fp, sp, #x
    32	 *	sub	sp, sp, #y
    33	 *
    34	 * A simple function epilogue looks like this when built with clang:
    35	 *
    36	 *	sub	sp, fp, #x
    37	 *	ldm	{..., fp, pc}
    38	 *
    39	 *
    40	 * Note that with framepointer enabled, even the leaf functions have the same
    41	 * prologue and epilogue, therefore we can ignore the LR value in this case.
    42	 */
    43	int notrace unwind_frame(struct stackframe *frame)
    44	{
    45		unsigned long high, low;
    46		unsigned long fp = frame->fp;
    47	
    48		/* only go to a higher address on the stack */
    49		low = frame->sp;
    50		high = ALIGN(low, THREAD_SIZE);
    51	
    52	#ifdef CONFIG_CC_IS_CLANG
    53		/* check current frame pointer is within bounds */
    54		if (fp < low + 4 || fp > high - 4)
    55			return -EINVAL;
    56	
    57		frame->sp = frame->fp;
    58		frame->fp = *(unsigned long *)(fp);
    59		frame->pc = *(unsigned long *)(fp + 4);
    60	#else
    61		/* check current frame pointer is within bounds */
    62		if (fp < low + 12 || fp > high - 4)
    63			return -EINVAL;
    64	
    65		/* restore the registers from the stack frame */
    66		frame->fp = *(unsigned long *)(fp - 12);
    67		frame->sp = *(unsigned long *)(fp - 8);
    68		frame->pc = *(unsigned long *)(fp - 4);
    69	#endif
    70		if (IS_ENABLED(CONFIG_RETHOOK) && is_rethook_trampoline(frame->pc))
  > 71			frame->pc = rethook_find_ret_addr(frame->tsk, frame->fp,
  > 72							  &frame->kr_cur);
    73	#ifdef CONFIG_KRETPROBES
    74		if (is_kretprobe_trampoline(frame->pc))
    75			frame->pc = kretprobe_find_ret_addr(frame->tsk,
    76						(void *)frame->fp, &frame->kr_cur);
    77	#endif
    78	
    79		return 0;
    80	}
    81	#endif
    82	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

  reply	other threads:[~2022-01-24 19:33 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-24 16:09 [PATCH v4 0/9] fprobe: Introduce fprobe function entry/exit probe Masami Hiramatsu
2022-01-24 16:09 ` [PATCH v4 1/9] ftrace: Add ftrace_set_filter_ips function Masami Hiramatsu
2022-01-24 16:09 ` [PATCH v4 2/9] fprobe: Add ftrace based probe APIs Masami Hiramatsu
2022-01-24 16:09 ` [PATCH v4 3/9] rethook: Add a generic return hook Masami Hiramatsu
2022-01-24 16:10 ` [PATCH v4 4/9] rethook: x86: Add rethook x86 implementation Masami Hiramatsu
2022-01-24 22:23   ` kernel test robot
2022-01-24 22:23     ` kernel test robot
2022-01-25  6:02   ` Masami Hiramatsu
2022-01-24 16:10 ` [PATCH v4 5/9] ARM: rethook: Add rethook arm implementation Masami Hiramatsu
2022-01-24 19:24   ` kernel test robot [this message]
2022-01-24 19:24     ` kernel test robot
2022-01-24 16:10 ` [PATCH v4 6/9] arm64: rethook: Add arm64 rethook implementation Masami Hiramatsu
2022-01-24 22:23   ` kernel test robot
2022-01-24 22:23     ` kernel test robot
2022-01-24 16:10 ` [PATCH v4 7/9] fprobe: Add exit_handler support Masami Hiramatsu
2022-01-24 16:10 ` [PATCH v4 8/9] fprobe: Add sample program for fprobe Masami Hiramatsu
2022-01-24 16:11 ` [PATCH v4 9/9] docs: fprobe: Add fprobe description to ftrace-use.rst Masami Hiramatsu

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=202201250328.drn6ia3n-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=jolsa@redhat.com \
    --cc=kafai@fb.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=songliubraving@fb.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.