Re: [PATCH] bookehv: Handle debug exception on guest exit

2013-04-11 Thread Kumar Gala

On Apr 5, 2013, at 2:53 AM, Bhushan Bharat-R65777 wrote:

 Hi Kumar/Benh,
 
 After further looking into the code I think that if we correct the vector 
 range below in DebugDebug handler then we do not need the change I provided 
 in this patch.
 
 Here is the snapshot for 32 bit (head_booke.h, same will be true for 64 bit):
 
 #define DEBUG_DEBUG_EXCEPTION 
 \
START_EXCEPTION(DebugDebug);  \
DEBUG_EXCEPTION_PROLOG;   \
  \
/*\
 * If there is a single step or branch-taken exception in an  \
 * exception entry sequence, it was probably meant to apply to\
 * the code where the exception occurred (since exception entry   \
 * doesn't turn off DE automatically).  We simulate the effect\
 * of turning off DE on entry to an exception handler by turning  \
 * off DE in the DSRR1 value and clearing the debug status.   \
 */   \
mfspr   r10,SPRN_DBSR;  /* check single-step/branch taken */  \
andis.  r10,r10,(DBSR_IC|DBSR_BT)@h;  \
beq+2f;   \
  \
lis r10,KERNELBASE@h;   /* check if exception in vectors */   \
ori r10,r10,KERNELBASE@l; \
cmplw   r12,r10;  \
blt+2f; /* addr below exception vectors */\
  \
lis r10,DebugDebug@h;\
ori r10,r10,DebugDebug@l;  
   \
 
 
   Here we assume all exception vector ends at DebugDebug, which is not 
 correct.
   We probably should get proper end by using some start_vector and 
 end_vector lebels
   or at least use end at Ehvpriv (which is last defined in 
 head_fsl_booke.S for PowerPC. Is that correct?
 
   
cmplw   r12,r10;  \
bgt+2f; /* addr above exception vectors */\
 
 Thanks
 -Bharat

I talked to Stuart and this general approach is good.  Just make sure to update 
both head_44x.S and head_fsl_booke.S.  Plus do this for both 
DEBUG_CRIT_EXCEPTION  DEBUG_DEBUG_EXCEPTION

- k--
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: [PATCH][v4] PPC: add paravirt idle loop for 64-bit book E

2013-03-13 Thread Kumar Gala

On Feb 8, 2013, at 1:22 PM, Stuart Yoder wrote:

 From: Stuart Yoder stuart.yo...@freescale.com
 
 Signed-off-by: Stuart Yoder stuart.yo...@freescale.com
 ---
 
 -removed KVM prefix to patch subject, patch is not KVM specific
 
 arch/powerpc/kernel/epapr_hcalls.S |2 ++
 arch/powerpc/kernel/idle_book3e.S  |   32 ++--
 2 files changed, 32 insertions(+), 2 deletions(-)

applied to next

- k
--
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: [PATCH 2/4] powerpc/booke: Merge the 32 bit e5500/e500mc cpu setup code.

2012-08-04 Thread Kumar Gala

On Jul 9, 2012, at 7:58 AM, Varun Sethi wrote:

 Merge the 32 bit cpu setup code for e500mc/e5500 and define the cpu_restore
 routine (for e5500/e6500) only for the 64 bit case. The cpu_restore routine
 is used in the 64 bit case for setting up the secondary cores.
 
 Signed-off-by: Varun Sethi varun.se...@freescale.com
 ---
 arch/powerpc/kernel/cpu_setup_fsl_booke.S |1 +
 arch/powerpc/kernel/cputable.c|4 
 2 files changed, 5 insertions(+), 0 deletions(-)
 
 diff --git a/arch/powerpc/kernel/cpu_setup_fsl_booke.S 
 b/arch/powerpc/kernel/cpu_setup_fsl_booke.S
 index a55d028..5e87737 100644
 --- a/arch/powerpc/kernel/cpu_setup_fsl_booke.S
 +++ b/arch/powerpc/kernel/cpu_setup_fsl_booke.S
 @@ -75,6 +75,7 @@ _GLOBAL(__setup_cpu_e500v2)
   mtlrr4
   blr
 _GLOBAL(__setup_cpu_e500mc)
 +_GLOBAL(__setup_cpu_e5500)

This is a bit confusing, as we now have duplicated __setup_cpu_e5500() between 
the ppc32 and ppc64 cases.

If you build this patch for corenet32_smp_defconfig it fails.

I'll fixup and add the proper #ifdef's to handle this.
---

applied to next

- k--
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: [PATCH 3/4] powerpc/booke: Separate out restore_e5500/setup_e5500 routines.

2012-08-04 Thread Kumar Gala

On Jul 9, 2012, at 8:01 AM, Varun Sethi wrote:

 For the 64 bit case separate out e5500 cpu_setup and cpu_restore functions.
 The cpu_setup function (for the primary core) is passed the cpu_spec pointer,
 which is not there in case of the cpu_restore function. Also, in our case
 we will have to manipulate the CPU_FTR_EMB_HV flag on the the primary core.  
 
 Signed-off-by: Varun Sethi varun.se...@freescale.com
 ---
 arch/powerpc/kernel/cpu_setup_fsl_booke.S |   38 
 arch/powerpc/kernel/exceptions-64e.S  |   18 +
 2 files changed, 34 insertions(+), 22 deletions(-)

applied to next

- k--
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: [PATCH 4/4] powerpc/booke: Add CPU_FTR_EMB_HV check for e5500.

2012-08-03 Thread Kumar Gala

On Jul 9, 2012, at 8:04 AM, Varun Sethi wrote:

 Added CPU_FTR_EMB_HV feature check for e550.
 
 Signed-off-by: Varun Sethi varun.se...@freescale.com
 Signed-off-by: Mihai Caraman mihai.cara...@freescale.com
 ---
 arch/powerpc/kernel/cpu_setup_fsl_booke.S |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

[ fixed typo e550 - e5500 ]

applied to next

- k
--
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: [PATCH v2 1/2] powerpc/e500: make load_up_spe a normal fuction

2012-07-10 Thread Kumar Gala

On Feb 29, 2012, at 7:20 PM, Olivia Yin wrote:

 From: Liu Yu yu@freescale.com
 
 So that we can call it when improving SPE switch like book3e did for fp 
 switch.
 
 Signed-off-by: Liu Yu yu@freescale.com
 Signed-off-by: Olivia Yin hong-hua@freescale.com
 ---
 v2:   add Signed-off-by
 
 arch/powerpc/kernel/head_fsl_booke.S |   23 ++-
 1 files changed, 6 insertions(+), 17 deletions(-)

applied to next

- k--
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: [PATCH] powerpc/e6500: add CPU_FTR_EMB_HV to CPU table

2012-04-13 Thread Kumar Gala

On Apr 11, 2012, at 3:27 PM, Scott Wood wrote:

 e6500 support (commit 10241842fbe900276634fee8d37ec48a7d8a762f, 
 powerpc: Add initial e6500 cpu support and the introduction of
 CPU_FTR_EMB_HV (commit 73196cd364a2d972d73fa08da9d81ca3215bed68,
 KVM: PPC: e500mc support) collided during merge, leaving e6500's CPU
 table entry missing CPU_FTR_EMB_HV.
 
 Signed-off-by: Scott Wood scottw...@freescale.com
 ---
 Fixup patch for the KVM merge as requested by Marcelo.
 
 arch/powerpc/include/asm/cputable.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Acked-by: Kumar Gala ga...@kernel.crashing.org

- k
--
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: [PATCH 12/38] powerpc/booke: Provide exception macros with interrupt name

2012-03-21 Thread Kumar Gala

On Mar 21, 2012, at 1:19 PM, Scott Wood wrote:

 On 03/21/2012 01:04 PM, Kumar Gala wrote:
 
 On Feb 28, 2012, at 6:09 PM, Alexander Graf wrote:
 
 From: Scott Wood scottw...@freescale.com
 
 DO_KVM will need to identify the particular exception type.
 
 There is an existing set of arbitrary numbers that Linux passes,
 but it's an undocumented mess that sort of corresponds to server/classic
 exception vectors but not really.
 
 So what do the new names correspond to?
 
 The names are Linux-defined.  The values are IVOR numbers.
 
 What header is defining MACHINE_CHECK, BOOKE_INTERRUPT_EXTERNAL, etc
 (asm/kvm_asm.h)?
 
 Yes, it's asm/kvm_asm.h at the moment.
 
 It's actually BOOKE_INTERRUPT_MACHINE_CHECK, etc.  The exception macros
 paste on BOOKE_INTERRUPT_ when they use it, to keep the macro users from
 having to wrap lines even more often.
 
 If so we really should move these out of
 asm/kvm_asm.h and into something a bit more appropriate.
 
 Yes, that was one of the things I had been planning to fix post-RFC.
 Any preference what header it should be in?  asm/reg_booke.h seems to be
 the least bad option of the existing headers -- or perhaps move
 head_booke.h to arch/powerpc/include/asm.

asm/reg_booke.h seems the least painful right now.  head_booke.h is only used 
on 32-bit so that's not the best choice at this point.  We could create an 
asm/head_booke.h in addition to the one in arch/powerpc/kernel/

 Long-term it would also be nice for this to replace, rather than
 supplement, the current numbers, though as Ben pointed out there are a
 number of places throughout the code that will have to be fixed for that
 to happen.

Yeah, not too worried about that.  More just wanting it to be clear what one 
has to 'update' if adding support for a new exception.

- k--
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: [PATCH 01/13] powerpc/e500: Save SPEFCSR in flush_spe_to_thread()

2011-05-19 Thread Kumar Gala

On May 17, 2011, at 6:35 PM, Scott Wood wrote:

 From: yu liu yu@freescale.com
 
 giveup_spe() saves the SPE state which is protected by MSR[SPE].
 However, modifying SPEFSCR does not trap when MSR[SPE]=0.
 And since SPEFSCR is already saved/restored in _switch(),
 not all the callers want to save SPEFSCR again.
 Thus, saving SPEFSCR should not belong to giveup_spe().
 
 This patch moves SPEFSCR saving to flush_spe_to_thread(),
 and cleans up the caller that needs to save SPEFSCR accordingly.
 
 Signed-off-by: Liu Yu yu@freescale.com
 Signed-off-by: Scott Wood scottw...@freescale.com
 ---
 This is a resending of http://patchwork.ozlabs.org/patch/88677/
 
 Kumar, please ack to go via kvm.  This is holding up the rest of the SPE
 patches, which in turn are holding up the MMU patches due to both
 touching the MSR update code.
 
 arch/powerpc/kernel/head_fsl_booke.S |2 --
 arch/powerpc/kernel/process.c|1 +
 arch/powerpc/kernel/traps.c  |5 +
 3 files changed, 2 insertions(+), 6 deletions(-)

Acked-by: Kumar Gala ga...@kernel.crashing.org

[ Alex, let me know if you want this via my powerpc.git tree or your kvm tree ]

- k--
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: [PATCH 02/13] powerpc/e500: SPE register saving: take arbitrary struct offset

2011-05-19 Thread Kumar Gala

On May 17, 2011, at 6:36 PM, Scott Wood wrote:

 Previously, these macros hardcoded THREAD_EVR0 as the base of the save
 area, relative to the base register passed.  This base offset is now
 passed as a separate macro parameter, allowing reuse with other SPE
 save areas, such as used by KVM.
 
 Signed-off-by: Scott Wood scottw...@freescale.com
 ---
 This is a resending of http://www.spinics.net/lists/kvm-ppc/msg02672.html
 
 Kumar, please ack to go via kvm.
 
 arch/powerpc/include/asm/ppc_asm.h   |   28 
 arch/powerpc/kernel/head_fsl_booke.S |6 +++---
 2 files changed, 19 insertions(+), 15 deletions(-)

Acked-by: Kumar Gala ga...@kernel.crashing.org

[ Alex, let me know if you want this via my powerpc.git tree or your kvm tree ]

- k

--
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: [PATCH] powerpc: remove fpscr use from [kvm_]cvt_{fd,df}

2010-08-23 Thread Kumar Gala

On Aug 22, 2010, at 7:23 PM, Michael Neuling wrote:

 Neither lfs nor stfs touch the fpscr, so remove the restore/save of it
 around them.
 
 Do some 32 bit processors need this? 
 
 In 32 bit before the merge, we use to have code that did:
 
  #if defined(CONFIG_4xx) || defined(CONFIG_E500)
   #define cvt_fd without save/restore fpscr
  #else
   #define cvt_fd with save/restore fpscr
  #end if
 
 Kumar; does this ring any bells?
 
 (The addition of this predates even bitkeeper)
 
 Mikey

Not really.  However if the ifdef is as you say that seems wrong to me.  We 
should be using CONFIG_PPC_FPU or !CONFIG_PPC_FPU.  As both 4xx and E500 have 
variants w/FPUs.

- k--
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: [PATCH 00/27] KVM PPC PV framework v3

2010-08-06 Thread Kumar Gala

On Jul 29, 2010, at 7:47 AM, Alexander Graf wrote:

 [without]
 
 debian-powerpc:~# time for i in {1..1000}; do /bin/echo hello  /dev/null; 
 done
 
 real0m14.659s
 user0m8.967s
 sys 0m5.688s
 
 [with]
 
 debian-powerpc:~# time for i in {1..1000}; do /bin/echo hello  /dev/null; 
 done
 
 real0m7.557s
 user0m4.121s
 sys 0m3.426s

Do you have #'s for w/o HV to compare to.

- k--
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: [PATCH 4/4] kvmppc: convert wrteei to wrtee as kvm guest optimization

2008-08-21 Thread Kumar Gala


On Aug 19, 2008, at 5:36 AM, [EMAIL PROTECTED] wrote:


From: Christian Ehrhardt [EMAIL PROTECTED]

Dependent on the already existing CONFIG_KVM_GUEST config option  
this patch
changes wrteei to wrtee allowing the hypervisor to rewrite those to  
nontrapping
instructions. Maybe we should split the kvm guest otpimizations in  
two parts
one for the overhead free optimizations and on for the rest that  
might add

some complexity for non virtualized execution (like this one).

Signed-off-by: Christian Ehrhardt [EMAIL PROTECTED]
---


So this commit message doesnt explain why 'wrtee' facilities doing  
whatever optimization and 'wrteei' doesnt.


- k
--
To unsubscribe from this list: send the line unsubscribe kvm-ppc in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html