diff options
| -rw-r--r-- | arch/powerpc/include/asm/machdep.h | 1 | ||||
| -rw-r--r-- | arch/powerpc/include/asm/setup.h | 1 | ||||
| -rw-r--r-- | arch/powerpc/kernel/cpu_setup_power.S | 2 | ||||
| -rw-r--r-- | arch/powerpc/kernel/fadump.c | 22 | ||||
| -rw-r--r-- | arch/powerpc/kernel/setup-common.c | 27 | ||||
| -rw-r--r-- | arch/powerpc/perf/core-book3s.c | 4 | ||||
| -rw-r--r-- | arch/powerpc/platforms/ps3/setup.c | 15 | ||||
| -rw-r--r-- | arch/powerpc/platforms/pseries/setup.c | 1 | ||||
| -rw-r--r-- | arch/powerpc/xmon/xmon.c | 10 |
9 files changed, 54 insertions, 29 deletions
diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h index 73b92017b6d7..cd2fc1cc1cc7 100644 --- a/arch/powerpc/include/asm/machdep.h +++ b/arch/powerpc/include/asm/machdep.h | |||
| @@ -76,6 +76,7 @@ struct machdep_calls { | |||
| 76 | 76 | ||
| 77 | void __noreturn (*restart)(char *cmd); | 77 | void __noreturn (*restart)(char *cmd); |
| 78 | void __noreturn (*halt)(void); | 78 | void __noreturn (*halt)(void); |
| 79 | void (*panic)(char *str); | ||
| 79 | void (*cpu_die)(void); | 80 | void (*cpu_die)(void); |
| 80 | 81 | ||
| 81 | long (*time_init)(void); /* Optional, may be NULL */ | 82 | long (*time_init)(void); /* Optional, may be NULL */ |
diff --git a/arch/powerpc/include/asm/setup.h b/arch/powerpc/include/asm/setup.h index 257d23dbf55d..cf00ec26303a 100644 --- a/arch/powerpc/include/asm/setup.h +++ b/arch/powerpc/include/asm/setup.h | |||
| @@ -24,6 +24,7 @@ extern void reloc_got2(unsigned long); | |||
| 24 | 24 | ||
| 25 | void check_for_initrd(void); | 25 | void check_for_initrd(void); |
| 26 | void initmem_init(void); | 26 | void initmem_init(void); |
| 27 | void setup_panic(void); | ||
| 27 | #define ARCH_PANIC_TIMEOUT 180 | 28 | #define ARCH_PANIC_TIMEOUT 180 |
| 28 | 29 | ||
| 29 | #ifdef CONFIG_PPC_PSERIES | 30 | #ifdef CONFIG_PPC_PSERIES |
diff --git a/arch/powerpc/kernel/cpu_setup_power.S b/arch/powerpc/kernel/cpu_setup_power.S index 610955fe8b81..679bbe714e85 100644 --- a/arch/powerpc/kernel/cpu_setup_power.S +++ b/arch/powerpc/kernel/cpu_setup_power.S | |||
| @@ -102,6 +102,7 @@ _GLOBAL(__setup_cpu_power9) | |||
| 102 | li r0,0 | 102 | li r0,0 |
| 103 | mtspr SPRN_PSSCR,r0 | 103 | mtspr SPRN_PSSCR,r0 |
| 104 | mtspr SPRN_LPID,r0 | 104 | mtspr SPRN_LPID,r0 |
| 105 | mtspr SPRN_PID,r0 | ||
| 105 | mfspr r3,SPRN_LPCR | 106 | mfspr r3,SPRN_LPCR |
| 106 | LOAD_REG_IMMEDIATE(r4, LPCR_PECEDH | LPCR_PECE_HVEE | LPCR_HVICE | LPCR_HEIC) | 107 | LOAD_REG_IMMEDIATE(r4, LPCR_PECEDH | LPCR_PECE_HVEE | LPCR_HVICE | LPCR_HEIC) |
| 107 | or r3, r3, r4 | 108 | or r3, r3, r4 |
| @@ -126,6 +127,7 @@ _GLOBAL(__restore_cpu_power9) | |||
| 126 | li r0,0 | 127 | li r0,0 |
| 127 | mtspr SPRN_PSSCR,r0 | 128 | mtspr SPRN_PSSCR,r0 |
| 128 | mtspr SPRN_LPID,r0 | 129 | mtspr SPRN_LPID,r0 |
| 130 | mtspr SPRN_PID,r0 | ||
| 129 | mfspr r3,SPRN_LPCR | 131 | mfspr r3,SPRN_LPCR |
| 130 | LOAD_REG_IMMEDIATE(r4, LPCR_PECEDH | LPCR_PECE_HVEE | LPCR_HVICE | LPCR_HEIC) | 132 | LOAD_REG_IMMEDIATE(r4, LPCR_PECEDH | LPCR_PECE_HVEE | LPCR_HVICE | LPCR_HEIC) |
| 131 | or r3, r3, r4 | 133 | or r3, r3, r4 |
diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c index 04ea5c04fd24..3c2c2688918f 100644 --- a/arch/powerpc/kernel/fadump.c +++ b/arch/powerpc/kernel/fadump.c | |||
| @@ -1462,25 +1462,6 @@ static void fadump_init_files(void) | |||
| 1462 | return; | 1462 | return; |
| 1463 | } | 1463 | } |
| 1464 | 1464 | ||
| 1465 | static int fadump_panic_event(struct notifier_block *this, | ||
| 1466 | unsigned long event, void *ptr) | ||
| 1467 | { | ||
| 1468 | /* | ||
| 1469 | * If firmware-assisted dump has been registered then trigger | ||
| 1470 | * firmware-assisted dump and let firmware handle everything | ||
| 1471 | * else. If this returns, then fadump was not registered, so | ||
| 1472 | * go through the rest of the panic path. | ||
| 1473 | */ | ||
| 1474 | crash_fadump(NULL, ptr); | ||
| 1475 | |||
| 1476 | return NOTIFY_DONE; | ||
| 1477 | } | ||
| 1478 | |||
| 1479 | static struct notifier_block fadump_panic_block = { | ||
| 1480 | .notifier_call = fadump_panic_event, | ||
| 1481 | .priority = INT_MIN /* may not return; must be done last */ | ||
| 1482 | }; | ||
| 1483 | |||
| 1484 | /* | 1465 | /* |
| 1485 | * Prepare for firmware-assisted dump. | 1466 | * Prepare for firmware-assisted dump. |
| 1486 | */ | 1467 | */ |
| @@ -1513,9 +1494,6 @@ int __init setup_fadump(void) | |||
| 1513 | init_fadump_mem_struct(&fdm, fw_dump.reserve_dump_area_start); | 1494 | init_fadump_mem_struct(&fdm, fw_dump.reserve_dump_area_start); |
| 1514 | fadump_init_files(); | 1495 | fadump_init_files(); |
| 1515 | 1496 | ||
| 1516 | atomic_notifier_chain_register(&panic_notifier_list, | ||
| 1517 | &fadump_panic_block); | ||
| 1518 | |||
| 1519 | return 1; | 1497 | return 1; |
| 1520 | } | 1498 | } |
| 1521 | subsys_initcall(setup_fadump); | 1499 | subsys_initcall(setup_fadump); |
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index 2075322cd225..9d213542a48b 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c | |||
| @@ -704,6 +704,30 @@ int check_legacy_ioport(unsigned long base_port) | |||
| 704 | } | 704 | } |
| 705 | EXPORT_SYMBOL(check_legacy_ioport); | 705 | EXPORT_SYMBOL(check_legacy_ioport); |
| 706 | 706 | ||
| 707 | static int ppc_panic_event(struct notifier_block *this, | ||
| 708 | unsigned long event, void *ptr) | ||
| 709 | { | ||
| 710 | /* | ||
| 711 | * If firmware-assisted dump has been registered then trigger | ||
| 712 | * firmware-assisted dump and let firmware handle everything else. | ||
| 713 | */ | ||
| 714 | crash_fadump(NULL, ptr); | ||
| 715 | ppc_md.panic(ptr); /* May not return */ | ||
| 716 | return NOTIFY_DONE; | ||
| 717 | } | ||
| 718 | |||
| 719 | static struct notifier_block ppc_panic_block = { | ||
| 720 | .notifier_call = ppc_panic_event, | ||
| 721 | .priority = INT_MIN /* may not return; must be done last */ | ||
| 722 | }; | ||
| 723 | |||
| 724 | void __init setup_panic(void) | ||
| 725 | { | ||
| 726 | if (!ppc_md.panic) | ||
| 727 | return; | ||
| 728 | atomic_notifier_chain_register(&panic_notifier_list, &ppc_panic_block); | ||
| 729 | } | ||
| 730 | |||
| 707 | #ifdef CONFIG_CHECK_CACHE_COHERENCY | 731 | #ifdef CONFIG_CHECK_CACHE_COHERENCY |
| 708 | /* | 732 | /* |
| 709 | * For platforms that have configurable cache-coherency. This function | 733 | * For platforms that have configurable cache-coherency. This function |
| @@ -848,6 +872,9 @@ void __init setup_arch(char **cmdline_p) | |||
| 848 | /* Probe the machine type, establish ppc_md. */ | 872 | /* Probe the machine type, establish ppc_md. */ |
| 849 | probe_machine(); | 873 | probe_machine(); |
| 850 | 874 | ||
| 875 | /* Setup panic notifier if requested by the platform. */ | ||
| 876 | setup_panic(); | ||
| 877 | |||
| 851 | /* | 878 | /* |
| 852 | * Configure ppc_md.power_save (ppc32 only, 64-bit machines do | 879 | * Configure ppc_md.power_save (ppc32 only, 64-bit machines do |
| 853 | * it from their respective probe() function. | 880 | * it from their respective probe() function. |
diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c index 9e3da168d54c..153812966365 100644 --- a/arch/powerpc/perf/core-book3s.c +++ b/arch/powerpc/perf/core-book3s.c | |||
| @@ -1415,7 +1415,7 @@ static int collect_events(struct perf_event *group, int max_count, | |||
| 1415 | int n = 0; | 1415 | int n = 0; |
| 1416 | struct perf_event *event; | 1416 | struct perf_event *event; |
| 1417 | 1417 | ||
| 1418 | if (!is_software_event(group)) { | 1418 | if (group->pmu->task_ctx_nr == perf_hw_context) { |
| 1419 | if (n >= max_count) | 1419 | if (n >= max_count) |
| 1420 | return -1; | 1420 | return -1; |
| 1421 | ctrs[n] = group; | 1421 | ctrs[n] = group; |
| @@ -1423,7 +1423,7 @@ static int collect_events(struct perf_event *group, int max_count, | |||
| 1423 | events[n++] = group->hw.config; | 1423 | events[n++] = group->hw.config; |
| 1424 | } | 1424 | } |
| 1425 | list_for_each_entry(event, &group->sibling_list, group_entry) { | 1425 | list_for_each_entry(event, &group->sibling_list, group_entry) { |
| 1426 | if (!is_software_event(event) && | 1426 | if (event->pmu->task_ctx_nr == perf_hw_context && |
| 1427 | event->state != PERF_EVENT_STATE_OFF) { | 1427 | event->state != PERF_EVENT_STATE_OFF) { |
| 1428 | if (n >= max_count) | 1428 | if (n >= max_count) |
| 1429 | return -1; | 1429 | return -1; |
diff --git a/arch/powerpc/platforms/ps3/setup.c b/arch/powerpc/platforms/ps3/setup.c index 9dabea6e1443..6244bc849469 100644 --- a/arch/powerpc/platforms/ps3/setup.c +++ b/arch/powerpc/platforms/ps3/setup.c | |||
| @@ -104,6 +104,20 @@ static void __noreturn ps3_halt(void) | |||
| 104 | ps3_sys_manager_halt(); /* never returns */ | 104 | ps3_sys_manager_halt(); /* never returns */ |
| 105 | } | 105 | } |
| 106 | 106 | ||
| 107 | static void ps3_panic(char *str) | ||
| 108 | { | ||
| 109 | DBG("%s:%d %s\n", __func__, __LINE__, str); | ||
| 110 | |||
| 111 | smp_send_stop(); | ||
| 112 | printk("\n"); | ||
| 113 | printk(" System does not reboot automatically.\n"); | ||
| 114 | printk(" Please press POWER button.\n"); | ||
| 115 | printk("\n"); | ||
| 116 | |||
| 117 | while(1) | ||
| 118 | lv1_pause(1); | ||
| 119 | } | ||
| 120 | |||
| 107 | #if defined(CONFIG_FB_PS3) || defined(CONFIG_FB_PS3_MODULE) || \ | 121 | #if defined(CONFIG_FB_PS3) || defined(CONFIG_FB_PS3_MODULE) || \ |
| 108 | defined(CONFIG_PS3_FLASH) || defined(CONFIG_PS3_FLASH_MODULE) | 122 | defined(CONFIG_PS3_FLASH) || defined(CONFIG_PS3_FLASH_MODULE) |
| 109 | static void __init prealloc(struct ps3_prealloc *p) | 123 | static void __init prealloc(struct ps3_prealloc *p) |
| @@ -255,6 +269,7 @@ define_machine(ps3) { | |||
| 255 | .probe = ps3_probe, | 269 | .probe = ps3_probe, |
| 256 | .setup_arch = ps3_setup_arch, | 270 | .setup_arch = ps3_setup_arch, |
| 257 | .init_IRQ = ps3_init_IRQ, | 271 | .init_IRQ = ps3_init_IRQ, |
| 272 | .panic = ps3_panic, | ||
| 258 | .get_boot_time = ps3_get_boot_time, | 273 | .get_boot_time = ps3_get_boot_time, |
| 259 | .set_dabr = ps3_set_dabr, | 274 | .set_dabr = ps3_set_dabr, |
| 260 | .calibrate_decr = ps3_calibrate_decr, | 275 | .calibrate_decr = ps3_calibrate_decr, |
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c index 5f1beb8367ac..a8531e012658 100644 --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c | |||
| @@ -726,6 +726,7 @@ define_machine(pseries) { | |||
| 726 | .pcibios_fixup = pSeries_final_fixup, | 726 | .pcibios_fixup = pSeries_final_fixup, |
| 727 | .restart = rtas_restart, | 727 | .restart = rtas_restart, |
| 728 | .halt = rtas_halt, | 728 | .halt = rtas_halt, |
| 729 | .panic = rtas_os_term, | ||
| 729 | .get_boot_time = rtas_get_boot_time, | 730 | .get_boot_time = rtas_get_boot_time, |
| 730 | .get_rtc_time = rtas_get_rtc_time, | 731 | .get_rtc_time = rtas_get_rtc_time, |
| 731 | .set_rtc_time = rtas_set_rtc_time, | 732 | .set_rtc_time = rtas_set_rtc_time, |
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index 1b2d8cb49abb..cab24f549e7c 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c | |||
| @@ -1590,7 +1590,7 @@ static void print_bug_trap(struct pt_regs *regs) | |||
| 1590 | printf("kernel BUG at %s:%u!\n", | 1590 | printf("kernel BUG at %s:%u!\n", |
| 1591 | bug->file, bug->line); | 1591 | bug->file, bug->line); |
| 1592 | #else | 1592 | #else |
| 1593 | printf("kernel BUG at %p!\n", (void *)bug->bug_addr); | 1593 | printf("kernel BUG at %px!\n", (void *)bug->bug_addr); |
| 1594 | #endif | 1594 | #endif |
| 1595 | #endif /* CONFIG_BUG */ | 1595 | #endif /* CONFIG_BUG */ |
| 1596 | } | 1596 | } |
| @@ -2329,7 +2329,7 @@ static void dump_one_paca(int cpu) | |||
| 2329 | 2329 | ||
| 2330 | p = &paca[cpu]; | 2330 | p = &paca[cpu]; |
| 2331 | 2331 | ||
| 2332 | printf("paca for cpu 0x%x @ %p:\n", cpu, p); | 2332 | printf("paca for cpu 0x%x @ %px:\n", cpu, p); |
| 2333 | 2333 | ||
| 2334 | printf(" %-*s = %s\n", 20, "possible", cpu_possible(cpu) ? "yes" : "no"); | 2334 | printf(" %-*s = %s\n", 20, "possible", cpu_possible(cpu) ? "yes" : "no"); |
| 2335 | printf(" %-*s = %s\n", 20, "present", cpu_present(cpu) ? "yes" : "no"); | 2335 | printf(" %-*s = %s\n", 20, "present", cpu_present(cpu) ? "yes" : "no"); |
| @@ -2945,7 +2945,7 @@ static void show_task(struct task_struct *tsk) | |||
| 2945 | (tsk->exit_state & EXIT_DEAD) ? 'E' : | 2945 | (tsk->exit_state & EXIT_DEAD) ? 'E' : |
| 2946 | (tsk->state & TASK_INTERRUPTIBLE) ? 'S' : '?'; | 2946 | (tsk->state & TASK_INTERRUPTIBLE) ? 'S' : '?'; |
| 2947 | 2947 | ||
| 2948 | printf("%p %016lx %6d %6d %c %2d %s\n", tsk, | 2948 | printf("%px %016lx %6d %6d %c %2d %s\n", tsk, |
| 2949 | tsk->thread.ksp, | 2949 | tsk->thread.ksp, |
| 2950 | tsk->pid, tsk->parent->pid, | 2950 | tsk->pid, tsk->parent->pid, |
| 2951 | state, task_thread_info(tsk)->cpu, | 2951 | state, task_thread_info(tsk)->cpu, |
| @@ -2988,7 +2988,7 @@ static void show_pte(unsigned long addr) | |||
| 2988 | 2988 | ||
| 2989 | if (setjmp(bus_error_jmp) != 0) { | 2989 | if (setjmp(bus_error_jmp) != 0) { |
| 2990 | catch_memory_errors = 0; | 2990 | catch_memory_errors = 0; |
| 2991 | printf("*** Error dumping pte for task %p\n", tsk); | 2991 | printf("*** Error dumping pte for task %px\n", tsk); |
| 2992 | return; | 2992 | return; |
| 2993 | } | 2993 | } |
| 2994 | 2994 | ||
| @@ -3074,7 +3074,7 @@ static void show_tasks(void) | |||
| 3074 | 3074 | ||
| 3075 | if (setjmp(bus_error_jmp) != 0) { | 3075 | if (setjmp(bus_error_jmp) != 0) { |
| 3076 | catch_memory_errors = 0; | 3076 | catch_memory_errors = 0; |
| 3077 | printf("*** Error dumping task %p\n", tsk); | 3077 | printf("*** Error dumping task %px\n", tsk); |
| 3078 | return; | 3078 | return; |
| 3079 | } | 3079 | } |
| 3080 | 3080 | ||
