All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [mhiramat:kprobes/kretprobe-stackfix-v9 14/22] arch/x86/kernel/kprobes/core.c:1061:1: warning: data definition has no type or storage class
Date: Mon, 12 Jul 2021 05:19:20 +0800	[thread overview]
Message-ID: <202107120518.5SLoeeWK-lkp@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mhiramat/linux.git kprobes/kretprobe-stackfix-v9
head:   7a69e2b70adeabbf3e3c1be8a18b43188c4d085d
commit: e4d6ef1b03f84257031acd58c208dd0ffa92548c [14/22] x86/kprobes: Add UNWIND_HINT_FUNC on kretprobe_trampoline()
config: i386-randconfig-a002-20210712 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://git.kernel.org/pub/scm/linux/kernel/git/mhiramat/linux.git/commit/?id=e4d6ef1b03f84257031acd58c208dd0ffa92548c
        git remote add mhiramat https://git.kernel.org/pub/scm/linux/kernel/git/mhiramat/linux.git
        git fetch --no-tags mhiramat kprobes/kretprobe-stackfix-v9
        git checkout e4d6ef1b03f84257031acd58c208dd0ffa92548c
        # save the attached .config to linux build tree
        mkdir build_dir
        make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash arch/x86/kernel/kprobes/

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

All warnings (new ones prefixed by >>):

>> arch/x86/kernel/kprobes/core.c:1061:1: warning: data definition has no type or storage class
    1061 | STACK_FRAME_NON_STANDARD_FP(__kretprobe_trampoline);
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/x86/kernel/kprobes/core.c:1061:1: error: type defaults to 'int' in declaration of 'STACK_FRAME_NON_STANDARD_FP' [-Werror=implicit-int]
>> arch/x86/kernel/kprobes/core.c:1061:1: warning: parameter names (without types) in function declaration
   arch/x86/kernel/kprobes/core.c:1066:24: warning: no previous prototype for 'trampoline_handler' [-Wmissing-prototypes]
    1066 | __used __visible void *trampoline_handler(struct pt_regs *regs)
         |                        ^~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors


vim +1061 arch/x86/kernel/kprobes/core.c

  1015	
  1016	/*
  1017	 * When a retprobed function returns, this code saves registers and
  1018	 * calls trampoline_handler() runs, which calls the kretprobe's handler.
  1019	 */
  1020	asm(
  1021		".text\n"
  1022		".global __kretprobe_trampoline\n"
  1023		".type __kretprobe_trampoline, @function\n"
  1024		"__kretprobe_trampoline:\n"
  1025		/* We don't bother saving the ss register */
  1026	#ifdef CONFIG_X86_64
  1027		"	pushq %rsp\n"
  1028		UNWIND_HINT_FUNC
  1029		"	pushfq\n"
  1030		SAVE_REGS_STRING
  1031		"	movq %rsp, %rdi\n"
  1032		"	call trampoline_handler\n"
  1033		/* Replace saved sp with true return address. */
  1034		"	movq %rax, 19*8(%rsp)\n"
  1035		RESTORE_REGS_STRING
  1036		"	popfq\n"
  1037	#else
  1038		"	pushl %esp\n"
  1039		UNWIND_HINT_FUNC
  1040		"	pushfl\n"
  1041		SAVE_REGS_STRING
  1042		"	movl %esp, %eax\n"
  1043		"	call trampoline_handler\n"
  1044		/* Replace saved sp with true return address. */
  1045		"	movl %eax, 15*4(%esp)\n"
  1046		RESTORE_REGS_STRING
  1047		"	popfl\n"
  1048	#endif
  1049		"	ret\n"
  1050		".size __kretprobe_trampoline, .-__kretprobe_trampoline\n"
  1051	);
  1052	NOKPROBE_SYMBOL(__kretprobe_trampoline);
  1053	/*
  1054	 * __kretprobe_trampoline() skips updating frame pointer. The frame pointer
  1055	 * saved in trampoline_handler() points to the real caller function's
  1056	 * frame pointer. Thus the __kretprobe_trampoline() doesn't have a
  1057	 * standard stack frame with CONFIG_FRAME_POINTER=y.
  1058	 * Let's mark it non-standard function. Anyway, FP unwinder can correctly
  1059	 * unwind without the hint.
  1060	 */
