linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/85xx: Fix math emulation exception
@ 2023-09-25 15:55 Christophe Leroy
  2023-10-10 10:45 ` Michael Ellerman
  2023-10-15 10:00 ` Michael Ellerman
  0 siblings, 2 replies; 4+ messages in thread
From: Christophe Leroy @ 2023-09-25 15:55 UTC (permalink / raw)
  To: Michael Ellerman, Nicholas Piggin; +Cc: linuxppc-dev, linux-kernel

Booting mpc85xx_defconfig kernel on QEMU leads to:

Bad trap at PC: fe9bab0, SR: 2d000, vector=800
awk[82]: unhandled trap (5) at 0 nip fe9bab0 lr fe9e01c code 5 in libc-2.27.so[fe5a000+17a000]
awk[82]: code: 3aa00000 3a800010 4bffe03c 9421fff0 7ca62b78 38a00000 93c10008 83c10008
awk[82]: code: 38210010 4bffdec8 9421ffc0 7c0802a6 <fc00048e> d8010008 4815190d 93810030
Trace/breakpoint trap
WARNING: no useful console

This is because allthough CONFIG_MATH_EMULATION is selected,
Exception 800 calls unknown_exception().

Call emulation_assist_interrupt() instead.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
 arch/powerpc/kernel/head_85xx.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/head_85xx.S b/arch/powerpc/kernel/head_85xx.S
index 97e9ea0c7297..0f1641a31250 100644
--- a/arch/powerpc/kernel/head_85xx.S
+++ b/arch/powerpc/kernel/head_85xx.S
@@ -395,7 +395,7 @@ interrupt_base:
 #ifdef CONFIG_PPC_FPU
 	FP_UNAVAILABLE_EXCEPTION
 #else
-	EXCEPTION(0x0800, FP_UNAVAIL, FloatingPointUnavailable, unknown_exception)
+	EXCEPTION(0x0800, FP_UNAVAIL, FloatingPointUnavailable, emulation_assist_interrupt)
 #endif
 
 	/* System Call Interrupt */
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc/85xx: Fix math emulation exception
  2023-09-25 15:55 [PATCH] powerpc/85xx: Fix math emulation exception Christophe Leroy
@ 2023-10-10 10:45 ` Michael Ellerman
  2023-10-10 10:55   ` Christophe Leroy
  2023-10-15 10:00 ` Michael Ellerman
  1 sibling, 1 reply; 4+ messages in thread
From: Michael Ellerman @ 2023-10-10 10:45 UTC (permalink / raw)
  To: Christophe Leroy, Nicholas Piggin; +Cc: linuxppc-dev, linux-kernel

Christophe Leroy <christophe.leroy@csgroup.eu> writes:
> Booting mpc85xx_defconfig kernel on QEMU leads to:

What machine/CPU model are you using for that?

I tried ppce500/e500 and that is working OK for me, ie. boots to
userspace and I see math instructions being emulated via the emulated
stats.

cheers

> Bad trap at PC: fe9bab0, SR: 2d000, vector=800
> awk[82]: unhandled trap (5) at 0 nip fe9bab0 lr fe9e01c code 5 in libc-2.27.so[fe5a000+17a000]
> awk[82]: code: 3aa00000 3a800010 4bffe03c 9421fff0 7ca62b78 38a00000 93c10008 83c10008
> awk[82]: code: 38210010 4bffdec8 9421ffc0 7c0802a6 <fc00048e> d8010008 4815190d 93810030
> Trace/breakpoint trap
> WARNING: no useful console
>
> This is because allthough CONFIG_MATH_EMULATION is selected,
> Exception 800 calls unknown_exception().
>
> Call emulation_assist_interrupt() instead.
>
> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> ---
>  arch/powerpc/kernel/head_85xx.S | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/kernel/head_85xx.S b/arch/powerpc/kernel/head_85xx.S
> index 97e9ea0c7297..0f1641a31250 100644
> --- a/arch/powerpc/kernel/head_85xx.S
> +++ b/arch/powerpc/kernel/head_85xx.S
> @@ -395,7 +395,7 @@ interrupt_base:
>  #ifdef CONFIG_PPC_FPU
>  	FP_UNAVAILABLE_EXCEPTION
>  #else
> -	EXCEPTION(0x0800, FP_UNAVAIL, FloatingPointUnavailable, unknown_exception)
> +	EXCEPTION(0x0800, FP_UNAVAIL, FloatingPointUnavailable, emulation_assist_interrupt)
>  #endif
>  
>  	/* System Call Interrupt */
> -- 
> 2.41.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc/85xx: Fix math emulation exception
  2023-10-10 10:45 ` Michael Ellerman
