tree:
https://github.com/c-sky/csky-linux linux-next
head: 66c40fbeccdab07f3ef89bf738f6d0c0536f4975
commit: 5bc46ce26cfc42fa066b2206621587f9dea9a8a8 [7/13] csky: Optimize the trap processing
flow
config: csky-defconfig (attached as .config)
compiler: csky-linux-gcc (GCC) 9.3.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
git checkout 5bc46ce26cfc42fa066b2206621587f9dea9a8a8
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=csky
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
arch/csky/kernel/traps.c:59:13: warning: no previous prototype for 'trap_init'
[-Wmissing-prototypes]
59 | void __init trap_init(void)
| ^~~~~~~~~
> arch/csky/kernel/traps.c:117:6: warning: no previous prototype
for 'do_trap' [-Wmissing-prototypes]
117 | void do_trap(struct pt_regs
*regs, int signo, int code, unsigned long addr)
| ^~~~~~~
> arch/csky/kernel/traps.c:152:15: warning: no previous prototype
for 'do_trap_unknown' [-Wmissing-prototypes]
152 |
DO_ERROR_INFO(do_trap_unknown,
| ^~~~~~~~~~~~~~~
arch/csky/kernel/traps.c:147:27: note: in definition of macro 'DO_ERROR_INFO'
147 | asmlinkage __visible void name(struct pt_regs *regs) \
| ^~~~
> arch/csky/kernel/traps.c:154:15: warning: no previous prototype
for 'do_trap_zdiv' [-Wmissing-prototypes]
154 |
DO_ERROR_INFO(do_trap_zdiv,
| ^~~~~~~~~~~~
arch/csky/kernel/traps.c:147:27: note: in definition of macro 'DO_ERROR_INFO'
147 | asmlinkage __visible void name(struct pt_regs *regs) \
| ^~~~
> arch/csky/kernel/traps.c:156:15: warning: no previous prototype
for 'do_trap_buserr' [-Wmissing-prototypes]
156 |
DO_ERROR_INFO(do_trap_buserr,
| ^~~~~~~~~~~~~~
arch/csky/kernel/traps.c:147:27: note: in definition of macro 'DO_ERROR_INFO'
147 | asmlinkage __visible void name(struct pt_regs *regs) \
| ^~~~
> arch/csky/kernel/traps.c:159:17: warning: no previous prototype
for 'do_trap_misaligned' [-Wmissing-prototypes]
159 | asmlinkage void
do_trap_misaligned(struct pt_regs *regs)
| ^~~~~~~~~~~~~~~~~~
> arch/csky/kernel/traps.c:170:17: warning: no previous prototype
for 'do_trap_bkpt' [-Wmissing-prototypes]
170 | asmlinkage void
do_trap_bkpt(struct pt_regs *regs)
| ^~~~~~~~~~~~
> arch/csky/kernel/traps.c:189:17: warning: no previous prototype
for 'do_trap_illinsn' [-Wmissing-prototypes]
189 | asmlinkage void
do_trap_illinsn(struct pt_regs *regs)
| ^~~~~~~~~~~~~~~
> arch/csky/kernel/traps.c:212:17: warning: no previous prototype
for 'do_trap_fpe' [-Wmissing-prototypes]
212 | asmlinkage void
do_trap_fpe(struct pt_regs *regs)
| ^~~~~~~~~~~
> arch/csky/kernel/traps.c:222:17: warning: no previous prototype
for 'do_trap_priv' [-Wmissing-prototypes]
222 | asmlinkage void
do_trap_priv(struct pt_regs *regs)
| ^~~~~~~~~~~~
arch/csky/kernel/traps.c:232:17: warning: no previous prototype for 'trap_c'
[-Wmissing-prototypes]
232 | asmlinkage void trap_c(struct pt_regs *regs)
| ^~~~~~
vim +/do_trap +117 arch/csky/kernel/traps.c
116
117 void do_trap(struct pt_regs *regs, int signo, int code, unsigned
long addr)
118 {
119 struct task_struct *tsk = current;
120
121 if (show_unhandled_signals && unhandled_signal(tsk, signo)
122 && printk_ratelimit()) {
123 pr_info("%s[%d]: unhandled signal %d code 0x%x at 0x%08lx",
124 tsk->comm, task_pid_nr(tsk), signo, code, addr);
125 print_vma_addr(KERN_CONT " in ", instruction_pointer(regs));
126 pr_cont("\n");
127 show_regs(regs);
128 }
129
130 force_sig_fault(signo, code, (void __user *)addr);
131 }
132
133 static void do_trap_error(struct pt_regs *regs, int signo, int code,
134 unsigned long addr, const char *str)
135 {
136 current->thread.trap_no = trap_no(regs);
137
138 if (user_mode(regs)) {
139 do_trap(regs, signo, code, addr);
140 } else {
141 if (!fixup_exception(regs))
142 die(regs, str);
143 }
144 }
145
146 #define DO_ERROR_INFO(name, signo, code, str) \
147 asmlinkage __visible void name(struct pt_regs *regs) \
148 { \
149 do_trap_error(regs, signo, code, regs->pc, "Oops - " str); \
150 }
151
152 DO_ERROR_INFO(do_trap_unknown,
153 SIGILL, ILL_ILLTRP,
"unknown exception");
154 DO_ERROR_INFO(do_trap_zdiv,
155 SIGFPE, FPE_INTDIV,
"error zero div exception");
156 DO_ERROR_INFO(do_trap_buserr,
157 SIGSEGV, ILL_ILLADR,
"error bus error exception");
158
159 asmlinkage void do_trap_misaligned(struct pt_regs *regs)
160 {
161 #ifdef CONFIG_CPU_NEED_SOFTALIGN
162 csky_alignment(regs);
163 #else
164 current->thread.trap_no = trap_no(regs);
165 do_trap_error(regs, SIGBUS, BUS_ADRALN, regs->pc,
166 "Oops - load/store address misaligned");
167 #endif
168 }
169
170 asmlinkage void do_trap_bkpt(struct pt_regs *regs)
171 {
172 #ifdef CONFIG_KPROBES
173 if (kprobe_single_step_handler(regs))
174 return;
175 #endif
176 #ifdef CONFIG_UPROBES
177 if (uprobe_single_step_handler(regs))
178 return;
179 #endif
180 if (user_mode(regs)) {
181 send_sig(SIGTRAP, current, 0);
182 return;
183 }
184
185 do_trap_error(regs, SIGILL, ILL_ILLTRP, regs->pc,
186 "Oops - illegal trap exception");
187 }
188
189 asmlinkage void do_trap_illinsn(struct pt_regs *regs)
190 {
191 current->thread.trap_no = trap_no(regs);
192
193 #ifdef CONFIG_KPROBES
194 if (kprobe_breakpoint_handler(regs))
195 return;
196 #endif
197 #ifdef CONFIG_UPROBES
198 if (uprobe_breakpoint_handler(regs))
199 return;
200 #endif
201 #ifndef CONFIG_CPU_NO_USER_BKPT
202 if (*(uint16_t *)instruction_pointer(regs) != USR_BKPT) {
203 send_sig(SIGTRAP, current, 0);
204 return;
205 }
206 #endif
207
208 do_trap_error(regs, SIGILL, ILL_ILLOPC, regs->pc,
209 "Oops - illegal instruction exception");
210 }
211
212 asmlinkage void do_trap_fpe(struct pt_regs *regs)
213 {
214 #ifdef CONFIG_CPU_HAS_FP
215 return fpu_fpe(regs);
216 #else
217 do_trap_error(regs, SIGILL, ILL_ILLOPC, regs->pc,
218 "Oops - fpu instruction exception");
219 #endif
220 }
221
222 asmlinkage void do_trap_priv(struct pt_regs *regs)
223 {
224 #ifdef CONFIG_CPU_HAS_FP
225 if (user_mode(regs) && fpu_libc_helper(regs))
226 return;
227 #endif
228 do_trap_error(regs, SIGILL, ILL_PRVOPC, regs->pc,
229 "Oops - illegal privileged exception");
230 }
231
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org