traps.c (d834a9dcecae834cd6b2bc5e50e1907738d9cf6a) | traps.c (5dc3055879b8f659f62abb7c3d1eaa4d02e36d65) |
---|---|
1/* 2 * Copyright (C) 1991, 1992 Linus Torvalds 3 * Copyright (C) 2000, 2001, 2002 Andi Kleen, SuSE Labs 4 * 5 * Pentium III FXSR, SSE support 6 * Gareth Hughes <gareth@valinux.com>, May 2000 7 */ 8 --- 69 unchanged lines hidden (view full) --- 78gate_desc idt_table[NR_VECTORS] __page_aligned_data = { { { { 0, 0 } } }, }; 79#endif 80 81DECLARE_BITMAP(used_vectors, NR_VECTORS); 82EXPORT_SYMBOL_GPL(used_vectors); 83 84static int ignore_nmis; 85 | 1/* 2 * Copyright (C) 1991, 1992 Linus Torvalds 3 * Copyright (C) 2000, 2001, 2002 Andi Kleen, SuSE Labs 4 * 5 * Pentium III FXSR, SSE support 6 * Gareth Hughes <gareth@valinux.com>, May 2000 7 */ 8 --- 69 unchanged lines hidden (view full) --- 78gate_desc idt_table[NR_VECTORS] __page_aligned_data = { { { { 0, 0 } } }, }; 79#endif 80 81DECLARE_BITMAP(used_vectors, NR_VECTORS); 82EXPORT_SYMBOL_GPL(used_vectors); 83 84static int ignore_nmis; 85 |
86int unknown_nmi_panic; 87 |
|
86static inline void conditional_sti(struct pt_regs *regs) 87{ 88 if (regs->flags & X86_EFLAGS_IF) 89 local_irq_enable(); 90} 91 92static inline void preempt_conditional_sti(struct pt_regs *regs) 93{ --- 201 unchanged lines hidden (view full) --- 295 tsk->thread.error_code = error_code; 296 tsk->thread.trap_no = 13; 297 if (notify_die(DIE_GPF, "general protection fault", regs, 298 error_code, 13, SIGSEGV) == NOTIFY_STOP) 299 return; 300 die("general protection fault", regs, error_code); 301} 302 | 88static inline void conditional_sti(struct pt_regs *regs) 89{ 90 if (regs->flags & X86_EFLAGS_IF) 91 local_irq_enable(); 92} 93 94static inline void preempt_conditional_sti(struct pt_regs *regs) 95{ --- 201 unchanged lines hidden (view full) --- 297 tsk->thread.error_code = error_code; 298 tsk->thread.trap_no = 13; 299 if (notify_die(DIE_GPF, "general protection fault", regs, 300 error_code, 13, SIGSEGV) == NOTIFY_STOP) 301 return; 302 die("general protection fault", regs, error_code); 303} 304 |
305static int __init setup_unknown_nmi_panic(char *str) 306{ 307 unknown_nmi_panic = 1; 308 return 1; 309} 310__setup("unknown_nmi_panic", setup_unknown_nmi_panic); 311 |
|
303static notrace __kprobes void 304mem_parity_error(unsigned char reason, struct pt_regs *regs) 305{ 306 printk(KERN_EMERG 307 "Uhhuh. NMI received for unknown reason %02x on CPU %d.\n", 308 reason, smp_processor_id()); 309 310 printk(KERN_EMERG --- 55 unchanged lines hidden (view full) --- 366 return; 367 } 368#endif 369 printk(KERN_EMERG 370 "Uhhuh. NMI received for unknown reason %02x on CPU %d.\n", 371 reason, smp_processor_id()); 372 373 printk(KERN_EMERG "Do you have a strange power saving mode enabled?\n"); | 312static notrace __kprobes void 313mem_parity_error(unsigned char reason, struct pt_regs *regs) 314{ 315 printk(KERN_EMERG 316 "Uhhuh. NMI received for unknown reason %02x on CPU %d.\n", 317 reason, smp_processor_id()); 318 319 printk(KERN_EMERG --- 55 unchanged lines hidden (view full) --- 375 return; 376 } 377#endif 378 printk(KERN_EMERG 379 "Uhhuh. NMI received for unknown reason %02x on CPU %d.\n", 380 reason, smp_processor_id()); 381 382 printk(KERN_EMERG "Do you have a strange power saving mode enabled?\n"); |
374 if (panic_on_unrecovered_nmi) | 383 if (unknown_nmi_panic || panic_on_unrecovered_nmi) |
375 panic("NMI: Not continuing"); 376 377 printk(KERN_EMERG "Dazed and confused, but trying to continue\n"); 378} 379 380static notrace __kprobes void default_do_nmi(struct pt_regs *regs) 381{ 382 unsigned char reason = 0; --- 9 unchanged lines hidden (view full) --- 392 if (notify_die(DIE_NMI_IPI, "nmi_ipi", regs, reason, 2, SIGINT) 393 == NOTIFY_STOP) 394 return; 395 396#ifdef CONFIG_X86_LOCAL_APIC 397 if (notify_die(DIE_NMI, "nmi", regs, reason, 2, SIGINT) 398 == NOTIFY_STOP) 399 return; | 384 panic("NMI: Not continuing"); 385 386 printk(KERN_EMERG "Dazed and confused, but trying to continue\n"); 387} 388 389static notrace __kprobes void default_do_nmi(struct pt_regs *regs) 390{ 391 unsigned char reason = 0; --- 9 unchanged lines hidden (view full) --- 401 if (notify_die(DIE_NMI_IPI, "nmi_ipi", regs, reason, 2, SIGINT) 402 == NOTIFY_STOP) 403 return; 404 405#ifdef CONFIG_X86_LOCAL_APIC 406 if (notify_die(DIE_NMI, "nmi", regs, reason, 2, SIGINT) 407 == NOTIFY_STOP) 408 return; |
400 401#ifndef CONFIG_LOCKUP_DETECTOR 402 /* 403 * Ok, so this is none of the documented NMI sources, 404 * so it must be the NMI watchdog. 405 */ 406 if (nmi_watchdog_tick(regs, reason)) 407 return; 408 if (!do_nmi_callback(regs, cpu)) 409#endif /* !CONFIG_LOCKUP_DETECTOR */ 410 unknown_nmi_error(reason, regs); 411#else 412 unknown_nmi_error(reason, regs); | |
413#endif | 409#endif |
410 unknown_nmi_error(reason, regs); |
|
414 415 return; 416 } 417 if (notify_die(DIE_NMI, "nmi", regs, reason, 2, SIGINT) == NOTIFY_STOP) 418 return; 419 420 /* AK: following checks seem to be broken on modern chipsets. FIXME */ 421 if (reason & 0x80) --- 19 unchanged lines hidden (view full) --- 441 if (!ignore_nmis) 442 default_do_nmi(regs); 443 444 nmi_exit(); 445} 446 447void stop_nmi(void) 448{ | 411 412 return; 413 } 414 if (notify_die(DIE_NMI, "nmi", regs, reason, 2, SIGINT) == NOTIFY_STOP) 415 return; 416 417 /* AK: following checks seem to be broken on modern chipsets. FIXME */ 418 if (reason & 0x80) --- 19 unchanged lines hidden (view full) --- 438 if (!ignore_nmis) 439 default_do_nmi(regs); 440 441 nmi_exit(); 442} 443 444void stop_nmi(void) 445{ |
449 acpi_nmi_disable(); | |
450 ignore_nmis++; 451} 452 453void restart_nmi(void) 454{ 455 ignore_nmis--; | 446 ignore_nmis++; 447} 448 449void restart_nmi(void) 450{ 451 ignore_nmis--; |
456 acpi_nmi_enable(); | |
457} 458 459/* May run on IST stack. */ 460dotraplinkage void __kprobes do_int3(struct pt_regs *regs, long error_code) 461{ 462#ifdef CONFIG_KGDB_LOW_LEVEL_TRAP 463 if (kgdb_ll_trap(DIE_INT3, "int3", regs, error_code, 3, SIGTRAP) 464 == NOTIFY_STOP) --- 420 unchanged lines hidden --- | 452} 453 454/* May run on IST stack. */ 455dotraplinkage void __kprobes do_int3(struct pt_regs *regs, long error_code) 456{ 457#ifdef CONFIG_KGDB_LOW_LEVEL_TRAP 458 if (kgdb_ll_trap(DIE_INT3, "int3", regs, error_code, 3, SIGTRAP) 459 == NOTIFY_STOP) --- 420 unchanged lines hidden --- |