* [PATCH] powerpc: print DAR and DSISR on machine check oopses
@ 2013-11-15 4:41 Anton Blanchard
2013-11-15 4:48 ` [PATCH] powerpc: Remove a few lines of oops output Anton Blanchard
0 siblings, 1 reply; 3+ messages in thread
From: Anton Blanchard @ 2013-11-15 4:41 UTC (permalink / raw)
To: benh, paulus, mikey; +Cc: linuxppc-dev
Machine check exceptions set DAR and DSISR, so print them in our
oops output.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: b/arch/powerpc/kernel/process.c
===================================================================
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -864,7 +864,7 @@ void show_regs(struct pt_regs * regs)
trap = TRAP(regs);
if ((regs->trap != 0xc00) && cpu_has_feature(CPU_FTR_CFAR))
printk("CFAR: "REG"\n", regs->orig_gpr3);
- if (trap == 0x300 || trap == 0x600)
+ if (trap == 0x200 || trap == 0x300 || trap == 0x600)
#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
printk("DEAR: "REG", ESR: "REG"\n", regs->dar, regs->dsisr);
#else
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] powerpc: Remove a few lines of oops output
2013-11-15 4:41 [PATCH] powerpc: print DAR and DSISR on machine check oopses Anton Blanchard
@ 2013-11-15 4:48 ` Anton Blanchard
2013-11-15 5:05 ` Michael Neuling
0 siblings, 1 reply; 3+ messages in thread
From: Anton Blanchard @ 2013-11-15 4:48 UTC (permalink / raw)
To: benh, paulus, mikey; +Cc: linuxppc-dev
We waste quite a few lines in our oops output:
...
MSR: 8000000000009032 <SF,EE,ME,IR,DR,RI> CR: 28044024 XER: 00000000
SOFTE: 0
CFAR: 0000000000009088
DAR: 000000000000001c, DSISR: 40000000
GPR00: c0000000000c74f0 c00000037cc1b010 c000000000d2bb30 0000000000000000
...
We can do a better job here and remove 3 lines:
MSR: 8000000000009032 <SF,EE,ME,IR,DR,RI> CR: 28044024 XER: 00000000
CFAR: 0000000000009088 DAR: 0000000000000010, DSISR: 40000000 SOFTE: 1
GPR00: c0000000000e3d10 c00000037cc2fda0 c000000000d2c3a8 0000000000000001
Also move PACATMSCRATCH up, it doesn't really belong in the stack
trace section.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
PACATMSCRATCH is a long and not very descriptive name. It appears to be
an MSR so should it instead be called TM_MSR?
Also, could we save a line and only print it if MSR_TM_ACTIVE()?
Index: b/arch/powerpc/kernel/process.c
===================================================================
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -858,17 +858,20 @@ void show_regs(struct pt_regs * regs)
printk("MSR: "REG" ", regs->msr);
printbits(regs->msr, msr_bits);
printk(" CR: %08lx XER: %08lx\n", regs->ccr, regs->xer);
-#ifdef CONFIG_PPC64
- printk("SOFTE: %ld\n", regs->softe);
-#endif
trap = TRAP(regs);
if ((regs->trap != 0xc00) && cpu_has_feature(CPU_FTR_CFAR))
- printk("CFAR: "REG"\n", regs->orig_gpr3);
+ printk("CFAR: "REG" ", regs->orig_gpr3);
if (trap == 0x200 || trap == 0x300 || trap == 0x600)
#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
- printk("DEAR: "REG", ESR: "REG"\n", regs->dar, regs->dsisr);
+ printk("DEAR: "REG" ESR: "REG" ", regs->dar, regs->dsisr);
#else
- printk("DAR: "REG", DSISR: %08lx\n", regs->dar, regs->dsisr);
+ printk("DAR: "REG" DSISR: %08lx ", regs->dar, regs->dsisr);
+#endif
+#ifdef CONFIG_PPC64
+ printk("SOFTE: %ld ", regs->softe);
+#endif
+#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
+ printk("\nPACATMSCRATCH: %016llx ", get_paca()->tm_scratch);
#endif
for (i = 0; i < 32; i++) {
@@ -887,9 +890,6 @@ void show_regs(struct pt_regs * regs)
printk("NIP ["REG"] %pS\n", regs->nip, (void *)regs->nip);
printk("LR ["REG"] %pS\n", regs->link, (void *)regs->link);
#endif
-#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
- printk("PACATMSCRATCH [%llx]\n", get_paca()->tm_scratch);
-#endif
show_stack(current, (unsigned long *) regs->gpr[1]);
if (!user_mode(regs))
show_instructions(regs);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] powerpc: Remove a few lines of oops output
2013-11-15 4:48 ` [PATCH] powerpc: Remove a few lines of oops output Anton Blanchard
@ 2013-11-15 5:05 ` Michael Neuling
0 siblings, 0 replies; 3+ messages in thread
From: Michael Neuling @ 2013-11-15 5:05 UTC (permalink / raw)
To: Anton Blanchard; +Cc: paulus, linuxppc-dev
Anton Blanchard <anton@samba.org> wrote:
>
> We waste quite a few lines in our oops output:
>
> ...
> MSR: 8000000000009032 <SF,EE,ME,IR,DR,RI> CR: 28044024 XER: 00000000
> SOFTE: 0
> CFAR: 0000000000009088
> DAR: 000000000000001c, DSISR: 40000000
>
> GPR00: c0000000000c74f0 c00000037cc1b010 c000000000d2bb30 0000000000000000
> ...
>
> We can do a better job here and remove 3 lines:
>
> MSR: 8000000000009032 <SF,EE,ME,IR,DR,RI> CR: 28044024 XER: 00000000
> CFAR: 0000000000009088 DAR: 0000000000000010, DSISR: 40000000 SOFTE: 1
> GPR00: c0000000000e3d10 c00000037cc2fda0 c000000000d2c3a8 0000000000000001
>
> Also move PACATMSCRATCH up, it doesn't really belong in the stack
> trace section.
>
I like it.
> Signed-off-by: Anton Blanchard <anton@samba.org>
> ---
>
> PACATMSCRATCH is a long and not very descriptive name. It appears to be
> an MSR so should it instead be called TM_MSR?
We also use it to store the stack point in the reclaim code.
> Also, could we save a line and only print it if MSR_TM_ACTIVE()?
Yeah that would be fine.
Mikey
>
> Index: b/arch/powerpc/kernel/process.c
> ===================================================================
> --- a/arch/powerpc/kernel/process.c
> +++ b/arch/powerpc/kernel/process.c
> @@ -858,17 +858,20 @@ void show_regs(struct pt_regs * regs)
> printk("MSR: "REG" ", regs->msr);
> printbits(regs->msr, msr_bits);
> printk(" CR: %08lx XER: %08lx\n", regs->ccr, regs->xer);
> -#ifdef CONFIG_PPC64
> - printk("SOFTE: %ld\n", regs->softe);
> -#endif
> trap = TRAP(regs);
> if ((regs->trap != 0xc00) && cpu_has_feature(CPU_FTR_CFAR))
> - printk("CFAR: "REG"\n", regs->orig_gpr3);
> + printk("CFAR: "REG" ", regs->orig_gpr3);
> if (trap == 0x200 || trap == 0x300 || trap == 0x600)
> #if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
> - printk("DEAR: "REG", ESR: "REG"\n", regs->dar, regs->dsisr);
> + printk("DEAR: "REG" ESR: "REG" ", regs->dar, regs->dsisr);
> #else
> - printk("DAR: "REG", DSISR: %08lx\n", regs->dar, regs->dsisr);
> + printk("DAR: "REG" DSISR: %08lx ", regs->dar, regs->dsisr);
> +#endif
> +#ifdef CONFIG_PPC64
> + printk("SOFTE: %ld ", regs->softe);
> +#endif
> +#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
> + printk("\nPACATMSCRATCH: %016llx ", get_paca()->tm_scratch);
> #endif
>
> for (i = 0; i < 32; i++) {
> @@ -887,9 +890,6 @@ void show_regs(struct pt_regs * regs)
> printk("NIP ["REG"] %pS\n", regs->nip, (void *)regs->nip);
> printk("LR ["REG"] %pS\n", regs->link, (void *)regs->link);
> #endif
> -#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
> - printk("PACATMSCRATCH [%llx]\n", get_paca()->tm_scratch);
> -#endif
> show_stack(current, (unsigned long *) regs->gpr[1]);
> if (!user_mode(regs))
> show_instructions(regs);
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-11-15 5:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-15 4:41 [PATCH] powerpc: print DAR and DSISR on machine check oopses Anton Blanchard
2013-11-15 4:48 ` [PATCH] powerpc: Remove a few lines of oops output Anton Blanchard
2013-11-15 5:05 ` Michael Neuling
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).