hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/arch/sh/kernel/traps.c
....@@ -38,8 +38,8 @@
3838 task_pid_nr(current), task_stack_page(current) + 1);
3939
4040 if (!user_mode(regs) || in_interrupt())
41
- dump_mem("Stack: ", regs->regs[15], THREAD_SIZE +
42
- (unsigned long)task_stack_page(current));
41
+ dump_mem("Stack: ", KERN_DEFAULT, regs->regs[15],
42
+ THREAD_SIZE + (unsigned long)task_stack_page(current));
4343
4444 notify_die(DIE_OOPS, str, regs, err, 255, SIGSEGV);
4545
....@@ -57,7 +57,7 @@
5757 if (panic_on_oops)
5858 panic("Fatal exception");
5959
60
- do_exit(SIGSEGV);
60
+ make_task_dead(SIGSEGV);
6161 }
6262
6363 void die_if_kernel(const char *str, struct pt_regs *regs, long err)
....@@ -118,7 +118,7 @@
118118
119119 if (addr < PAGE_OFFSET)
120120 return 0;
121
- if (probe_kernel_address((insn_size_t *)addr, opcode))
121
+ if (get_kernel_nofault(opcode, (insn_size_t *)addr))
122122 return 0;
123123 if (opcode == TRAPA_BUG_OPCODE)
124124 return 1;
....@@ -141,7 +141,7 @@
141141 SIGTRAP) == NOTIFY_STOP)
142142 return;
143143
144
- force_sig(SIGTRAP, current);
144
+ force_sig(SIGTRAP);
145145 }
146146
147147 /*
....@@ -167,13 +167,23 @@
167167 }
168168 #endif
169169
170
- force_sig(SIGTRAP, current);
170
+ force_sig(SIGTRAP);
171171 }
172
+
173
+#ifdef CONFIG_DYNAMIC_FTRACE
174
+extern void arch_ftrace_nmi_enter(void);
175
+extern void arch_ftrace_nmi_exit(void);
176
+#else
177
+static inline void arch_ftrace_nmi_enter(void) { }
178
+static inline void arch_ftrace_nmi_exit(void) { }
179
+#endif
172180
173181 BUILD_TRAP_HANDLER(nmi)
174182 {
175183 unsigned int cpu = smp_processor_id();
176184 TRAP_HANDLER_DECL;
185
+
186
+ arch_ftrace_nmi_enter();
177187
178188 nmi_enter();
179189 nmi_count(cpu)++;
....@@ -190,4 +200,6 @@
190200 }
191201
192202 nmi_exit();
203
+
204
+ arch_ftrace_nmi_exit();
193205 }