diff options
author | Keith Owens <kaos@sgi.com> | 2006-04-03 01:26:12 -0400 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2006-04-08 01:51:51 -0400 |
commit | 958b166c00b39ff0b28ad2bbb32624b9f305a4e1 (patch) | |
tree | 9a7d086f44e4fc034f1f91eed945ef4eabc5fa0c /arch/ia64 | |
parent | 2db8d99ffdbed7d2beb1bbdefdcd086dda9dee98 (diff) |
[IA64] Pass more data to the MCA/INIT notify_die hooks
The MCA/INIT handlers maintain important state in the SAL to OS (sos)
area and in the monarch_cpu flag. Kernel debuggers (such as KDB) need
this data, and may need to adjust the monarch_cpu field so make the
data available to the notify_die hooks. Define two more events for
calling the functions on the notify_die chain.
Signed-off-by: Keith Owens <kaos@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64')
-rw-r--r-- | arch/ia64/kernel/mca.c | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c index 8963171788d5..5e6fdbe78bcd 100644 --- a/arch/ia64/kernel/mca.c +++ b/arch/ia64/kernel/mca.c | |||
@@ -581,10 +581,12 @@ ia64_mca_rendez_int_handler(int rendez_irq, void *arg, struct pt_regs *regs) | |||
581 | { | 581 | { |
582 | unsigned long flags; | 582 | unsigned long flags; |
583 | int cpu = smp_processor_id(); | 583 | int cpu = smp_processor_id(); |
584 | struct ia64_mca_notify_die nd = | ||
585 | { .sos = NULL, .monarch_cpu = &monarch_cpu }; | ||
584 | 586 | ||
585 | /* Mask all interrupts */ | 587 | /* Mask all interrupts */ |
586 | local_irq_save(flags); | 588 | local_irq_save(flags); |
587 | if (notify_die(DIE_MCA_RENDZVOUS_ENTER, "MCA", regs, 0, 0, 0) | 589 | if (notify_die(DIE_MCA_RENDZVOUS_ENTER, "MCA", regs, (long)&nd, 0, 0) |
588 | == NOTIFY_STOP) | 590 | == NOTIFY_STOP) |
589 | ia64_mca_spin(__FUNCTION__); | 591 | ia64_mca_spin(__FUNCTION__); |
590 | 592 | ||
@@ -594,7 +596,7 @@ ia64_mca_rendez_int_handler(int rendez_irq, void *arg, struct pt_regs *regs) | |||
594 | */ | 596 | */ |
595 | ia64_sal_mc_rendez(); | 597 | ia64_sal_mc_rendez(); |
596 | 598 | ||
597 | if (notify_die(DIE_MCA_RENDZVOUS_PROCESS, "MCA", regs, 0, 0, 0) | 599 | if (notify_die(DIE_MCA_RENDZVOUS_PROCESS, "MCA", regs, (long)&nd, 0, 0) |
598 | == NOTIFY_STOP) | 600 | == NOTIFY_STOP) |
599 | ia64_mca_spin(__FUNCTION__); | 601 | ia64_mca_spin(__FUNCTION__); |
600 | 602 | ||
@@ -602,7 +604,7 @@ ia64_mca_rendez_int_handler(int rendez_irq, void *arg, struct pt_regs *regs) | |||
602 | while (monarch_cpu != -1) | 604 | while (monarch_cpu != -1) |
603 | cpu_relax(); /* spin until monarch leaves */ | 605 | cpu_relax(); /* spin until monarch leaves */ |
604 | 606 | ||
605 | if (notify_die(DIE_MCA_RENDZVOUS_LEAVE, "MCA", regs, 0, 0, 0) | 607 | if (notify_die(DIE_MCA_RENDZVOUS_LEAVE, "MCA", regs, (long)&nd, 0, 0) |
606 | == NOTIFY_STOP) | 608 | == NOTIFY_STOP) |
607 | ia64_mca_spin(__FUNCTION__); | 609 | ia64_mca_spin(__FUNCTION__); |
608 | 610 | ||
@@ -1023,6 +1025,8 @@ ia64_mca_handler(struct pt_regs *regs, struct switch_stack *sw, | |||
1023 | &sos->proc_state_param; | 1025 | &sos->proc_state_param; |
1024 | int recover, cpu = smp_processor_id(); | 1026 | int recover, cpu = smp_processor_id(); |
1025 | task_t *previous_current; | 1027 | task_t *previous_current; |
1028 | struct ia64_mca_notify_die nd = | ||
1029 | { .sos = sos, .monarch_cpu = &monarch_cpu }; | ||
1026 | 1030 | ||
1027 | oops_in_progress = 1; /* FIXME: make printk NMI/MCA/INIT safe */ | 1031 | oops_in_progress = 1; /* FIXME: make printk NMI/MCA/INIT safe */ |
1028 | console_loglevel = 15; /* make sure printks make it to console */ | 1032 | console_loglevel = 15; /* make sure printks make it to console */ |
@@ -1031,7 +1035,7 @@ ia64_mca_handler(struct pt_regs *regs, struct switch_stack *sw, | |||
1031 | 1035 | ||
1032 | previous_current = ia64_mca_modify_original_stack(regs, sw, sos, "MCA"); | 1036 | previous_current = ia64_mca_modify_original_stack(regs, sw, sos, "MCA"); |
1033 | monarch_cpu = cpu; | 1037 | monarch_cpu = cpu; |
1034 | if (notify_die(DIE_MCA_MONARCH_ENTER, "MCA", regs, 0, 0, 0) | 1038 | if (notify_die(DIE_MCA_MONARCH_ENTER, "MCA", regs, (long)&nd, 0, 0) |
1035 | == NOTIFY_STOP) | 1039 | == NOTIFY_STOP) |
1036 | ia64_mca_spin(__FUNCTION__); | 1040 | ia64_mca_spin(__FUNCTION__); |
1037 | ia64_wait_for_slaves(cpu); | 1041 | ia64_wait_for_slaves(cpu); |
@@ -1043,7 +1047,7 @@ ia64_mca_handler(struct pt_regs *regs, struct switch_stack *sw, | |||
1043 | * spinning in SAL does not work. | 1047 | * spinning in SAL does not work. |
1044 | */ | 1048 | */ |
1045 | ia64_mca_wakeup_all(); | 1049 | ia64_mca_wakeup_all(); |
1046 | if (notify_die(DIE_MCA_MONARCH_PROCESS, "MCA", regs, 0, 0, 0) | 1050 | if (notify_die(DIE_MCA_MONARCH_PROCESS, "MCA", regs, (long)&nd, 0, 0) |
1047 | == NOTIFY_STOP) | 1051 | == NOTIFY_STOP) |
1048 | ia64_mca_spin(__FUNCTION__); | 1052 | ia64_mca_spin(__FUNCTION__); |
1049 | 1053 | ||
@@ -1064,7 +1068,7 @@ ia64_mca_handler(struct pt_regs *regs, struct switch_stack *sw, | |||
1064 | ia64_sal_clear_state_info(SAL_INFO_TYPE_MCA); | 1068 | ia64_sal_clear_state_info(SAL_INFO_TYPE_MCA); |
1065 | sos->os_status = IA64_MCA_CORRECTED; | 1069 | sos->os_status = IA64_MCA_CORRECTED; |
1066 | } | 1070 | } |
1067 | if (notify_die(DIE_MCA_MONARCH_LEAVE, "MCA", regs, 0, 0, recover) | 1071 | if (notify_die(DIE_MCA_MONARCH_LEAVE, "MCA", regs, (long)&nd, 0, recover) |
1068 | == NOTIFY_STOP) | 1072 | == NOTIFY_STOP) |
1069 | ia64_mca_spin(__FUNCTION__); | 1073 | ia64_mca_spin(__FUNCTION__); |
1070 | 1074 | ||
@@ -1351,10 +1355,14 @@ ia64_init_handler(struct pt_regs *regs, struct switch_stack *sw, | |||
1351 | static atomic_t monarchs; | 1355 | static atomic_t monarchs; |
1352 | task_t *previous_current; | 1356 | task_t *previous_current; |
1353 | int cpu = smp_processor_id(); | 1357 | int cpu = smp_processor_id(); |
1358 | struct ia64_mca_notify_die nd = | ||
1359 | { .sos = sos, .monarch_cpu = &monarch_cpu }; | ||
1354 | 1360 | ||
1355 | oops_in_progress = 1; /* FIXME: make printk NMI/MCA/INIT safe */ | 1361 | oops_in_progress = 1; /* FIXME: make printk NMI/MCA/INIT safe */ |
1356 | console_loglevel = 15; /* make sure printks make it to console */ | 1362 | console_loglevel = 15; /* make sure printks make it to console */ |
1357 | 1363 | ||
1364 | (void) notify_die(DIE_INIT_ENTER, "INIT", regs, (long)&nd, 0, 0); | ||
1365 | |||
1358 | printk(KERN_INFO "Entered OS INIT handler. PSP=%lx cpu=%d monarch=%ld\n", | 1366 | printk(KERN_INFO "Entered OS INIT handler. PSP=%lx cpu=%d monarch=%ld\n", |
1359 | sos->proc_state_param, cpu, sos->monarch); | 1367 | sos->proc_state_param, cpu, sos->monarch); |
1360 | salinfo_log_wakeup(SAL_INFO_TYPE_INIT, NULL, 0, 0); | 1368 | salinfo_log_wakeup(SAL_INFO_TYPE_INIT, NULL, 0, 0); |
@@ -1390,15 +1398,15 @@ ia64_init_handler(struct pt_regs *regs, struct switch_stack *sw, | |||
1390 | ia64_mc_info.imi_rendez_checkin[cpu] = IA64_MCA_RENDEZ_CHECKIN_INIT; | 1398 | ia64_mc_info.imi_rendez_checkin[cpu] = IA64_MCA_RENDEZ_CHECKIN_INIT; |
1391 | while (monarch_cpu == -1) | 1399 | while (monarch_cpu == -1) |
1392 | cpu_relax(); /* spin until monarch enters */ | 1400 | cpu_relax(); /* spin until monarch enters */ |
1393 | if (notify_die(DIE_INIT_SLAVE_ENTER, "INIT", regs, 0, 0, 0) | 1401 | if (notify_die(DIE_INIT_SLAVE_ENTER, "INIT", regs, (long)&nd, 0, 0) |
1394 | == NOTIFY_STOP) | 1402 | == NOTIFY_STOP) |
1395 | ia64_mca_spin(__FUNCTION__); | 1403 | ia64_mca_spin(__FUNCTION__); |
1396 | if (notify_die(DIE_INIT_SLAVE_PROCESS, "INIT", regs, 0, 0, 0) | 1404 | if (notify_die(DIE_INIT_SLAVE_PROCESS, "INIT", regs, (long)&nd, 0, 0) |
1397 | == NOTIFY_STOP) | 1405 | == NOTIFY_STOP) |
1398 | ia64_mca_spin(__FUNCTION__); | 1406 | ia64_mca_spin(__FUNCTION__); |
1399 | while (monarch_cpu != -1) | 1407 | while (monarch_cpu != -1) |
1400 | cpu_relax(); /* spin until monarch leaves */ | 1408 | cpu_relax(); /* spin until monarch leaves */ |
1401 | if (notify_die(DIE_INIT_SLAVE_LEAVE, "INIT", regs, 0, 0, 0) | 1409 | if (notify_die(DIE_INIT_SLAVE_LEAVE, "INIT", regs, (long)&nd, 0, 0) |
1402 | == NOTIFY_STOP) | 1410 | == NOTIFY_STOP) |
1403 | ia64_mca_spin(__FUNCTION__); | 1411 | ia64_mca_spin(__FUNCTION__); |
1404 | printk("Slave on cpu %d returning to normal service.\n", cpu); | 1412 | printk("Slave on cpu %d returning to normal service.\n", cpu); |
@@ -1409,7 +1417,7 @@ ia64_init_handler(struct pt_regs *regs, struct switch_stack *sw, | |||
1409 | } | 1417 | } |
1410 | 1418 | ||
1411 | monarch_cpu = cpu; | 1419 | monarch_cpu = cpu; |
1412 | if (notify_die(DIE_INIT_MONARCH_ENTER, "INIT", regs, 0, 0, 0) | 1420 | if (notify_die(DIE_INIT_MONARCH_ENTER, "INIT", regs, (long)&nd, 0, 0) |
1413 | == NOTIFY_STOP) | 1421 | == NOTIFY_STOP) |
1414 | ia64_mca_spin(__FUNCTION__); | 1422 | ia64_mca_spin(__FUNCTION__); |
1415 | 1423 | ||
@@ -1426,10 +1434,10 @@ ia64_init_handler(struct pt_regs *regs, struct switch_stack *sw, | |||
1426 | * to default_monarch_init_process() above and just print all the | 1434 | * to default_monarch_init_process() above and just print all the |
1427 | * tasks. | 1435 | * tasks. |
1428 | */ | 1436 | */ |
1429 | if (notify_die(DIE_INIT_MONARCH_PROCESS, "INIT", regs, 0, 0, 0) | 1437 | if (notify_die(DIE_INIT_MONARCH_PROCESS, "INIT", regs, (long)&nd, 0, 0) |
1430 | == NOTIFY_STOP) | 1438 | == NOTIFY_STOP) |
1431 | ia64_mca_spin(__FUNCTION__); | 1439 | ia64_mca_spin(__FUNCTION__); |
1432 | if (notify_die(DIE_INIT_MONARCH_LEAVE, "INIT", regs, 0, 0, 0) | 1440 | if (notify_die(DIE_INIT_MONARCH_LEAVE, "INIT", regs, (long)&nd, 0, 0) |
1433 | == NOTIFY_STOP) | 1441 | == NOTIFY_STOP) |
1434 | ia64_mca_spin(__FUNCTION__); | 1442 | ia64_mca_spin(__FUNCTION__); |
1435 | printk("\nINIT dump complete. Monarch on cpu %d returning to normal service.\n", cpu); | 1443 | printk("\nINIT dump complete. Monarch on cpu %d returning to normal service.\n", cpu); |
@@ -1631,6 +1639,7 @@ ia64_mca_init(void) | |||
1631 | printk(KERN_INFO "Increasing MCA rendezvous timeout from " | 1639 | printk(KERN_INFO "Increasing MCA rendezvous timeout from " |
1632 | "%ld to %ld milliseconds\n", timeout, isrv.v0); | 1640 | "%ld to %ld milliseconds\n", timeout, isrv.v0); |
1633 | timeout = isrv.v0; | 1641 | timeout = isrv.v0; |
1642 | (void) notify_die(DIE_MCA_NEW_TIMEOUT, "MCA", NULL, timeout, 0, 0); | ||
1634 | continue; | 1643 | continue; |
1635 | } | 1644 | } |
1636 | printk(KERN_ERR "Failed to register rendezvous interrupt " | 1645 | printk(KERN_ERR "Failed to register rendezvous interrupt " |