qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [TRIVIAL][RFC][PATCH] FU exceptions should carry a cause (IC)
@ 2016-11-10  1:42 Balbir Singh
  2016-11-10  2:06 ` David Gibson
  0 siblings, 1 reply; 6+ messages in thread
From: Balbir Singh @ 2016-11-10  1:42 UTC (permalink / raw)
  To: qemu-ppc; +Cc: David Gibson, Cedric Le Goater, qemu-devel



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(+)

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");
-- 
2.9.3

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

* Re: [Qemu-devel] [TRIVIAL][RFC][PATCH] FU exceptions should carry a cause (IC)
  2016-11-10  1:42 [Qemu-devel] [TRIVIAL][RFC][PATCH] FU exceptions should carry a cause (IC) Balbir Singh
@ 2016-11-10  2:06 ` David Gibson
  2016-11-10  2:46   ` David Gibson
  0 siblings, 1 reply; 6+ messages in thread
From: David Gibson @ 2016-11-10  2:06 UTC (permalink / raw)
  To: Balbir Singh; +Cc: qemu-ppc, Cedric Le Goater, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1519 bytes --]

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			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [Qemu-devel] [TRIVIAL][RFC][PATCH] FU exceptions should carry a cause (IC)
  2016-11-10  2:06 ` David Gibson
@ 2016-11-10  2:46   ` David Gibson
  2016-11-10  3:45     ` Balbir Singh
  0 siblings, 1 reply; 6+ messages in thread
From: David Gibson @ 2016-11-10  2:46 UTC (permalink / raw)
  To: Balbir Singh; +Cc: qemu-ppc, Cedric Le Goater, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1717 bytes --]

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");
> 



-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [Qemu-devel] [TRIVIAL][RFC][PATCH] FU exceptions should carry a cause (IC)
  2016-11-10  2:46   ` David Gibson
@ 2016-11-10  3:45     ` Balbir Singh
  2016-11-10  4:37       ` [Qemu-devel] [PATCH v2] " Balbir Singh
  0 siblings, 1 reply; 6+ messages in thread
From: Balbir Singh @ 2016-11-10  3:45 UTC (permalink / raw)
  To: David Gibson; +Cc: qemu-ppc, Cedric Le Goater, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 810 bytes --]



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.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

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

* [Qemu-devel] [PATCH v2] FU exceptions should carry a cause (IC)
  2016-11-10  3:45     ` Balbir Singh
@ 2016-11-10  4:37       ` Balbir Singh
  2016-11-10 23:50         ` David Gibson
  0 siblings, 1 reply; 6+ messages in thread
From: Balbir Singh @ 2016-11-10  4:37 UTC (permalink / raw)
  To: David Gibson; +Cc: qemu-ppc, Cedric Le Goater, qemu-devel



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(+)

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");
-- 
2.9.3

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

* Re: [Qemu-devel] [PATCH v2] FU exceptions should carry a cause (IC)
  2016-11-10  4:37       ` [Qemu-devel] [PATCH v2] " Balbir Singh
@ 2016-11-10 23:50         ` David Gibson
  0 siblings, 0 replies; 6+ messages in thread
From: David Gibson @ 2016-11-10 23:50 UTC (permalink / raw)
  To: Balbir Singh; +Cc: qemu-ppc, Cedric Le Goater, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1552 bytes --]

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");

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2016-11-11  1:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-10  1:42 [Qemu-devel] [TRIVIAL][RFC][PATCH] FU exceptions should carry a cause (IC) Balbir Singh
2016-11-10  2:06 ` David Gibson
2016-11-10  2:46   ` David Gibson
2016-11-10  3:45     ` Balbir Singh
2016-11-10  4:37       ` [Qemu-devel] [PATCH v2] " Balbir Singh
2016-11-10 23:50         ` David Gibson

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