[mark:arm64/ftrace/minimal-regs 5/6] arch/x86/include/asm/ftrace.h:47:32: error: initialization of 'struct pt_regs *' from 'int' makes pointer from integer without a cast

From: kernel test robot
Date: Wed Jun 01 2022 - 12:11:14 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git arm64/ftrace/minimal-regs
head: b0741d059a9f19a1aa1191833140f53e41f1775a
commit: c694698df7f633bcbdf8bc0edb94f4a70ed0d092 [5/6] ftrace: pass fregs to arch_ftrace_set_direct_caller()
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20220602/202206020032.Mu3eiis7-lkp@xxxxxxxxx/config)
compiler: gcc-11 (Debian 11.3.0-1) 11.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git/commit/?id=c694698df7f633bcbdf8bc0edb94f4a70ed0d092
git remote add mark https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git
git fetch --no-tags mark arm64/ftrace/minimal-regs
git checkout c694698df7f633bcbdf8bc0edb94f4a70ed0d092
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/gpu/drm/i915/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

In file included from include/linux/ftrace.h:23,
from include/linux/kprobes.h:28,
from include/linux/kgdb.h:19,
from include/drm/drm_util.h:36,
from drivers/gpu/drm/i915/display/intel_display.h:28,
from drivers/gpu/drm/i915/display/intel_cdclk.h:11,
from <command-line>:
arch/x86/include/asm/ftrace.h:45:57: error: 'struct ftrace_regs' declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
45 | static inline void arch_ftrace_set_direct_caller(struct ftrace_regs *fregs, unsigned long addr)
| ^~~~~~~~~~~
arch/x86/include/asm/ftrace.h: In function 'arch_ftrace_set_direct_caller':
arch/x86/include/asm/ftrace.h:47:32: error: implicit declaration of function 'ftrace_get_regs' [-Werror=implicit-function-declaration]
47 | struct pt_regs *regs = ftrace_get_regs(fregs);
| ^~~~~~~~~~~~~~~
>> arch/x86/include/asm/ftrace.h:47:32: error: initialization of 'struct pt_regs *' from 'int' makes pointer from integer without a cast [-Werror=int-conversion]
In file included from include/linux/kprobes.h:28,
from include/linux/kgdb.h:19,
from include/drm/drm_util.h:36,
from drivers/gpu/drm/i915/display/intel_display.h:28,
from drivers/gpu/drm/i915/display/intel_cdclk.h:11,
from <command-line>:
include/linux/ftrace.h: At top level:
include/linux/ftrace.h:121:40: error: conflicting types for 'ftrace_get_regs'; have 'struct pt_regs *(struct ftrace_regs *)'
121 | static __always_inline struct pt_regs *ftrace_get_regs(struct ftrace_regs *fregs)
| ^~~~~~~~~~~~~~~
In file included from include/linux/ftrace.h:23,
from include/linux/kprobes.h:28,
from include/linux/kgdb.h:19,
from include/drm/drm_util.h:36,
from drivers/gpu/drm/i915/display/intel_display.h:28,
from drivers/gpu/drm/i915/display/intel_cdclk.h:11,
from <command-line>:
arch/x86/include/asm/ftrace.h:47:32: note: previous implicit declaration of 'ftrace_get_regs' with type 'int()'
47 | struct pt_regs *regs = ftrace_get_regs(fregs);
| ^~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
--
In file included from include/linux/ftrace.h:23,
from include/linux/kprobes.h:28,
from include/linux/kgdb.h:19,
from include/drm/drm_util.h:36,
from include/drm/drm_connector.h:32,
from drivers/gpu/drm/i915/i915_drv.h:37,
from drivers/gpu/drm/i915/pxp/intel_pxp_debugfs.c:14:
arch/x86/include/asm/ftrace.h:45:57: error: 'struct ftrace_regs' declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
45 | static inline void arch_ftrace_set_direct_caller(struct ftrace_regs *fregs, unsigned long addr)
| ^~~~~~~~~~~
arch/x86/include/asm/ftrace.h: In function 'arch_ftrace_set_direct_caller':
arch/x86/include/asm/ftrace.h:47:32: error: implicit declaration of function 'ftrace_get_regs' [-Werror=implicit-function-declaration]
47 | struct pt_regs *regs = ftrace_get_regs(fregs);
| ^~~~~~~~~~~~~~~
>> arch/x86/include/asm/ftrace.h:47:32: error: initialization of 'struct pt_regs *' from 'int' makes pointer from integer without a cast [-Werror=int-conversion]
In file included from include/linux/kprobes.h:28,
from include/linux/kgdb.h:19,
from include/drm/drm_util.h:36,
from include/drm/drm_connector.h:32,
from drivers/gpu/drm/i915/i915_drv.h:37,
from drivers/gpu/drm/i915/pxp/intel_pxp_debugfs.c:14:
include/linux/ftrace.h: At top level:
include/linux/ftrace.h:121:40: error: conflicting types for 'ftrace_get_regs'; have 'struct pt_regs *(struct ftrace_regs *)'
121 | static __always_inline struct pt_regs *ftrace_get_regs(struct ftrace_regs *fregs)
| ^~~~~~~~~~~~~~~
In file included from include/linux/ftrace.h:23,
from include/linux/kprobes.h:28,
from include/linux/kgdb.h:19,
from include/drm/drm_util.h:36,
from include/drm/drm_connector.h:32,
from drivers/gpu/drm/i915/i915_drv.h:37,
from drivers/gpu/drm/i915/pxp/intel_pxp_debugfs.c:14:
arch/x86/include/asm/ftrace.h:47:32: note: previous implicit declaration of 'ftrace_get_regs' with type 'int()'
47 | struct pt_regs *regs = ftrace_get_regs(fregs);
| ^~~~~~~~~~~~~~~
drivers/gpu/drm/i915/pxp/intel_pxp_debugfs.c:61:6: error: no previous prototype for 'intel_pxp_debugfs_register' [-Werror=missing-prototypes]
61 | void intel_pxp_debugfs_register(struct intel_pxp *pxp, struct dentry *gt_root)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors


vim +47 arch/x86/include/asm/ftrace.h

37
38 /*
39 * When a ftrace registered caller is tracing a function that is
40 * also set by a register_ftrace_direct() call, it needs to be
41 * differentiated in the ftrace_caller trampoline. To do this, we
42 * place the direct caller in the ORIG_AX part of pt_regs. This
43 * tells the ftrace_caller that there's a direct caller.
44 */
45 static inline void arch_ftrace_set_direct_caller(struct ftrace_regs *fregs, unsigned long addr)
46 {
> 47 struct pt_regs *regs = ftrace_get_regs(fregs);
48
49 /* Emulate a call */
50 regs->orig_ax = addr;
51 }
52

--
0-DAY CI Kernel Test Service
https://01.org/lkp