@ 2023-10-10 10:55   ` Christophe Leroy
  0 siblings, 0 replies; 4+ messages in thread
From: Christophe Leroy @ 2023-10-10 10:55 UTC (permalink / raw)
  To: Michael Ellerman, Nicholas Piggin
  Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org



Le 10/10/2023 à 12:45, Michael Ellerman a écrit :
> Christophe Leroy <christophe.leroy@csgroup.eu> writes:
>> Booting mpc85xx_defconfig kernel on QEMU leads to:
> 
> What machine/CPU model are you using for that?

If I remember correctly, it was machine mpc8544ds.

Christophe

> 
> I tried ppce500/e500 and that is working OK for me, ie. boots to
> userspace and I see math instructions being emulated via the emulated
> stats.
> 
> cheers
> 
>> Bad trap at PC: fe9bab0, SR: 2d000, vector=800
>> awk[82]: unhandled trap (5) at 0 nip fe9bab0 lr fe9e01c code 5 in libc-2.27.so[fe5a000+17a000]
>> awk[82]: code: 3aa00000 3a800010 4bffe03c 9421fff0 7ca62b78 38a00000 93c10008 83c10008
>> awk[82]: code: 38210010 4bffdec8 9421ffc0 7c0802a6 <fc00048e> d8010008 4815190d 93810030
>> Trace/breakpoint trap
>> WARNING: no useful console
>>
>> This is because allthough CONFIG_MATH_EMULATION is selected,
>> Exception 800 calls unknown_exception().
>>
>> Call emulation_assist_interrupt() instead.
>>
>> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
>> ---
>>   arch/powerpc/kernel/head_85xx.S | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/powerpc/kernel/head_85xx.S b/arch/powerpc/kernel/head_85xx.S
>> index 97e9ea0c7297..0f1641a31250 100644
>> --- a/arch/powerpc/kernel/head_85xx.S
>> +++ b/arch/powerpc/kernel/head_85xx.S
>> @@ -395,7 +395,7 @@ interrupt_base:
>>   #ifdef CONFIG_PPC_FPU
>>   	FP_UNAVAILABLE_EXCEPTION
>>   #else
>> -	EXCEPTION(0x0800, FP_UNAVAIL, FloatingPointUnavailable, unknown_exception)
>> +	EXCEPTION(0x0800, FP_UNAVAIL, FloatingPointUnavailable, emulation_assist_interrupt)
>>   #endif
>>   
>>   	/* System Call Interrupt */
>> -- 
>> 2.41.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc/85xx: Fix math emulation exception
  2023-09-25 15:55 [PATCH] powerpc/85xx: Fix math emulation exception Christophe Leroy
  2023-10-10 10:45 ` Michael Ellerman
@ 2023-10-15 10:00 ` Michael Ellerman
  1 sibling, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2023-10-15 10:00 UTC (permalink / raw)
  To: Nicholas Piggin, Christophe Leroy; +Cc: linuxppc-dev, linux-kernel

On Mon, 25 Sep 2023 17:55:51 +0200, Christophe Leroy wrote:
> Booting mpc85xx_defconfig kernel on QEMU leads to:
> 
> Bad trap at PC: fe9bab0, SR: 2d000, vector=800
> awk[82]: unhandled trap (5) at 0 nip fe9bab0 lr fe9e01c code 5 in libc-2.27.so[fe5a000+17a000]
> awk[82]: code: 3aa00000 3a800010 4bffe03c 9421fff0 7ca62b78 38a00000 93c10008 83c10008
> awk[82]: code: 38210010 4bffdec8 9421ffc0 7c0802a6 <fc00048e> d8010008 4815190d 93810030
> Trace/breakpoint trap
> WARNING: no useful console
> 
> [...]

Applied to powerpc/fixes.

[1/1] powerpc/85xx: Fix math emulation exception
      https://git.kernel.org/powerpc/c/8e8a12ecbc86700b5e1a3596ce2b3c43dafad336

cheers

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-10-15 10:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-25 15:55 [PATCH] powerpc/85xx: Fix math emulation exception Christophe Leroy
2023-10-10 10:45 ` Michael Ellerman
2023-10-10 10:55   ` Christophe Leroy
2023-10-15 10:00 ` Michael Ellerman

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).