[ARM] Add support for pause_on_oops and display preempt/smp options

Add calls to oops_enter() and oops_exit() to __die(), so that
things like lockdep know when an oops occurs.

Add suffixes to the oops report to indicate whether the running
kernel has been built with preempt or smp support.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by Russell King and committed by Russell King d9202429 188e1f81

+19 -1
+19 -1
arch/arm/kernel/traps.c
··· 204 barrier(); 205 } 206 207 static void __die(const char *str, int err, struct thread_info *thread, struct pt_regs *regs) 208 { 209 struct task_struct *tsk = thread->task; 210 static int die_counter; 211 212 - printk("Internal error: %s: %x [#%d]\n", str, err, ++die_counter); 213 print_modules(); 214 __show_regs(regs); 215 printk("Process %s (pid: %d, stack limit = 0x%p)\n", ··· 244 { 245 struct thread_info *thread = current_thread_info(); 246 247 console_verbose(); 248 spin_lock_irq(&die_lock); 249 bust_spinlocks(1); ··· 253 bust_spinlocks(0); 254 spin_unlock_irq(&die_lock); 255 256 if (panic_on_oops) 257 panic("Fatal exception"); 258 259 do_exit(SIGSEGV); 260 } 261
··· 204 barrier(); 205 } 206 207 + #ifdef CONFIG_PREEMPT 208 + #define S_PREEMPT " PREEMPT" 209 + #else 210 + #define S_PREEMPT "" 211 + #endif 212 + #ifdef CONFIG_SMP 213 + #define S_SMP " SMP" 214 + #else 215 + #define S_SMP "" 216 + #endif 217 + 218 static void __die(const char *str, int err, struct thread_info *thread, struct pt_regs *regs) 219 { 220 struct task_struct *tsk = thread->task; 221 static int die_counter; 222 223 + printk("Internal error: %s: %x [#%d]" S_PREEMPT S_SMP "\n", 224 + str, err, ++die_counter); 225 print_modules(); 226 __show_regs(regs); 227 printk("Process %s (pid: %d, stack limit = 0x%p)\n", ··· 232 { 233 struct thread_info *thread = current_thread_info(); 234 235 + oops_enter(); 236 + 237 console_verbose(); 238 spin_lock_irq(&die_lock); 239 bust_spinlocks(1); ··· 239 bust_spinlocks(0); 240 spin_unlock_irq(&die_lock); 241 242 + if (in_interrupt()) 243 + panic("Fatal exception in interrupt"); 244 + 245 if (panic_on_oops) 246 panic("Fatal exception"); 247 248 + oops_exit(); 249 do_exit(SIGSEGV); 250 } 251