* [PATCH] powerpc: Use reg.h values for program check reason codes
@ 2017-08-16 6:50 Cyril Bur
2017-08-16 8:52 ` Christophe LEROY
0 siblings, 1 reply; 3+ messages in thread
From: Cyril Bur @ 2017-08-16 6:50 UTC (permalink / raw)
To: linuxppc-dev
Small amount of #define duplication, makes sense for these to be in
reg.h.
Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
---
arch/powerpc/include/asm/reg.h | 1 +
arch/powerpc/kernel/traps.c | 10 +++++-----
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
index a3b6575c7842..c22b1ae5ad03 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -675,6 +675,7 @@
* may not be recoverable */
#define SRR1_WS_DEEPER 0x00020000 /* Some resources not maintained */
#define SRR1_WS_DEEP 0x00010000 /* All resources maintained */
+#define SRR1_PROGTMBAD 0x00200000 /* TM Bad Thing */
#define SRR1_PROGFPE 0x00100000 /* Floating Point Enabled */
#define SRR1_PROGILL 0x00080000 /* Illegal instruction */
#define SRR1_PROGPRIV 0x00040000 /* Privileged instruction */
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 1f7ec178db05..0a5ddaea8bf1 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -416,11 +416,11 @@ static inline int check_io_access(struct pt_regs *regs)
exception is in the MSR. */
#define get_reason(regs) ((regs)->msr)
#define get_mc_reason(regs) ((regs)->msr)
-#define REASON_TM 0x200000
-#define REASON_FP 0x100000
-#define REASON_ILLEGAL 0x80000
-#define REASON_PRIVILEGED 0x40000
-#define REASON_TRAP 0x20000
+#define REASON_TM SRR1_PROGTMBAD
+#define REASON_FP SRR1_PROGFPE
+#define REASON_ILLEGAL SRR1_PROGILL
+#define REASON_PRIVILEGED SRR1_PROGPRIV
+#define REASON_TRAP SRR1_PROGTRAP
#define single_stepping(regs) ((regs)->msr & MSR_SE)
#define clear_single_step(regs) ((regs)->msr &= ~MSR_SE)
--
2.14.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] powerpc: Use reg.h values for program check reason codes
2017-08-16 6:50 [PATCH] powerpc: Use reg.h values for program check reason codes Cyril Bur
@ 2017-08-16 8:52 ` Christophe LEROY
2017-08-16 9:04 ` Cyril Bur
0 siblings, 1 reply; 3+ messages in thread
From: Christophe LEROY @ 2017-08-16 8:52 UTC (permalink / raw)
To: Cyril Bur, linuxppc-dev
Hi,
Le 16/08/2017 à 08:50, Cyril Bur a écrit :
> Small amount of #define duplication, makes sense for these to be in
> reg.h.
>
> Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
Looks similar to the following applies commit, doesn't it ?
https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?h=merge&id=d30a5a5262ca64d58aa07fb2ecd7f992df83b4bc
Christophe
> ---
> arch/powerpc/include/asm/reg.h | 1 +
> arch/powerpc/kernel/traps.c | 10 +++++-----
> 2 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
> index a3b6575c7842..c22b1ae5ad03 100644
> --- a/arch/powerpc/include/asm/reg.h
> +++ b/arch/powerpc/include/asm/reg.h
> @@ -675,6 +675,7 @@
> * may not be recoverable */
> #define SRR1_WS_DEEPER 0x00020000 /* Some resources not maintained */
> #define SRR1_WS_DEEP 0x00010000 /* All resources maintained */
> +#define SRR1_PROGTMBAD 0x00200000 /* TM Bad Thing */
> #define SRR1_PROGFPE 0x00100000 /* Floating Point Enabled */
> #define SRR1_PROGILL 0x00080000 /* Illegal instruction */
> #define SRR1_PROGPRIV 0x00040000 /* Privileged instruction */
> diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
> index 1f7ec178db05..0a5ddaea8bf1 100644
> --- a/arch/powerpc/kernel/traps.c
> +++ b/arch/powerpc/kernel/traps.c
> @@ -416,11 +416,11 @@ static inline int check_io_access(struct pt_regs *regs)
> exception is in the MSR. */
> #define get_reason(regs) ((regs)->msr)
> #define get_mc_reason(regs) ((regs)->msr)
> -#define REASON_TM 0x200000
> -#define REASON_FP 0x100000
> -#define REASON_ILLEGAL 0x80000
> -#define REASON_PRIVILEGED 0x40000
> -#define REASON_TRAP 0x20000
> +#define REASON_TM SRR1_PROGTMBAD
> +#define REASON_FP SRR1_PROGFPE
> +#define REASON_ILLEGAL SRR1_PROGILL
> +#define REASON_PRIVILEGED SRR1_PROGPRIV
> +#define REASON_TRAP SRR1_PROGTRAP
>
> #define single_stepping(regs) ((regs)->msr & MSR_SE)
> #define clear_single_step(regs) ((regs)->msr &= ~MSR_SE)
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] powerpc: Use reg.h values for program check reason codes
2017-08-16 8:52 ` Christophe LEROY
@ 2017-08-16 9:04 ` Cyril Bur
0 siblings, 0 replies; 3+ messages in thread
From: Cyril Bur @ 2017-08-16 9:04 UTC (permalink / raw)
To: Christophe LEROY, linuxppc-dev
On Wed, 2017-08-16 at 10:52 +0200, Christophe LEROY wrote:
> Hi,
>
> Le 16/08/2017 à 08:50, Cyril Bur a écrit :
> > Small amount of #define duplication, makes sense for these to be in
> > reg.h.
> >
> > Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
>
> Looks similar to the following applies commit, doesn't it ?
>
> https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?h=merge&id=d30a5a5262ca64d58aa07fb2ecd7f992df83b4bc
>
Oops, I think I'm based off Linus' tree. Sorry for the noise.
Cyril
*starts writing patch to rename to PROGTMBAD*... because clearly haha
;)
> Christophe
>
> > ---
> > arch/powerpc/include/asm/reg.h | 1 +
> > arch/powerpc/kernel/traps.c | 10 +++++-----
> > 2 files changed, 6 insertions(+), 5 deletions(-)
> >
> > diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
> > index a3b6575c7842..c22b1ae5ad03 100644
> > --- a/arch/powerpc/include/asm/reg.h
> > +++ b/arch/powerpc/include/asm/reg.h
> > @@ -675,6 +675,7 @@
> > * may not be recoverable */
> > #define SRR1_WS_DEEPER 0x00020000 /* Some resources not maintained */
> > #define SRR1_WS_DEEP 0x00010000 /* All resources maintained */
> > +#define SRR1_PROGTMBAD 0x00200000 /* TM Bad Thing */
> > #define SRR1_PROGFPE 0x00100000 /* Floating Point Enabled */
> > #define SRR1_PROGILL 0x00080000 /* Illegal instruction */
> > #define SRR1_PROGPRIV 0x00040000 /* Privileged instruction */
> > diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
> > index 1f7ec178db05..0a5ddaea8bf1 100644
> > --- a/arch/powerpc/kernel/traps.c
> > +++ b/arch/powerpc/kernel/traps.c
> > @@ -416,11 +416,11 @@ static inline int check_io_access(struct pt_regs *regs)
> > exception is in the MSR. */
> > #define get_reason(regs) ((regs)->msr)
> > #define get_mc_reason(regs) ((regs)->msr)
> > -#define REASON_TM 0x200000
> > -#define REASON_FP 0x100000
> > -#define REASON_ILLEGAL 0x80000
> > -#define REASON_PRIVILEGED 0x40000
> > -#define REASON_TRAP 0x20000
> > +#define REASON_TM SRR1_PROGTMBAD
> > +#define REASON_FP SRR1_PROGFPE
> > +#define REASON_ILLEGAL SRR1_PROGILL
> > +#define REASON_PRIVILEGED SRR1_PROGPRIV
> > +#define REASON_TRAP SRR1_PROGTRAP
> >
> > #define single_stepping(regs) ((regs)->msr & MSR_SE)
> > #define clear_single_step(regs) ((regs)->msr &= ~MSR_SE)
> >
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-08-16 9:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-16 6:50 [PATCH] powerpc: Use reg.h values for program check reason codes Cyril Bur
2017-08-16 8:52 ` Christophe LEROY
2017-08-16 9:04 ` Cyril Bur
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).