diff mbox

[TRIVIAL,RFC] FU exceptions should carry a cause (IC)

Message ID aa81586e-c71f-4b33-b45e-2e106e120034@gmail.com
State New
Headers show

Commit Message

Balbir Singh Nov. 10, 2016, 1:42 a.m. UTC
As per the ISA we need a cause for FU exceptions.Executing a tabort r9
for example in libc, causes a EXCP_FU exception. We don't wire up the
IC (cause) when we post the exception. The cause is required
for the kernel to do the right thing. I caught this issue while testing
the latest kernel against Cedrics' latest pnv ipmi branch.

Signed-off-by: Balbir singh <bsingharora@gmail.com>
---
 target-ppc/excp_helper.c | 1 +
 1 file changed, 1 insertion(+)

Comments

David Gibson Nov. 10, 2016, 2:06 a.m. UTC | #1
On Thu, Nov 10, 2016 at 12:42:37PM +1100, Balbir Singh wrote:
> 
> 
> As per the ISA we need a cause for FU exceptions.Executing a tabort r9
> for example in libc, causes a EXCP_FU exception. We don't wire up the
> IC (cause) when we post the exception. The cause is required
> for the kernel to do the right thing. I caught this issue while testing
> the latest kernel against Cedrics' latest pnv ipmi branch.
> 
> Signed-off-by: Balbir singh <bsingharora@gmail.com>

Applied to ppc-for-2.8

> ---
>  target-ppc/excp_helper.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/target-ppc/excp_helper.c b/target-ppc/excp_helper.c
> index 808760b..cccea8d 100644
> --- a/target-ppc/excp_helper.c
> +++ b/target-ppc/excp_helper.c
> @@ -427,6 +427,7 @@ static inline void powerpc_excp(PowerPCCPU *cpu, int excp_model, int excp)
>      case POWERPC_EXCP_VPU:       /* Vector unavailable exception             */
>      case POWERPC_EXCP_VSXU:       /* VSX unavailable exception               */
>      case POWERPC_EXCP_FU:         /* Facility unavailable exception          */
> +        env->spr[SPR_FSCR] |= ((target_ulong)env->error_code << 56);
>          break;
>      case POWERPC_EXCP_PIT:       /* Programmable interval timer interrupt    */
>          LOG_EXCP("PIT exception\n");
David Gibson Nov. 10, 2016, 2:46 a.m. UTC | #2
On Thu, Nov 10, 2016 at 01:06:17PM +1100, David Gibson wrote:
> On Thu, Nov 10, 2016 at 12:42:37PM +1100, Balbir Singh wrote:
> > 
> > 
> > As per the ISA we need a cause for FU exceptions.Executing a tabort r9
> > for example in libc, causes a EXCP_FU exception. We don't wire up the
> > IC (cause) when we post the exception. The cause is required
> > for the kernel to do the right thing. I caught this issue while testing
> > the latest kernel against Cedrics' latest pnv ipmi branch.
> > 
> > Signed-off-by: Balbir singh <bsingharora@gmail.com>
> 
> Applied to ppc-for-2.8

Or not..

This causes compile breakage for the ppc32 targets.

> 
> > ---
> >  target-ppc/excp_helper.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/target-ppc/excp_helper.c b/target-ppc/excp_helper.c
> > index 808760b..cccea8d 100644
> > --- a/target-ppc/excp_helper.c
> > +++ b/target-ppc/excp_helper.c
> > @@ -427,6 +427,7 @@ static inline void powerpc_excp(PowerPCCPU *cpu, int excp_model, int excp)
> >      case POWERPC_EXCP_VPU:       /* Vector unavailable exception             */
> >      case POWERPC_EXCP_VSXU:       /* VSX unavailable exception               */
> >      case POWERPC_EXCP_FU:         /* Facility unavailable exception          */
> > +        env->spr[SPR_FSCR] |= ((target_ulong)env->error_code << 56);
> >          break;
> >      case POWERPC_EXCP_PIT:       /* Programmable interval timer interrupt    */
> >          LOG_EXCP("PIT exception\n");
>
Balbir Singh Nov. 10, 2016, 3:45 a.m. UTC | #3
On 10/11/16 13:46, David Gibson wrote:
> On Thu, Nov 10, 2016 at 01:06:17PM +1100, David Gibson wrote:
>> On Thu, Nov 10, 2016 at 12:42:37PM +1100, Balbir Singh wrote:
>>>
>>>
>>> As per the ISA we need a cause for FU exceptions.Executing a tabort r9
>>> for example in libc, causes a EXCP_FU exception. We don't wire up the
>>> IC (cause) when we post the exception. The cause is required
>>> for the kernel to do the right thing. I caught this issue while testing
>>> the latest kernel against Cedrics' latest pnv ipmi branch.
>>>
>>> Signed-off-by: Balbir singh <bsingharora@gmail.com>
>>
>> Applied to ppc-for-2.8
> 
> Or not..
> 
> This causes compile breakage for the ppc32 targets.
> 

Sorry, I'll double check, I did a minimal compile.
I'll redo and repost

Balbir Singh.
diff mbox

Patch

diff --git a/target-ppc/excp_helper.c b/target-ppc/excp_helper.c
index 808760b..cccea8d 100644
--- a/target-ppc/excp_helper.c
+++ b/target-ppc/excp_helper.c
@@ -427,6 +427,7 @@  static inline void powerpc_excp(PowerPCCPU *cpu, int excp_model, int excp)
     case POWERPC_EXCP_VPU:       /* Vector unavailable exception             */
     case POWERPC_EXCP_VSXU:       /* VSX unavailable exception               */
     case POWERPC_EXCP_FU:         /* Facility unavailable exception          */
+        env->spr[SPR_FSCR] |= ((target_ulong)env->error_code << 56);
         break;
     case POWERPC_EXCP_PIT:       /* Programmable interval timer interrupt    */
         LOG_EXCP("PIT exception\n");