From d9202429e60d16d39c427cd4e4408cf1827ab9e9 Mon Sep 17 00:00:00 2001 From: Russell King Date: Sun, 17 Jun 2007 13:38:27 +0100 Subject: [ARM] Add support for pause_on_oops and display preempt/smp options Add calls to oops_enter() and oops_exit() to __die(), so that things like lockdep know when an oops occurs. Add suffixes to the oops report to indicate whether the running kernel has been built with preempt or smp support. Signed-off-by: Russell King --- arch/arm/kernel/traps.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index 10ff36e4e414..1b68d365d0e1 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c @@ -204,12 +204,24 @@ void show_stack(struct task_struct *tsk, unsigned long *sp) barrier(); } +#ifdef CONFIG_PREEMPT +#define S_PREEMPT " PREEMPT" +#else +#define S_PREEMPT "" +#endif +#ifdef CONFIG_SMP +#define S_SMP " SMP" +#else +#define S_SMP "" +#endif + static void __die(const char *str, int err, struct thread_info *thread, struct pt_regs *regs) { struct task_struct *tsk = thread->task; static int die_counter; - printk("Internal error: %s: %x [#%d]\n", str, err, ++die_counter); + printk("Internal error: %s: %x [#%d]" S_PREEMPT S_SMP "\n", + str, err, ++die_counter); print_modules(); __show_regs(regs); printk("Process %s (pid: %d, stack limit = 0x%p)\n", @@ -232,6 +244,8 @@ NORET_TYPE void die(const char *str, struct pt_regs *regs, int err) { struct thread_info *thread = current_thread_info(); + oops_enter(); + console_verbose(); spin_lock_irq(&die_lock); bust_spinlocks(1); @@ -239,9 +253,13 @@ NORET_TYPE void die(const char *str, struct pt_regs *regs, int err) bust_spinlocks(0); spin_unlock_irq(&die_lock); + if (in_interrupt()) + panic("Fatal exception in interrupt"); + if (panic_on_oops) panic("Fatal exception"); + oops_exit(); do_exit(SIGSEGV); } -- cgit v1.2.3 From 154c772ebfb12ef66855510e6be2b12c85110b0c Mon Sep 17 00:00:00 2001 From: Russell King Date: Mon, 18 Jun 2007 14:59:45 +0100 Subject: [ARM] Update show_regs/oops register format Add the kernel release and version information to the output of show_regs/oops. Add the CPU PSR register. Avoid using printk to output partial lines; always output a complete line. Re-combine the "Control" and "Table + DAC" lines after nommu separated them; we don't want to waste vertical screen space needlessly. Signed-off-by: Russell King --- arch/arm/kernel/process.c | 63 ++++++++++++++++++++++++++--------------------- include/asm-arm/ptrace.h | 3 --- 2 files changed, 35 insertions(+), 31 deletions(-) diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index 5d6e6523598b..842361777d4e 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -199,16 +200,19 @@ void machine_restart(char * __unused) void __show_regs(struct pt_regs *regs) { - unsigned long flags = condition_codes(regs); + unsigned long flags; + char buf[64]; - printk("CPU: %d\n", smp_processor_id()); + printk("CPU: %d %s (%s %.*s)\n", + smp_processor_id(), print_tainted(), init_utsname()->release, + (int)strcspn(init_utsname()->version, " "), + init_utsname()->version); print_symbol("PC is at %s\n", instruction_pointer(regs)); print_symbol("LR is at %s\n", regs->ARM_lr); - printk("pc : [<%08lx>] lr : [<%08lx>] %s\n" + printk("pc : [<%08lx>] lr : [<%08lx>] psr: %08lx\n" "sp : %08lx ip : %08lx fp : %08lx\n", - instruction_pointer(regs), - regs->ARM_lr, print_tainted(), regs->ARM_sp, - regs->ARM_ip, regs->ARM_fp); + regs->ARM_pc, regs->ARM_lr, regs->ARM_cpsr, + regs->ARM_sp, regs->ARM_ip, regs->ARM_fp); printk("r10: %08lx r9 : %08lx r8 : %08lx\n", regs->ARM_r10, regs->ARM_r9, regs->ARM_r8); @@ -218,36 +222,39 @@ void __show_regs(struct pt_regs *regs) printk("r3 : %08lx r2 : %08lx r1 : %08lx r0 : %08lx\n", regs->ARM_r3, regs->ARM_r2, regs->ARM_r1, regs->ARM_r0); - printk("Flags: %c%c%c%c", - flags & PSR_N_BIT ? 'N' : 'n', - flags & PSR_Z_BIT ? 'Z' : 'z', - flags & PSR_C_BIT ? 'C' : 'c', - flags & PSR_V_BIT ? 'V' : 'v'); - printk(" IRQs o%s FIQs o%s Mode %s%s Segment %s\n", - interrupts_enabled(regs) ? "n" : "ff", + + flags = regs->ARM_cpsr; + buf[0] = flags & PSR_N_BIT ? 'N' : 'n'; + buf[1] = flags & PSR_Z_BIT ? 'Z' : 'z'; + buf[2] = flags & PSR_C_BIT ? 'C' : 'c'; + buf[3] = flags & PSR_V_BIT ? 'V' : 'v'; + buf[4] = '\0'; + + printk("Flags: %s IRQs o%s FIQs o%s Mode %s%s Segment %s\n", + buf, interrupts_enabled(regs) ? "n" : "ff", fast_interrupts_enabled(regs) ? "n" : "ff", processor_modes[processor_mode(regs)], thumb_mode(regs) ? " (T)" : "", get_fs() == get_ds() ? "kernel" : "user"); -#if CONFIG_CPU_CP15 +#ifdef CONFIG_CPU_CP15 { unsigned int ctrl; - __asm__ ( - " mrc p15, 0, %0, c1, c0\n" - : "=r" (ctrl)); - printk("Control: %04X\n", ctrl); - } + + buf[0] = '\0'; #ifdef CONFIG_CPU_CP15_MMU - { - unsigned int transbase, dac; - __asm__ ( - " mrc p15, 0, %0, c2, c0\n" - " mrc p15, 0, %1, c3, c0\n" - : "=r" (transbase), "=r" (dac)); - printk("Table: %08X DAC: %08X\n", - transbase, dac); - } + { + unsigned int transbase, dac; + asm("mrc p15, 0, %0, c2, c0\n\t" + "mrc p15, 0, %1, c3, c0\n" + : "=r" (transbase), "=r" (dac)); + snprintf(buf, sizeof(buf), " Table: %08x DAC: %08x", + transbase, dac); + } #endif + asm("mrc p15, 0, %0, c1, c0\n" : "=r" (ctrl)); + + printk("Control: %08x%s\n", ctrl, buf); + } #endif } diff --git a/include/asm-arm/ptrace.h b/include/asm-arm/ptrace.h index 2d0dad8c10ac..ee3d93c281d8 100644 --- a/include/asm-arm/ptrace.h +++ b/include/asm-arm/ptrace.h @@ -112,9 +112,6 @@ struct pt_regs { #define fast_interrupts_enabled(regs) \ (!((regs)->ARM_cpsr & PSR_F_BIT)) -#define condition_codes(regs) \ - ((regs)->ARM_cpsr & (PSR_V_BIT|PSR_C_BIT|PSR_Z_BIT|PSR_N_BIT)) - /* Are the current registers suitable for user mode? * (used to maintain security in signal handlers) */ -- cgit v1.2.3 From 92c83ff1ce6165bd62cebe4e4d1ca5ccb6f9713b Mon Sep 17 00:00:00 2001 From: Catalin Marinas Date: Fri, 22 Jun 2007 14:27:50 +0100 Subject: [ARM] 4452/1: Force the literal pool dump before reloc_end In the arch/arm/boot/compressed/head.S file, the contents of the literal pool accumulated during the relocatable code must be dumped before reloc_end. Signed-off-by: Catalin Marinas Signed-off-by: Russell King --- arch/arm/boot/compressed/head.S | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S index 23348e9561b9..680ea6ed77b8 100644 --- a/arch/arm/boot/compressed/head.S +++ b/arch/arm/boot/compressed/head.S @@ -836,6 +836,7 @@ memdump: mov r12, r0 mov pc, r10 #endif + .ltorg reloc_end: .align -- cgit v1.2.3 From 0c07f6115b779ae4597749d47dec228c6d2d1c7c Mon Sep 17 00:00:00 2001 From: Nicolas Pitre Date: Wed, 20 Jun 2007 19:10:34 +0100 Subject: [ARM] 4449/1: more entries in arch/arm/boot/.gitignore Signed-off-by: Nicolas Pitre Signed-off-by: Russell King --- arch/arm/boot/.gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/boot/.gitignore b/arch/arm/boot/.gitignore index 171a0853caf8..ce1c5ff746e7 100644 --- a/arch/arm/boot/.gitignore +++ b/arch/arm/boot/.gitignore @@ -1,2 +1,5 @@ Image zImage +xipImage +bootpImage +uImage -- cgit v1.2.3