> 1061	STACK_FRAME_NON_STANDARD_FP(__kretprobe_trampoline);
  1062	

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 40440 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	Masami Hiramatsu <mhiramat@kernel.org>
Subject: [mhiramat:kprobes/kretprobe-stackfix-v9 14/22] arch/x86/kernel/kprobes/core.c:1061:1: warning: data definition has no type or storage class
Date: Mon, 12 Jul 2021 05:19:20 +0800	[thread overview]
Message-ID: <202107120518.5SLoeeWK-lkp@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mhiramat/linux.git kprobes/kretprobe-stackfix-v9
head:   7a69e2b70adeabbf3e3c1be8a18b43188c4d085d
commit: e4d6ef1b03f84257031acd58c208dd0ffa92548c [14/22] x86/kprobes: Add UNWIND_HINT_FUNC on kretprobe_trampoline()
config: i386-randconfig-a002-20210712 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://git.kernel.org/pub/scm/linux/kernel/git/mhiramat/linux.git/commit/?id=e4d6ef1b03f84257031acd58c208dd0ffa92548c
        git remote add mhiramat https://git.kernel.org/pub/scm/linux/kernel/git/mhiramat/linux.git
        git fetch --no-tags mhiramat kprobes/kretprobe-stackfix-v9
        git checkout e4d6ef1b03f84257031acd58c208dd0ffa92548c
        # save the attached .config to linux build tree
        mkdir build_dir
        make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash arch/x86/kernel/kprobes/

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

All warnings (new ones prefixed by >>):

>> arch/x86/kernel/kprobes/core.c:1061:1: warning: data definition has no type or storage class
    1061 | STACK_FRAME_NON_STANDARD_FP(__kretprobe_trampoline);
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/x86/kernel/kprobes/core.c:1061:1: error: type defaults to 'int' in declaration of 'STACK_FRAME_NON_STANDARD_FP' [-Werror=implicit-int]
>> arch/x86/kernel/kprobes/core.c:1061:1: warning: parameter names (without types) in function declaration
   arch/x86/kernel/kprobes/core.c:1066:24: warning: no previous prototype for 'trampoline_handler' [-Wmissing-prototypes]
    1066 | __used __visible void *trampoline_handler(struct pt_regs *regs)
         |                        ^~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors


vim +1061 arch/x86/kernel/kprobes/core.c

  1015	
  1016	/*
  1017	 * When a retprobed function returns, this code saves registers and
  1018	 * calls trampoline_handler() runs, which calls the kretprobe's handler.
  1019	 */
  1020	asm(
  1021		".text\n"
  1022		".global __kretprobe_trampoline\n"
  1023		".type __kretprobe_trampoline, @function\n"
  1024		"__kretprobe_trampoline:\n"
  1025		/* We don't bother saving the ss register */
  1026	#ifdef CONFIG_X86_64
  1027		"	pushq %rsp\n"
  1028		UNWIND_HINT_FUNC
  1029		"	pushfq\n"
  1030		SAVE_REGS_STRING
  1031		"	movq %rsp, %rdi\n"
  1032		"	call trampoline_handler\n"
  1033		/* Replace saved sp with true return address. */
  1034		"	movq %rax, 19*8(%rsp)\n"
  1035		RESTORE_REGS_STRING
  1036		"	popfq\n"
  1037	#else
  1038		"	pushl %esp\n"
  1039		UNWIND_HINT_FUNC
  1040		"	pushfl\n"
  1041		SAVE_REGS_STRING
  1042		"	movl %esp, %eax\n"
  1043		"	call trampoline_handler\n"
  1044		/* Replace saved sp with true return address. */
  1045		"	movl %eax, 15*4(%esp)\n"
  1046		RESTORE_REGS_STRING
  1047		"	popfl\n"
  1048	#endif
  1049		"	ret\n"
  1050		".size __kretprobe_trampoline, .-__kretprobe_trampoline\n"
  1051	);
  1052	NOKPROBE_SYMBOL(__kretprobe_trampoline);
  1053	/*
  1054	 * __kretprobe_trampoline() skips updating frame pointer. The frame pointer
  1055	 * saved in trampoline_handler() points to the real caller function's
  1056	 * frame pointer. Thus the __kretprobe_trampoline() doesn't have a
  1057	 * standard stack frame with CONFIG_FRAME_POINTER=y.
  1058	 * Let's mark it non-standard function. Anyway, FP unwinder can correctly
  1059	 * unwind without the hint.
  1060	 */
> 1061	STACK_FRAME_NON_STANDARD_FP(__kretprobe_trampoline);
  1062	

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 40440 bytes --]

             reply	other threads:[~2021-07-11 21:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-11 21:19 kernel test robot [this message]
2021-07-11 21:19 ` [mhiramat:kprobes/kretprobe-stackfix-v9 14/22] arch/x86/kernel/kprobes/core.c:1061:1: warning: data definition has no type or storage class kernel test robot

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=202107120518.5SLoeeWK-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.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 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.