[IA64] honor notify_die() returning NOTIFY_STOP

This requires making die() and die_if_kernel() return a value, and their
callers to honor this (and be prepared that it returns).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Tony Luck <tony.luck@intel.com>

authored by Jan Beulich and committed by Tony Luck 620de2f5 ef3c4cb9

+39 -22
+3 -2
arch/ia64/ia32/ia32_support.c
··· 27 27 28 28 #include "ia32priv.h" 29 29 30 - extern void die_if_kernel (char *str, struct pt_regs *regs, long err); 30 + extern int die_if_kernel (char *str, struct pt_regs *regs, long err); 31 31 32 32 struct exec_domain ia32_exec_domain; 33 33 struct page *ia32_shared_page[NR_CPUS]; ··· 217 217 { 218 218 siginfo_t siginfo; 219 219 220 - die_if_kernel("Bad IA-32 interrupt", regs, int_num); 220 + if (die_if_kernel("Bad IA-32 interrupt", regs, int_num)) 221 + return; 221 222 222 223 siginfo.si_signo = SIGTRAP; 223 224 siginfo.si_errno = int_num; /* XXX is it OK to abuse si_errno like this? */
+23 -12
arch/ia64/kernel/traps.c
··· 35 35 fpswa_interface = __va(ia64_boot_param->fpswa); 36 36 } 37 37 38 - void 38 + int 39 39 die (const char *str, struct pt_regs *regs, long err) 40 40 { 41 41 static struct { ··· 62 62 if (++die.lock_owner_depth < 3) { 63 63 printk("%s[%d]: %s %ld [%d]\n", 64 64 current->comm, task_pid_nr(current), str, err, ++die_counter); 65 - (void) notify_die(DIE_OOPS, (char *)str, regs, err, 255, SIGSEGV); 66 - show_regs(regs); 65 + if (notify_die(DIE_OOPS, str, regs, err, 255, SIGSEGV) 66 + != NOTIFY_STOP) 67 + show_regs(regs); 68 + else 69 + regs = NULL; 67 70 } else 68 71 printk(KERN_ERR "Recursive die() failure, output suppressed\n"); 69 72 ··· 75 72 add_taint(TAINT_DIE); 76 73 spin_unlock_irq(&die.lock); 77 74 75 + if (!regs) 76 + return 1; 77 + 78 78 if (panic_on_oops) 79 79 panic("Fatal exception"); 80 80 81 81 do_exit(SIGSEGV); 82 + return 0; 82 83 } 83 84 84 - void 85 + int 85 86 die_if_kernel (char *str, struct pt_regs *regs, long err) 86 87 { 87 88 if (!user_mode(regs)) 88 - die(str, regs, err); 89 + return die(str, regs, err); 90 + return 0; 89 91 } 90 92 91 93 void ··· 110 102 if (notify_die(DIE_BREAK, "break 0", regs, break_num, TRAP_BRKPT, SIGTRAP) 111 103 == NOTIFY_STOP) 112 104 return; 113 - die_if_kernel("bugcheck!", regs, break_num); 105 + if (die_if_kernel("bugcheck!", regs, break_num)) 106 + return; 114 107 sig = SIGILL; code = ILL_ILLOPC; 115 108 break; 116 109 ··· 164 155 break; 165 156 166 157 default: 167 - if (break_num < 0x40000 || break_num > 0x100000) 168 - die_if_kernel("Bad break", regs, break_num); 158 + if ((break_num < 0x40000 || break_num > 0x100000) 159 + && die_if_kernel("Bad break", regs, break_num)) 160 + return; 169 161 170 162 if (break_num < 0x80000) { 171 163 sig = SIGILL; code = __ILL_BREAK; ··· 412 402 #endif 413 403 414 404 sprintf(buf, "IA-64 Illegal operation fault"); 415 - die_if_kernel(buf, &regs, 0); 405 + rv.fkt = 0; 406 + if (die_if_kernel(buf, &regs, 0)) 407 + return rv; 416 408 417 409 memset(&si, 0, sizeof(si)); 418 410 si.si_signo = SIGILL; 419 411 si.si_code = ILL_ILLOPC; 420 412 si.si_addr = (void __user *) (regs.cr_iip + ia64_psr(&regs)->ri); 421 413 force_sig_info(SIGILL, &si, current); 422 - rv.fkt = 0; 423 414 return rv; 424 415 } 425 416 ··· 655 644 sprintf(buf, "Fault %lu", vector); 656 645 break; 657 646 } 658 - die_if_kernel(buf, &regs, error); 659 - force_sig(SIGILL, current); 647 + if (!die_if_kernel(buf, &regs, error)) 648 + force_sig(SIGILL, current); 660 649 }
+8 -5
arch/ia64/kernel/unaligned.c
··· 23 23 #include <asm/uaccess.h> 24 24 #include <asm/unaligned.h> 25 25 26 - extern void die_if_kernel(char *str, struct pt_regs *regs, long err); 26 + extern int die_if_kernel(char *str, struct pt_regs *regs, long err); 27 27 28 28 #undef DEBUG_UNALIGNED_TRAP 29 29 ··· 675 675 */ 676 676 if (ld.x6_op == 1 || ld.x6_op == 3) { 677 677 printk(KERN_ERR "%s: register update on speculative load, error\n", __FUNCTION__); 678 - die_if_kernel("unaligned reference on speculative load with register update\n", 679 - regs, 30); 678 + if (die_if_kernel("unaligned reference on speculative load with register update\n", 679 + regs, 30)) 680 + return; 680 681 } 681 682 682 683 ··· 1318 1317 1319 1318 if (ia64_psr(regs)->be) { 1320 1319 /* we don't support big-endian accesses */ 1321 - die_if_kernel("big-endian unaligned accesses are not supported", regs, 0); 1320 + if (die_if_kernel("big-endian unaligned accesses are not supported", regs, 0)) 1321 + return; 1322 1322 goto force_sigbus; 1323 1323 } 1324 1324 ··· 1536 1534 ia64_handle_exception(regs, eh); 1537 1535 goto done; 1538 1536 } 1539 - die_if_kernel("error during unaligned kernel access\n", regs, ret); 1537 + if (die_if_kernel("error during unaligned kernel access\n", regs, ret)) 1538 + return; 1540 1539 /* NOT_REACHED */ 1541 1540 } 1542 1541 force_sigbus:
+5 -3
arch/ia64/mm/fault.c
··· 16 16 #include <asm/system.h> 17 17 #include <asm/uaccess.h> 18 18 19 - extern void die (char *, struct pt_regs *, long); 19 + extern int die(char *, struct pt_regs *, long); 20 20 21 21 #ifdef CONFIG_KPROBES 22 22 static inline int notify_page_fault(struct pt_regs *regs, int trap) ··· 267 267 else 268 268 printk(KERN_ALERT "Unable to handle kernel paging request at " 269 269 "virtual address %016lx\n", address); 270 - die("Oops", regs, isr); 270 + if (die("Oops", regs, isr)) 271 + regs = NULL; 271 272 bust_spinlocks(0); 272 - do_exit(SIGKILL); 273 + if (regs) 274 + do_exit(SIGKILL); 273 275 return; 274 276 275 277 out_of_memory: