Re: [PULL 34/51] powerpc: move debug registers in a structure

2013-11-03 Thread Benjamin Herrenschmidt
On Mon, 2013-11-04 at 07:43 +0100, Alexander Graf wrote:
> Yeah, it's what Ben and me agreed on after I waited forever to get a
> topic branch created. Oh well, I guess this time we just have to
> manually resolve the conflicts and do a better job at communicating
> next time.

That specific one was my fault. Too much stuff on my plate and I
completely forgot about the topic branch, anyway, it's ok now.

Cheers,
Ben.


--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PULL 34/51] powerpc: move debug registers in a structure

2013-11-03 Thread Alexander Graf

On 04.11.2013, at 01:03, Scott Wood  wrote:

> On Mon, 2013-11-04 at 07:56 +1100, Benjamin Herrenschmidt wrote:
>> On Sun, 2013-11-03 at 16:30 +0200, Gleb Natapov wrote:
>>> On Thu, Oct 31, 2013 at 10:18:19PM +0100, Alexander Graf wrote:
 From: Bharat Bhushan 
 
 This way we can use same data type struct with KVM and
 also help in using other debug related function.
 
 Signed-off-by: Bharat Bhushan 
 Signed-off-by: Alexander Graf 
>>> It would be nice to have PPC maintainers (CCed) ACKs here. This patch
>>> also has merging conflicts with cbc9565e (should be easy to resolve)
>> 
>> Is it easier if I put it in powerpc -next and resolve the conflicts ?
>> 
>> I was ok with the patch but yes, I should probably have put it in a
>> topic branch in the first place and merge it both in my tree and Alex.
> 
> It's already in your -next via my tree (sha1
> 51ae8d4a2b9e4aa9a502061b9c39168e08829b94).  I didn't realize Alex was
> planning on applying it.

Yeah, it's what Ben and me agreed on after I waited forever to get a topic 
branch created. Oh well, I guess this time we just have to manually resolve the 
conflicts and do a better job at communicating next time.


Alex

--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PULL 34/51] powerpc: move debug registers in a structure

2013-11-03 Thread Scott Wood
On Mon, 2013-11-04 at 07:56 +1100, Benjamin Herrenschmidt wrote:
> On Sun, 2013-11-03 at 16:30 +0200, Gleb Natapov wrote:
> > On Thu, Oct 31, 2013 at 10:18:19PM +0100, Alexander Graf wrote:
> > > From: Bharat Bhushan 
> > > 
> > > This way we can use same data type struct with KVM and
> > > also help in using other debug related function.
> > > 
> > > Signed-off-by: Bharat Bhushan 
> > > Signed-off-by: Alexander Graf 
> > It would be nice to have PPC maintainers (CCed) ACKs here. This patch
> > also has merging conflicts with cbc9565e (should be easy to resolve)
> 
> Is it easier if I put it in powerpc -next and resolve the conflicts ?
> 
> I was ok with the patch but yes, I should probably have put it in a
> topic branch in the first place and merge it both in my tree and Alex.

It's already in your -next via my tree (sha1
51ae8d4a2b9e4aa9a502061b9c39168e08829b94).  I didn't realize Alex was
planning on applying it.

-Scott



--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PULL 34/51] powerpc: move debug registers in a structure

2013-11-03 Thread Benjamin Herrenschmidt
On Sun, 2013-11-03 at 16:30 +0200, Gleb Natapov wrote:
> On Thu, Oct 31, 2013 at 10:18:19PM +0100, Alexander Graf wrote:
> > From: Bharat Bhushan 
> > 
> > This way we can use same data type struct with KVM and
> > also help in using other debug related function.
> > 
> > Signed-off-by: Bharat Bhushan 
> > Signed-off-by: Alexander Graf 
> It would be nice to have PPC maintainers (CCed) ACKs here. This patch
> also has merging conflicts with cbc9565e (should be easy to resolve)

Is it easier if I put it in powerpc -next and resolve the conflicts ?

I was ok with the patch but yes, I should probably have put it in a
topic branch in the first place and merge it both in my tree and Alex.

