--- zzzz-none-000/linux-4.4.60/kernel/panic.c 2017-04-08 07:53:53.000000000 +0000 +++ scorpion-7490-727/linux-4.4.60/kernel/panic.c 2021-02-04 17:41:59.000000000 +0000 @@ -25,6 +25,16 @@ #include #include +#define CREATE_TRACE_POINTS +#include + +#if defined(CONFIG_AVM_FASTIRQ) +#include +#include + +void avm_die_panic_handling(const char *str, struct pt_regs *regs); +#endif + #define PANIC_TIMER_STEP 100 #define PANIC_BLINK_SPD 18 @@ -43,6 +53,7 @@ EXPORT_SYMBOL(panic_notifier_list); +#if !defined(CONFIG_AVM_FASTIRQ) static long no_blink(int state) { return 0; @@ -51,6 +62,7 @@ /* Returns how long it waited in ms */ long (*panic_blink)(int state); EXPORT_SYMBOL(panic_blink); +#endif /* * Stop ourself in panic -- architecture code may override this @@ -69,6 +81,25 @@ * * This function never returns. */ +#if defined(CONFIG_AVM_FASTIRQ) +void panic(const char *fmt, ...) +{ + static char buf[1024]; + va_list args; + +#ifdef CONFIG_AVM_DEBUG + printk_avm_console_bend(0); +#endif + va_start(args, fmt); + vsnprintf(buf, sizeof(buf), fmt, args); + va_end(args); + printk( KERN_INFO "Generic panic() handling triggers AVM WD ...\n" ); + avm_die_panic_handling(buf, NULL); + + while(1){ + } +} +#else void panic(const char *fmt, ...) { static DEFINE_SPINLOCK(panic_lock); @@ -77,6 +108,7 @@ long i, i_next = 0; int state = 0; + trace_kernel_panic(0); /* * Disable local interrupts. This will prevent panic_smp_self_stop * from deadlocking the first cpu that invokes the panic, since @@ -121,6 +153,18 @@ if (!crash_kexec_post_notifiers) crash_kexec(NULL); +#if defined(CONFIG_AVM_FASTIRQ) + /*--- der notifier will auch noch was dumpen! ---*/ + atomic_notifier_call_chain(&panic_notifier_list, 0, buf); + kmsg_dump(KMSG_DUMP_PANIC); + + /* + * Note smp_send_stop is the usual smp shutdown function, which + * unfortunately means it may not be hardened to work in a panic + * situation. + */ + smp_send_stop(); +#else /* * Note smp_send_stop is the usual smp shutdown function, which * unfortunately means it may not be hardened to work in a panic @@ -135,6 +179,7 @@ atomic_notifier_call_chain(&panic_notifier_list, 0, buf); kmsg_dump(KMSG_DUMP_PANIC); +#endif/*--- #else ---*//*--- #if defined(CONFIG_AVM_FASTIRQ) ---*/ /* * If you doubt kdump always works fine in any situation, @@ -178,6 +223,9 @@ mdelay(PANIC_TIMER_STEP); } } + + trace_kernel_panic_late(0); + if (panic_timeout != 0) { /* * This will not be a clean reboot, with everything @@ -213,6 +261,7 @@ mdelay(PANIC_TIMER_STEP); } } +#endif EXPORT_SYMBOL(panic); @@ -240,6 +289,7 @@ { TAINT_UNSIGNED_MODULE, 'E', ' ' }, { TAINT_SOFTLOCKUP, 'L', ' ' }, { TAINT_LIVEPATCH, 'K', ' ' }, + { TAINT_ALLOC_FAIL, 'Z', ' ' }, }; /**