tree:
https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git
pending-4.14
head: e578a1979e89497c3b0250d13148b473342c6208
commit: 1c3e3f6d88437844e2edd22e4d1ae074bac7e352 [20972/22074] ARCv2: save ABI registers
across signal handling
config: arc-randconfig-s032-20211014 (attached as .config)
compiler: arceb-elf-gcc (GCC) 11.2.0
reproduce:
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-dirty
#
https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git/c...
git remote add sashal-stable
https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git
git fetch --no-tags sashal-stable pending-4.14
git checkout 1c3e3f6d88437844e2edd22e4d1ae074bac7e352
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1
CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=arc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
> arch/arc/kernel/signal.c:80:31: sparse: sparse: incorrect type in
argument 1 (different address spaces) @@ expected void [noderef] <asn:1> *to @@
got struct user_regs_arcv2 * @@
arch/arc/kernel/signal.c:80:31: sparse:
expected void [noderef] <asn:1> *to
arch/arc/kernel/signal.c:80:31: sparse: got struct user_regs_arcv2 *
> arch/arc/kernel/signal.c:91:41: sparse: sparse: incorrect type in
argument 2 (different address spaces) @@ expected void const [noderef] <asn:1>
*from @@ got struct user_regs_arcv2 * @@
arch/arc/kernel/signal.c:91:41:
sparse: expected void const [noderef] <asn:1> *from
arch/arc/kernel/signal.c:91:41: sparse: got struct user_regs_arcv2 *
> arch/arc/kernel/signal.c:137:42: sparse: sparse: incorrect type
in argument 1 (different address spaces) @@ expected struct sigcontext *mctx @@
got struct sigcontext [noderef] <asn:1> * @@
arch/arc/kernel/signal.c:137:42: sparse: expected struct sigcontext *mctx
arch/arc/kernel/signal.c:137:42: sparse: got struct sigcontext [noderef]
<asn:1> *
arch/arc/kernel/signal.c:156:45: sparse: sparse: incorrect type in argument 1
(different address spaces) @@ expected struct sigcontext *mctx @@ got struct
sigcontext [noderef] <asn:1> * @@
arch/arc/kernel/signal.c:156:45: sparse: expected struct sigcontext *mctx
arch/arc/kernel/signal.c:156:45: sparse: got struct sigcontext [noderef]
<asn:1> *
arch/arc/kernel/signal.c:197:1: sparse: sparse: symbol 'sys_rt_sigreturn' was
not declared. Should it be static?
arch/arc/kernel/signal.c:404:6: sparse: sparse: symbol 'do_signal' was not
declared. Should it be static?
In file included from include/asm-generic/bug.h:5,
from arch/arc/include/asm/bug.h:32,
from include/linux/bug.h:5,
from include/linux/signal.h:5,
from arch/arc/kernel/signal.c:50:
include/linux/atomic.h: In function 'atomic_inc_unless_negative':
include/linux/compiler.h:25:39: warning: ignoring attribute 'section
("_ftrace_annotated_branch")' because it conflicts with previous
'section ("_ftrace_branch")' [-Wattributes]
25 | static struct ftrace_likely_data 24-
| ^~~~~~~~~~~~~~~~~~
include/linux/compiler.h:69:30: note: in definition of macro '__trace_if'
69 | ______r = !!(cond); 27-
| ^~~~
include/linux/atomic.h:612:17: note: in expansion of macro 'if'
612 | if (likely(v1 == v))
| ^~
include/linux/compiler.h:45:26: note: in expansion of macro '__branch_check__'
45 | # define likely(x) (__branch_check__(x, 1, __builtin_constant_p(x)))
| ^~~~~~~~~~~~~~~~
include/linux/atomic.h:612:21: note: in expansion of macro 'likely'
612 | if (likely(v1 == v))
| ^~~~~~
include/linux/compiler.h:64:25: note: previous declaration here
64 | ______f = { 39-
| ^~~~~~~
include/linux/compiler.h:56:23: note: in expansion of macro '__trace_if'
56 | #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
| ^~~~~~~~~~
include/linux/atomic.h:612:17: note: in expansion of macro 'if'
612 | if (likely(v1 == v))
| ^~
include/linux/atomic.h: In function 'atomic_dec_unless_positive':
include/linux/compiler.h:25:39: warning: ignoring attribute 'section
("_ftrace_annotated_branch")' because it conflicts with previous
'section ("_ftrace_branch")' [-Wattributes]
25 | static struct ftrace_likely_data 49-
| ^~~~~~~~~~~~~~~~~~
include/linux/compiler.h:69:30: note: in definition of macro '__trace_if'
69 | ______r = !!(cond); 52-
| ^~~~
include/linux/atomic.h:625:17: note: in expansion of macro 'if'
625 | if (likely(v1 == v))
| ^~
include/linux/compiler.h:45:26: note: in expansion of macro '__branch_check__'
45 | # define likely(x) (__branch_check__(x, 1, __builtin_constant_p(x)))
| ^~~~~~~~~~~~~~~~
include/linux/atomic.h:625:21: note: in expansion of macro 'likely'
625 | if (likely(v1 == v))
| ^~~~~~
include/linux/compiler.h:64:25: note: previous declaration here
64 | ______f = { 64-
| ^~~~~~~
include/linux/compiler.h:56:23: note: in expansion of macro '__trace_if'
56 | #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
| ^~~~~~~~~~
include/linux/atomic.h:625:17: note: in expansion of macro 'if'
625 | if (likely(v1 == v))
| ^~
include/linux/atomic.h: In function 'atomic_dec_if_positive':
include/linux/compiler.h:25:39: warning: ignoring attribute 'section
("_ftrace_annotated_branch")' because it conflicts with previous
'section ("_ftrace_branch")' [-Wattributes]
25 | static struct ftrace_likely_data 74-
| ^~~~~~~~~~~~~~~~~~
include/linux/compiler.h:69:30: note: in definition of macro '__trace_if'
69 | ______r = !!(cond); 77-
| ^~~~
include/linux/atomic.h:646:17: note: in expansion of macro 'if'
646 | if (unlikely(dec < 0))
| ^~
include/linux/compiler.h:48:26: note: in expansion of macro '__branch_check__'
48 | # define unlikely(x) (__branch_check__(x, 0, __builtin_constant_p(x)))
| ^~~~~~~~~~~~~~~~
include/linux/atomic.h:646:21: note: in expansion of macro 'unlikely'
646 | if (unlikely(dec < 0))
| ^~~~~~~~
include/linux/compiler.h:64:25: note: previous declaration here
64 | ______f = { 89-
| ^~~~~~~
include/linux/compiler.h:56:23: note: in expansion of macro '__trace_if'
56 | #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
| ^~~~~~~~~~
include/linux/atomic.h:646:17: note: in expansion of macro 'if'
646 | if (unlikely(dec < 0))
| ^~
include/linux/compiler.h:25:39: warning: ignoring attribute 'section
("_ftrace_annotated_branch")' because it conflicts with previous
'section ("_ftrace_branch")' [-Wattributes]
25 | static struct ftrace_likely_data 98-
| ^~~~~~~~~~~~~~~~~~
include/linux/compiler.h:69:30: note: in definition of macro '__trace_if'
69 | ______r = !!(cond); 101-
| ^~~~
include/linux/atomic.h:649:17: note: in expansion of macro 'if'
649 | if (likely(old == c))
| ^~
include/linux/compiler.h:45:26: note: in expansion of macro '__branch_check__'
45 | # define likely(x) (__branch_check__(x, 1, __builtin_constant_p(x)))
| ^~~~~~~~~~~~~~~~
vim +80 arch/arc/kernel/signal.c
66
67 static int save_arcv2_regs(struct sigcontext *mctx, struct pt_regs *regs)
68 {
69 int err = 0;
70 #ifndef CONFIG_ISA_ARCOMPACT
71 struct user_regs_arcv2 v2abi;
72
73 v2abi.r30 = regs->r30;
74 #ifdef CONFIG_ARC_HAS_ACCL_REGS
75 v2abi.r58 = regs->r58;
76 v2abi.r59 = regs->r59;
77 #else
78 v2abi.r58 = v2abi.r59 = 0;
79 #endif
80 err = __copy_to_user(&mctx->v2abi, &v2abi,
sizeof(v2abi));
81 #endif
82 return err;
83 }
84
85 static int restore_arcv2_regs(struct sigcontext *mctx, struct pt_regs *regs)
86 {
87 int err = 0;
88 #ifndef CONFIG_ISA_ARCOMPACT
89 struct user_regs_arcv2 v2abi;
90
91 err = __copy_from_user(&v2abi, &mctx->v2abi,
sizeof(v2abi));
92
93 regs->r30 = v2abi.r30;
94 #ifdef CONFIG_ARC_HAS_ACCL_REGS
95 regs->r58 = v2abi.r58;
96 regs->r59 = v2abi.r59;
97 #endif
98 #endif
99 return err;
100 }
101
102 static int
103 stash_usr_regs(struct rt_sigframe __user *sf, struct pt_regs *regs,
104 sigset_t *set)
105 {
106 int err;
107 struct user_regs_struct uregs;
108
109 uregs.scratch.bta = regs->bta;
110 uregs.scratch.lp_start = regs->lp_start;
111 uregs.scratch.lp_end = regs->lp_end;
112 uregs.scratch.lp_count = regs->lp_count;
113 uregs.scratch.status32 = regs->status32;
114 uregs.scratch.ret = regs->ret;
115 uregs.scratch.blink = regs->blink;
116 uregs.scratch.fp = regs->fp;
117 uregs.scratch.gp = regs->r26;
118 uregs.scratch.r12 = regs->r12;
119 uregs.scratch.r11 = regs->r11;
120 uregs.scratch.r10 = regs->r10;
121 uregs.scratch.r9 = regs->r9;
122 uregs.scratch.r8 = regs->r8;
123 uregs.scratch.r7 = regs->r7;
124 uregs.scratch.r6 = regs->r6;
125 uregs.scratch.r5 = regs->r5;
126 uregs.scratch.r4 = regs->r4;
127 uregs.scratch.r3 = regs->r3;
128 uregs.scratch.r2 = regs->r2;
129 uregs.scratch.r1 = regs->r1;
130 uregs.scratch.r0 = regs->r0;
131 uregs.scratch.sp = regs->sp;
132
133 err = __copy_to_user(&(sf->uc.uc_mcontext.regs.scratch),
&uregs.scratch,
134 sizeof(sf->uc.uc_mcontext.regs.scratch));
135
136 if (is_isa_arcv2())
137 err |= save_arcv2_regs(&(sf->uc.uc_mcontext), regs);
138
139 err |= __copy_to_user(&sf->uc.uc_sigmask, set, sizeof(sigset_t));
140
141 return err ? -EFAULT : 0;
142 }
143
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org