Cheers,
Ben.

> > ---
> >  arch/powerpc/include/asm/processor.h |  38 +
> >  arch/powerpc/include/asm/reg_booke.h |   8 +-
> >  arch/powerpc/kernel/asm-offsets.c|   2 +-
> >  arch/powerpc/kernel/process.c|  42 +-
> >  arch/powerpc/kernel/ptrace.c | 154 
> > +--
> >  arch/powerpc/kernel/ptrace32.c   |   2 +-
> >  arch/powerpc/kernel/signal_32.c  |   6 +-
> >  arch/powerpc/kernel/traps.c  |  35 
> >  8 files changed, 147 insertions(+), 140 deletions(-)
> > 
> > diff --git a/arch/powerpc/include/asm/processor.h 
> > b/arch/powerpc/include/asm/processor.h
> > index e378ccc..b438444 100644
> > --- a/arch/powerpc/include/asm/processor.h
> > +++ b/arch/powerpc/include/asm/processor.h
> > @@ -147,22 +147,7 @@ typedef struct {
> >  #define TS_FPR(i) fpr[i][TS_FPROFFSET]
> >  #define TS_TRANS_FPR(i) transact_fpr[i][TS_FPROFFSET]
> >  
> > -struct thread_struct {
> > -   unsigned long   ksp;/* Kernel stack pointer */
> > -   unsigned long   ksp_limit;  /* if ksp <= ksp_limit stack overflow */
> > -
> > -#ifdef CONFIG_PPC64
> > -   unsigned long   ksp_vsid;
> > -#endif
> > -   struct pt_regs  *regs;  /* Pointer to saved register state */
> > -   mm_segment_tfs; /* for get_fs() validation */
> > -#ifdef CONFIG_BOOKE
> > -   /* BookE base exception scratch space; align on cacheline */
> > -   unsigned long   normsave[8] cacheline_aligned;
> > -#endif
> > -#ifdef CONFIG_PPC32
> > -   void*pgdir; /* root of page-table tree */
> > -#endif
> > +struct debug_reg {
> >  #ifdef CONFIG_PPC_ADV_DEBUG_REGS
> > /*
> >  * The following help to manage the use of Debug Control Registers
> > @@ -199,6 +184,27 @@ struct thread_struct {
> > unsigned long   dvc2;
> >  #endif
> >  #endif
> > +};
> > +
> > +struct thread_struct {
> > +   unsigned long   ksp;/* Kernel stack pointer */
> > +   unsigned long   ksp_limit;  /* if ksp <= ksp_limit stack overflow */
> > +
> > +#ifdef CONFIG_PPC64
> > +   unsigned long   ksp_vsid;
> > +#endif
> > +   struct pt_regs  *regs;  /* Pointer to saved register state */
> > +   mm_segment_tfs; /* for get_fs() validation */
> > +#ifdef CONFIG_BOOKE
> > +   /* BookE base exception scratch space; align on cacheline */
> > +   unsigned long   normsave[8] cacheline_aligned;
> > +#endif
> > +#ifdef CONFIG_PPC32
> > +   void*pgdir; /* root of page-table tree */
> > +#endif
> > +   /* Debug Registers */
> > +   struct debug_reg debug;
> > +
> > /* FP and VSX 0-31 register set */
> > double  fpr[32][TS_FPRWIDTH] __attribute__((aligned(16)));
> > struct {
> > diff --git a/arch/powerpc/include/asm/reg_booke.h 
> > b/arch/powerpc/include/asm/reg_booke.h
> > index ed8f836..2e31aac 100644
> > --- a/arch/powerpc/include/asm/reg_booke.h
> > +++ b/arch/powerpc/include/asm/reg_booke.h
> > @@ -381,7 +381,7 @@
> >  #define DBCR0_IA34T0x4000  /* Instr Addr 3-4 range Toggle 
> > */
> >  #define DBCR0_FT   0x0001  /* Freeze Timers on debug event */
> >  
> > -#define dbcr_iac_range(task)   ((task)->thread.dbcr0)
> > +#define dbcr_iac_range(task)   ((task)->thread.debug.dbcr0)
> >  #define DBCR_IAC12IDBCR0_IA12  /* Range 
> > Inclusive */
> >  #define DBCR_IAC12X(DBCR0_IA12 | DBCR0_IA12X)  /* Range 
> > Exclusive */
> >  #define DBCR_IAC12MODE (DBCR0_IA12 | DBCR0_IA12X)  /* IAC 1-2 Mode 
> > Bits */
> > @@ -395,7 +395,7 @@
> >  #define DBCR1_DAC1W0x2000  /* DAC1 Write Debug Event */
> >  #define DBCR1_DAC2W0x1000  /* DAC2 Write Debug Event */
> >  
> > -#define dbcr_dac(task) ((task)->thread.dbcr1)
> > +#define dbcr_dac(task) ((task)->thread.debug.dbcr1)
> >  #define DBCR_DAC1R DBCR1_DAC1R
> >  #define DBCR_DAC1W DBCR1_DAC1W
> >  #define DBCR_DAC2R DBCR1_DAC2R
> > @@ -441,7 +441,7 @@
> >  #define DBCR0_CRET 0x0020  /* Critical Return Debug Event */
> >  #define DBCR0_FT   0x0001  /* Freeze Timers on debug event */
> >  
> > -#define dbcr_dac(task) ((task)->thread.dbcr0)
> > +#define dbcr_dac(task) ((task)->thread.debug.dbcr0)
> >  #define DBCR_DAC1R DBCR0_DAC1R

Re: [PULL 34/51] powerpc: move debug registers in a structure

2013-11-03 Thread Gleb Natapov
On Thu, Oct 31, 2013 at 10:18:19PM +0100, Alexander Graf wrote:
> From: Bharat Bhushan 
> 
> This way we can use same data type struct with KVM and
> also help in using other debug related function.
> 
> Signed-off-by: Bharat Bhushan 
> Signed-off-by: Alexander Graf 
It would be nice to have PPC maintainers (CCed) ACKs here. This patch
also has merging conflicts with cbc9565e (should be easy to resolve)

> ---
>  arch/powerpc/include/asm/processor.h |  38 +
>  arch/powerpc/include/asm/reg_booke.h |   8 +-
>  arch/powerpc/kernel/asm-offsets.c|   2 +-
>  arch/powerpc/kernel/process.c|  42 +-
>  arch/powerpc/kernel/ptrace.c | 154 
> +--
>  arch/powerpc/kernel/ptrace32.c   |   2 +-
>  arch/powerpc/kernel/signal_32.c  |   6 +-
>  arch/powerpc/kernel/traps.c  |  35 
>  8 files changed, 147 insertions(+), 140 deletions(-)
> 
> diff --git a/arch/powerpc/include/asm/processor.h 
> b/arch/powerpc/include/asm/processor.h
> index e378ccc..b438444 100644
> --- a/arch/powerpc/include/asm/processor.h
> +++ b/arch/powerpc/include/asm/processor.h
> @@ -147,22 +147,7 @@ typedef struct {
>  #define TS_FPR(i) fpr[i][TS_FPROFFSET]
>  #define TS_TRANS_FPR(i) transact_fpr[i][TS_FPROFFSET]
>  
> -struct thread_struct {
> - unsigned long   ksp;/* Kernel stack pointer */
> - unsigned long   ksp_limit;  /* if ksp <= ksp_limit stack overflow */
> -
> -#ifdef CONFIG_PPC64
> - unsigned long   ksp_vsid;
> -#endif
> - struct pt_regs  *regs;  /* Pointer to saved register state */
> - mm_segment_tfs; /* for get_fs() validation */
> -#ifdef CONFIG_BOOKE
> - /* BookE base exception scratch space; align on cacheline */
> - unsigned long   normsave[8] cacheline_aligned;
> -#endif
> -#ifdef CONFIG_PPC32
> - void*pgdir; /* root of page-table tree */
> -#endif
> +struct debug_reg {
>  #ifdef CONFIG_PPC_ADV_DEBUG_REGS
>   /*
>* The following help to manage the use of Debug Control Registers
> @@ -199,6 +184,27 @@ struct thread_struct {
>   unsigned long   dvc2;
>  #endif
>  #endif
> +};
> +
> +struct thread_struct {
> + unsigned long   ksp;/* Kernel stack pointer */
> + unsigned long   ksp_limit;  /* if ksp <= ksp_limit stack overflow */
> +
> +#ifdef CONFIG_PPC64
> + unsigned long   ksp_vsid;
> +#endif
> + struct pt_regs  *regs;  /* Pointer to saved register state */
> + mm_segment_tfs; /* for get_fs() validation */
> +#ifdef CONFIG_BOOKE
> + /* BookE base exception scratch space; align on cacheline */
> + unsigned long   normsave[8] cacheline_aligned;
> +#endif
> +#ifdef CONFIG_PPC32
> + void*pgdir; /* root of page-table tree */
> +#endif
> + /* Debug Registers */
> + struct debug_reg debug;
> +
>   /* FP and VSX 0-31 register set */
>   double  fpr[32][TS_FPRWIDTH] __attribute__((aligned(16)));
>   struct {
> diff --git a/arch/powerpc/include/asm/reg_booke.h 
> b/arch/powerpc/include/asm/reg_booke.h
> index ed8f836..2e31aac 100644
> --- a/arch/powerpc/include/asm/reg_booke.h
> +++ b/arch/powerpc/include/asm/reg_booke.h
> @@ -381,7 +381,7 @@
>  #define DBCR0_IA34T  0x4000  /* Instr Addr 3-4 range Toggle */
>  #define DBCR0_FT 0x0001  /* Freeze Timers on debug event */
>  
> -#define dbcr_iac_range(task) ((task)->thread.dbcr0)
> +#define dbcr_iac_range(task) ((task)->thread.debug.dbcr0)
>  #define DBCR_IAC12I  DBCR0_IA12  /* Range Inclusive */
>  #define DBCR_IAC12X  (DBCR0_IA12 | DBCR0_IA12X)  /* Range Exclusive */
>  #define DBCR_IAC12MODE   (DBCR0_IA12 | DBCR0_IA12X)  /* IAC 1-2 Mode 
> Bits */
> @@ -395,7 +395,7 @@
>  #define DBCR1_DAC1W  0x2000  /* DAC1 Write Debug Event */
>  #define DBCR1_DAC2W  0x1000  /* DAC2 Write Debug Event */
>  
> -#define dbcr_dac(task)   ((task)->thread.dbcr1)
> +#define dbcr_dac(task)   ((task)->thread.debug.dbcr1)
>  #define DBCR_DAC1R   DBCR1_DAC1R
>  #define DBCR_DAC1W   DBCR1_DAC1W
>  #define DBCR_DAC2R   DBCR1_DAC2R
> @@ -441,7 +441,7 @@
>  #define DBCR0_CRET   0x0020  /* Critical Return Debug Event */
>  #define DBCR0_FT 0x0001  /* Freeze Timers on debug event */
>  
> -#define dbcr_dac(task)   ((task)->thread.dbcr0)
> +#define dbcr_dac(task)   ((task)->thread.debug.dbcr0)
>  #define DBCR_DAC1R   DBCR0_DAC1R
>  #define DBCR_DAC1W   DBCR0_DAC1W
>  #define DBCR_DAC2R   DBCR0_DAC2R
> @@ -475,7 +475,7 @@
>  #define DBCR1_IAC34MX0x00C0  /* Instr Addr 3-4 range 
> eXclusive */
>  #define DBCR1_IAC34AT0x0001  /* Instr Addr 3-4 range Toggle 
> */
>  
> -#define dbcr_iac_range(task) ((task)->thread.dbcr1)
> +#define dbcr_iac_range(task) ((task)->thread.debug.dbcr1)
>  #define DBCR_IAC12I  DBCR1_IAC12M/* Range Inclusive */
>  #define DBCR_IAC12X  DBCR1_IAC12