10 #include <linux/kernel.h>
12 #include <linux/sched.h>
13 #include <linux/tty.h>
15 #include <linux/module.h>
22 #include <asm/intrinsics.h>
23 #include <asm/processor.h>
24 #include <asm/uaccess.h>
25 #include <asm/setup.h>
50 static int die_counter;
53 if (
die.lock_owner != cpu) {
55 spin_lock_irq(&
die.lock);
57 die.lock_owner_depth = 0;
62 if (++
die.lock_owner_depth < 3) {
63 printk(
"%s[%d]: %s %ld [%d]\n",
76 spin_unlock_irq(&
die.lock);
82 panic(
"Fatal exception");
92 return die(str, regs, err);
104 siginfo.si_imm = break_num;
105 siginfo.si_flags = 0;
162 case 0x3f000 ... 0x3ffff:
167 if ((break_num < 0x40000 || break_num > 0x100000)
171 if (break_num < 0x80000) {
237 fp_emulate (
int fp_fault,
void *bundle,
long *ipsr,
long *
fpsr,
long *
isr,
long *
pr,
long *
ifs,
243 if (!fpswa_interface)
267 ret = (*fpswa_interface->
fpswa)((
unsigned long) fp_fault, bundle,
268 (
unsigned long *) ipsr, (
unsigned long *) fpsr,
269 (
unsigned long *) isr, (
unsigned long *) pr,
270 (
unsigned long *) ifs, &fp_state);
288 handle_fpu_swa (
int fp_fault,
struct pt_regs *regs,
unsigned long isr)
291 unsigned long fault_ip;
295 if (!fp_fault && (
ia64_psr(regs)->ri == 0))
297 if (
copy_from_user(bundle, (
void __user *) fault_ip,
sizeof(bundle)))
308 cp->
time = current_jiffies + 5 *
HZ;
320 if (current_jiffies >
last.time)
325 last.time = current_jiffies + 5 *
HZ;
327 "%s(%d): floating-point assist fault at ip %016lx, isr %016lx\n",
333 exception = fp_emulate(fp_fault, bundle, ®s->
cr_ipsr, ®s->
ar_fpsr, &isr, ®s->
pr,
336 if (exception == 0) {
339 }
else if (exception == -1) {
353 }
else if (isr & 0x22) {
357 }
else if (isr & 0x44) {
366 if (exception == -1) {
369 }
else if (exception != 0) {
377 }
else if (isr & 0x1100) {
379 }
else if (isr & 0x2200) {
404 #ifdef CONFIG_IA64_BRL_EMU
409 if (rv.fkt != (
unsigned long) -1)
414 sprintf(
buf,
"IA-64 Illegal operation fault");
419 memset(&si, 0,
sizeof(si));
429 unsigned long iim,
unsigned long itir,
long arg5,
long arg6,
430 long arg7,
struct pt_regs regs)
436 static const char *
reason[] = {
437 "IA-64 Illegal Operation fault",
438 "IA-64 Privileged Operation fault",
439 "IA-64 Privileged Register fault",
440 "IA-64 Reserved Register/Field fault",
441 "Disabled Instruction Set Transition fault",
442 "Unknown fault 5",
"Unknown fault 6",
"Unknown fault 7",
"Illegal Hazard fault",
443 "Unknown fault 9",
"Unknown fault 10",
"Unknown fault 11",
"Unknown fault 12",
444 "Unknown fault 13",
"Unknown fault 14",
"Unknown fault 15"
460 code = (isr >> 4) & 0xf;
461 sprintf(buf,
"General Exception: %s%s", reason[code],
462 (code == 3) ? ((isr & (1
UL << 37))
463 ?
" (RSE access)" :
" (data access)") :
"");
465 # ifdef CONFIG_IA64_PRINT_HAZARDS
466 printk(
"%s[%d]: possible hazard @ ip=%016lx (pr = %016lx)\n",
476 disabled_fph_fault(®s);
479 sprintf(buf,
"Disabled FPL fault---not supposed to happen!");
486 if (((isr >> 4) & 0xf) == 2) {
490 addr = (
void __user *) ifa;
501 siginfo.si_addr =
addr;
504 siginfo.si_isr =
isr;
507 }
else if (ia64_done_with_exception(®s))
509 sprintf(buf,
"NaT consumption");
517 siginfo.si_addr = (
void __user *) iip;
520 siginfo.si_isr =
isr;
524 sprintf(buf,
"Unsupported data reference");
531 extern char __kernel_syscall_via_break[];
545 regs.
cr_iip = (
unsigned long) __kernel_syscall_via_break;
553 #ifdef CONFIG_ITANIUM
570 siginfo.si_addr = (
void __user *) ifa;
573 siginfo.si_isr =
isr;
579 result = handle_fpu_swa((vector == 32) ? 1 : 0, ®s, isr);
584 siginfo.si_addr = (
void __user *) iip;
586 siginfo.si_isr =
isr;
617 siginfo.si_flags = 0;
620 siginfo.si_addr = (
void __user *) iip;
624 sprintf(buf,
"Unimplemented Instruction Address fault");
637 printk(
KERN_ERR " iip - 0x%lx, ifa - 0x%lx, isr - 0x%lx, iim - 0x%lx\n",
643 sprintf(buf,
"IA-32 Interruption Fault (int 0x%lx)", isr >> 16);
647 sprintf(buf,
"Fault %lu", vector);