* [PATCH] powerpc/traps: merge unrecoverable_exception() and nonrecoverable_exception()
@ 2018-09-24 5:35 Christophe Leroy
2018-09-25 1:29 ` Michael Ellerman
0 siblings, 1 reply; 3+ messages in thread
From: Christophe Leroy @ 2018-09-24 5:35 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman
Cc: linux-kernel, linuxppc-dev
PPC32 uses nonrecoverable_exception() while PPC64 uses
unrecoverable_exception().
Both functions are doing almost the same thing.
This patch removes nonrecoverable_exception()
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
---
arch/powerpc/include/asm/asm-prototypes.h | 1 -
arch/powerpc/kernel/entry_32.S | 4 ++--
arch/powerpc/kernel/traps.c | 13 +++----------
3 files changed, 5 insertions(+), 13 deletions(-)
diff --git a/arch/powerpc/include/asm/asm-prototypes.h b/arch/powerpc/include/asm/asm-prototypes.h
index 78ed3c3f879a..2741831482f4 100644
--- a/arch/powerpc/include/asm/asm-prototypes.h
+++ b/arch/powerpc/include/asm/asm-prototypes.h
@@ -63,7 +63,6 @@ void program_check_exception(struct pt_regs *regs);
void alignment_exception(struct pt_regs *regs);
void slb_miss_bad_addr(struct pt_regs *regs);
void StackOverflow(struct pt_regs *regs);
-void nonrecoverable_exception(struct pt_regs *regs);
void kernel_fp_unavailable_exception(struct pt_regs *regs);
void altivec_unavailable_exception(struct pt_regs *regs);
void vsx_unavailable_exception(struct pt_regs *regs);
diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
index e58c3f467db5..77decded1175 100644
--- a/arch/powerpc/kernel/entry_32.S
+++ b/arch/powerpc/kernel/entry_32.S
@@ -794,7 +794,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_601)
lis r10,MSR_KERNEL@h
ori r10,r10,MSR_KERNEL@l
bl transfer_to_handler_full
- .long nonrecoverable_exception
+ .long unrecoverable_exception
.long ret_from_except
#endif
@@ -1297,7 +1297,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_601)
rlwinm r3,r3,0,0,30
stw r3,_TRAP(r1)
4: addi r3,r1,STACK_FRAME_OVERHEAD
- bl nonrecoverable_exception
+ bl unrecoverable_exception
/* shouldn't return */
b 4b
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 6ab66a88db14..4567eeb6524e 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -1547,14 +1547,6 @@ void StackOverflow(struct pt_regs *regs)
panic("kernel stack overflow");
}
-void nonrecoverable_exception(struct pt_regs *regs)
-{
- printk(KERN_ERR "Non-recoverable exception at PC=%lx MSR=%lx\n",
- regs->nip, regs->msr);
- debugger(regs);
- die("nonrecoverable exception", regs, SIGKILL);
-}
-
void kernel_fp_unavailable_exception(struct pt_regs *regs)
{
enum ctx_state prev_state = exception_enter();
@@ -2090,8 +2082,9 @@ void SPEFloatingPointRoundException(struct pt_regs *regs)
*/
void unrecoverable_exception(struct pt_regs *regs)
{
- printk(KERN_EMERG "Unrecoverable exception %lx at %lx\n",
- regs->trap, regs->nip);
+ pr_emerg("Unrecoverable exception %lx at %lx (msr=%lx)\n",
+ regs->trap, regs->nip, regs->msr);
+ debugger(regs);
die("Unrecoverable exception", regs, SIGABRT);
}
NOKPROBE_SYMBOL(unrecoverable_exception);
--
2.13.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] powerpc/traps: merge unrecoverable_exception() and nonrecoverable_exception()
2018-09-24 5:35 [PATCH] powerpc/traps: merge unrecoverable_exception() and nonrecoverable_exception() Christophe Leroy
@ 2018-09-25 1:29 ` Michael Ellerman
2018-09-25 4:43 ` Christophe LEROY
0 siblings, 1 reply; 3+ messages in thread
From: Michael Ellerman @ 2018-09-25 1:29 UTC (permalink / raw)
To: Christophe Leroy, Benjamin Herrenschmidt, Paul Mackerras
Cc: linux-kernel, linuxppc-dev
Christophe Leroy <christophe.leroy@c-s.fr> writes:
> diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
> index 6ab66a88db14..4567eeb6524e 100644
> --- a/arch/powerpc/kernel/traps.c
> +++ b/arch/powerpc/kernel/traps.c
> @@ -2090,8 +2082,9 @@ void SPEFloatingPointRoundException(struct pt_regs *regs)
> */
> void unrecoverable_exception(struct pt_regs *regs)
> {
> - printk(KERN_EMERG "Unrecoverable exception %lx at %lx\n",
> - regs->trap, regs->nip);
> + pr_emerg("Unrecoverable exception %lx at %lx (msr=%lx)\n",
> + regs->trap, regs->nip, regs->msr);
> + debugger(regs);
> die("Unrecoverable exception", regs, SIGABRT);
die() already calls debugger() if the trap is != 0x100.
I don't think we want to call it twice?
cheers
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] powerpc/traps: merge unrecoverable_exception() and nonrecoverable_exception()
2018-09-25 1:29 ` Michael Ellerman
@ 2018-09-25 4:43 ` Christophe LEROY
0 siblings, 0 replies; 3+ messages in thread
From: Christophe LEROY @ 2018-09-25 4:43 UTC (permalink / raw)
To: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras
Cc: linux-kernel, linuxppc-dev
Le 25/09/2018 à 03:29, Michael Ellerman a écrit :
> Christophe Leroy <christophe.leroy@c-s.fr> writes:
>
>> diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
>> index 6ab66a88db14..4567eeb6524e 100644
>> --- a/arch/powerpc/kernel/traps.c
>> +++ b/arch/powerpc/kernel/traps.c
>> @@ -2090,8 +2082,9 @@ void SPEFloatingPointRoundException(struct pt_regs *regs)
>> */
>> void unrecoverable_exception(struct pt_regs *regs)
>> {
>> - printk(KERN_EMERG "Unrecoverable exception %lx at %lx\n",
>> - regs->trap, regs->nip);
>> + pr_emerg("Unrecoverable exception %lx at %lx (msr=%lx)\n",
>> + regs->trap, regs->nip, regs->msr);
>> + debugger(regs);
>> die("Unrecoverable exception", regs, SIGABRT);
>
> die() already calls debugger() if the trap is != 0x100.
>
> I don't think we want to call it twice?
Oh, good spot. So nonrecoverable_exception() is calling it twice.
I'll fix the patch. Thanks.
Christophe
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-09-25 4:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-24 5:35 [PATCH] powerpc/traps: merge unrecoverable_exception() and nonrecoverable_exception() Christophe Leroy
2018-09-25 1:29 ` Michael Ellerman
2018-09-25 4:43 ` Christophe LEROY
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).