diff mbox

[v2] FU exceptions should carry a cause (IC)

Message ID fa23e494-320c-a4e6-8832-a9361b122558@gmail.com
State New
Headers show

Commit Message

Balbir Singh Nov. 10, 2016, 4:37 a.m. UTC
As per the ISA we need a cause and executing a tabort r9 in libc
for example 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. The fix applies only to 64
bit ppc targets.

Signed-off-by: Balbir singh <bsingharora@gmail.com>
---
 Changelog v2:
   Make the code 64 bit specific

 target-ppc/excp_helper.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

David Gibson Nov. 10, 2016, 11:50 p.m. UTC | #1
On Thu, Nov 10, 2016 at 03:37:31PM +1100, Balbir Singh wrote:
> 
> 
> As per the ISA we need a cause and executing a tabort r9 in libc
> for example 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. The fix applies only to 64
> bit ppc targets.
> 
> Signed-off-by: Balbir singh <bsingharora@gmail.com>

Applied to ppc-for-2.8.

> ---
>  Changelog v2:
>    Make the code 64 bit specific
> 
>  target-ppc/excp_helper.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/target-ppc/excp_helper.c b/target-ppc/excp_helper.c
> index 808760b..93369d4 100644
> --- a/target-ppc/excp_helper.c
> +++ b/target-ppc/excp_helper.c
> @@ -427,6 +427,9 @@ 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          */
> +#ifdef TARGET_PPC64
> +        env->spr[SPR_FSCR] |= ((target_ulong)env->error_code << 56);
> +#endif
>          break;
>      case POWERPC_EXCP_PIT:       /* Programmable interval timer interrupt    */
>          LOG_EXCP("PIT exception\n");
diff mbox

Patch

diff --git a/target-ppc/excp_helper.c b/target-ppc/excp_helper.c
index 808760b..93369d4 100644
--- a/target-ppc/excp_helper.c
+++ b/target-ppc/excp_helper.c
@@ -427,6 +427,9 @@  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          */
+#ifdef TARGET_PPC64
+        env->spr[SPR_FSCR] |= ((target_ulong)env->error_code << 56);
+#endif
         break;
     case POWERPC_EXCP_PIT:       /* Programmable interval timer interrupt    */
         LOG_EXCP("PIT exception\n");