RE: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for SPE/FP/AltiVec int numbers

2014-07-28 Thread mihai.cara...@freescale.com
 -Original Message-
 From: Wood Scott-B07421
 Sent: Saturday, July 26, 2014 3:11 AM
 To: Caraman Mihai Claudiu-B02008
 Cc: Alexander Graf; kvm-...@vger.kernel.org; kvm@vger.kernel.org;
 linuxppc-...@lists.ozlabs.org
 Subject: Re: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for
 SPE/FP/AltiVec int numbers
 
 On Thu, 2014-07-24 at 04:16 -0500, Caraman Mihai Claudiu-B02008 wrote:
  Scott, Alex's request to define SPE handlers only for e500v2 implies
 changes
  in 32-bit FSL kernel to have exclusive configurations for e200/e500v2
 and
  e500mc/e5500. We would probably need something like this, what's your
 take on it?
 
 That is already a compile-time decision.

Yes, but is not fully implemented.

 
  diff --git a/arch/powerpc/kernel/head_fsl_booke.S
 b/arch/powerpc/kernel/head_fsl_booke.S
  index b497188..9d41015 100644
  --- a/arch/powerpc/kernel/head_fsl_booke.S
  +++ b/arch/powerpc/kernel/head_fsl_booke.S
  @@ -613,6 +613,8 @@ END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV)
  mfspr   r10, SPRN_SPRG_RSCRATCH0
  b   InstructionStorage
 
  +/* Define SPE handlers only for e500v2 and e200 */
  +#ifndef CONFIG_PPC_E500MC
   #ifdef CONFIG_SPE
  /* SPE Unavailable */
  START_EXCEPTION(SPEUnavailable)
  @@ -626,7 +628,9 @@ END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV)
  EXCEPTION(0x2020, SPE_ALTIVEC_UNAVAIL, SPEUnavailable, \
unknown_exception, EXC_XFER_EE)
   #endif /* CONFIG_SPE */
  +#endif
 
 This is redundant:
 
 config SPE
 bool SPE Support
 depends on E200 || (E500  !PPC_E500MC)
 default y

I see what you mean, but it's not redundant. Alex was looking to remove SPE
handlers for e500mc+ and the proposal handled !SPE case. In the new
light I find this variant more readable:

+/* Define SPE handlers for e200 and e500v2 */
 #ifdef CONFIG_SPE
/* SPE Unavailable */
START_EXCEPTION(SPEUnavailable)
@@ -622,11 +623,13 @@ END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV)
b   fast_exception_return
 1: addir3,r1,STACK_FRAME_OVERHEAD
EXC_XFER_EE_LITE(0x2010, KernelSPE)
-#else
+#elif defined(CONFIG_E200) || \
+  (defined(CONFIG_E500)  !defined(CONFIG_PPC_E500MC))
EXCEPTION(0x2020, SPE_ALTIVEC_UNAVAIL, SPEUnavailable, \
  unknown_exception, EXC_XFER_EE)
 #endif /* CONFIG_SPE */

 
  diff --git a/arch/powerpc/kernel/cputable.c
 b/arch/powerpc/kernel/cputable.c
  index c1faade..3ab65c2 100644
  --- a/arch/powerpc/kernel/cputable.c
  +++ b/arch/powerpc/kernel/cputable.c
  @@ -2030,6 +2030,7 @@ static struct cpu_spec __initdata cpu_specs[] = {
   #endif /* CONFIG_PPC32 */
   #ifdef CONFIG_E500
   #ifdef CONFIG_PPC32
  +#ifndef CONFIG_PPC_E500MC
  {   /* e500 */
  .pvr_mask   = 0x,
  .pvr_value  = 0x8020,
  @@ -2069,6 +2070,7 @@ static struct cpu_spec __initdata cpu_specs[] = {
  .machine_check  = machine_check_e500,
  .platform   = ppc8548,
  },
  +#endif /* !CONFIG_PPC_E500MC */
  {   /* e500mc */
  .pvr_mask   = 0x,
  .pvr_value  = 0x8023,
 
 
 This looks a bit strange -- e500v2 gets excluded if PPC_E500MC, but
 e500mc gets included in !PPC_E500MC?

Right, my main purpose was to get rid of __setup_e500_ivors on PPC_E500MC
which refers SPEUnavailable. I will add an #else to exclude e500mc.

The generic E500 PPC default cpu advertises PPC_FEATURE_HAS_SPE_COMP.
Do we want to excluded it if PPC_E500MC? Is this cpu useful without cpu_setup()
and if so why don't we also have a default for 64-bit?

-Mike


Re: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for SPE/FP/AltiVec int numbers

2014-07-28 Thread Scott Wood
On Mon, 2014-07-28 at 03:54 -0500, Caraman Mihai Claudiu-B02008 wrote:
  -Original Message-
  From: Wood Scott-B07421
  Sent: Saturday, July 26, 2014 3:11 AM
  To: Caraman Mihai Claudiu-B02008
  Cc: Alexander Graf; kvm-...@vger.kernel.org; kvm@vger.kernel.org;
  linuxppc-...@lists.ozlabs.org
  Subject: Re: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for
  SPE/FP/AltiVec int numbers
  
  On Thu, 2014-07-24 at 04:16 -0500, Caraman Mihai Claudiu-B02008 wrote:
   Scott, Alex's request to define SPE handlers only for e500v2 implies
  changes
   in 32-bit FSL kernel to have exclusive configurations for e200/e500v2
  and
   e500mc/e5500. We would probably need something like this, what's your
  take on it?
  
  That is already a compile-time decision.
 
 Yes, but is not fully implemented.

We might be missing some kconfig language to prohibit e500v2 boards from
being enabled in an e500mc kernel, but if you try to do so it won't work
(except for obsolete hacks like running QEMU's mpc8544ds platform with
-cpu e500mc).

   diff --git a/arch/powerpc/kernel/head_fsl_booke.S
  b/arch/powerpc/kernel/head_fsl_booke.S
   index b497188..9d41015 100644
   --- a/arch/powerpc/kernel/head_fsl_booke.S
   +++ b/arch/powerpc/kernel/head_fsl_booke.S
   @@ -613,6 +613,8 @@ END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV)
   mfspr   r10, SPRN_SPRG_RSCRATCH0
   b   InstructionStorage
  
   +/* Define SPE handlers only for e500v2 and e200 */
   +#ifndef CONFIG_PPC_E500MC
#ifdef CONFIG_SPE
   /* SPE Unavailable */
   START_EXCEPTION(SPEUnavailable)
   @@ -626,7 +628,9 @@ END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV)
   EXCEPTION(0x2020, SPE_ALTIVEC_UNAVAIL, SPEUnavailable, \
 unknown_exception, EXC_XFER_EE)
#endif /* CONFIG_SPE */
   +#endif
  
  This is redundant:
  
  config SPE
  bool SPE Support
  depends on E200 || (E500  !PPC_E500MC)
  default y
 
 I see what you mean, but it's not redundant.

OK, I didn't realize there was an #else that wasn't included in the
context.  It would have been nice if the comment at the end were
!CONFIG_SPE rather than CONFIG_SPE.

 Alex was looking to remove SPE
 handlers for e500mc+ and the proposal handled !SPE case. In the new
 light I find this variant more readable:
 
 +/* Define SPE handlers for e200 and e500v2 */
  #ifdef CONFIG_SPE
 /* SPE Unavailable */
 START_EXCEPTION(SPEUnavailable)
 @@ -622,11 +623,13 @@ END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV)
 b   fast_exception_return
  1: addir3,r1,STACK_FRAME_OVERHEAD
 EXC_XFER_EE_LITE(0x2010, KernelSPE)
 -#else
 +#elif defined(CONFIG_E200) || \
 +  (defined(CONFIG_E500)  !defined(CONFIG_PPC_E500MC))
 EXCEPTION(0x2020, SPE_ALTIVEC_UNAVAIL, SPEUnavailable, \
   unknown_exception, EXC_XFER_EE)
  #endif /* CONFIG_SPE */

Yes, or better define a CONFIG_SPE_POSSIBLE so that the list only has to
exist in one place, and the intent is clearer.
 
   diff --git a/arch/powerpc/kernel/cputable.c
  b/arch/powerpc/kernel/cputable.c
   index c1faade..3ab65c2 100644
   --- a/arch/powerpc/kernel/cputable.c
   +++ b/arch/powerpc/kernel/cputable.c
   @@ -2030,6 +2030,7 @@ static struct cpu_spec __initdata cpu_specs[] = {
#endif /* CONFIG_PPC32 */
#ifdef CONFIG_E500
#ifdef CONFIG_PPC32
   +#ifndef CONFIG_PPC_E500MC
   {   /* e500 */
   .pvr_mask   = 0x,
   .pvr_value  = 0x8020,
   @@ -2069,6 +2070,7 @@ static struct cpu_spec __initdata cpu_specs[] = {
   .machine_check  = machine_check_e500,
   .platform   = ppc8548,
   },
   +#endif /* !CONFIG_PPC_E500MC */
   {   /* e500mc */
   .pvr_mask   = 0x,
   .pvr_value  = 0x8023,
  
  
  This looks a bit strange -- e500v2 gets excluded if PPC_E500MC, but
  e500mc gets included in !PPC_E500MC?
 
 Right, my main purpose was to get rid of __setup_e500_ivors on PPC_E500MC
 which refers SPEUnavailable. I will add an #else to exclude e500mc.
 
 The generic E500 PPC default cpu advertises PPC_FEATURE_HAS_SPE_COMP.
 Do we want to excluded it if PPC_E500MC? Is this cpu useful without 
 cpu_setup()
 and if so why don't we also have a default for 64-bit?

I don't think that default will do anything useful.

-Scott


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


RE: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for SPE/FP/AltiVec int numbers

2014-07-28 Thread mihai.cara...@freescale.com
 -Original Message-
 From: Wood Scott-B07421
 Sent: Saturday, July 26, 2014 3:11 AM
 To: Caraman Mihai Claudiu-B02008
 Cc: Alexander Graf; kvm-ppc@vger.kernel.org; k...@vger.kernel.org;
 linuxppc-...@lists.ozlabs.org
 Subject: Re: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for
 SPE/FP/AltiVec int numbers
 
 On Thu, 2014-07-24 at 04:16 -0500, Caraman Mihai Claudiu-B02008 wrote:
  Scott, Alex's request to define SPE handlers only for e500v2 implies
 changes
  in 32-bit FSL kernel to have exclusive configurations for e200/e500v2
 and
  e500mc/e5500. We would probably need something like this, what's your
 take on it?
 
 That is already a compile-time decision.

Yes, but is not fully implemented.

 
  diff --git a/arch/powerpc/kernel/head_fsl_booke.S
 b/arch/powerpc/kernel/head_fsl_booke.S
  index b497188..9d41015 100644
  --- a/arch/powerpc/kernel/head_fsl_booke.S
  +++ b/arch/powerpc/kernel/head_fsl_booke.S
  @@ -613,6 +613,8 @@ END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV)
  mfspr   r10, SPRN_SPRG_RSCRATCH0
  b   InstructionStorage
 
  +/* Define SPE handlers only for e500v2 and e200 */
  +#ifndef CONFIG_PPC_E500MC
   #ifdef CONFIG_SPE
  /* SPE Unavailable */
  START_EXCEPTION(SPEUnavailable)
  @@ -626,7 +628,9 @@ END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV)
  EXCEPTION(0x2020, SPE_ALTIVEC_UNAVAIL, SPEUnavailable, \
unknown_exception, EXC_XFER_EE)
   #endif /* CONFIG_SPE */
  +#endif
 
 This is redundant:
 
 config SPE
 bool SPE Support
 depends on E200 || (E500  !PPC_E500MC)
 default y

I see what you mean, but it's not redundant. Alex was looking to remove SPE
handlers for e500mc+ and the proposal handled !SPE case. In the new
light I find this variant more readable:

+/* Define SPE handlers for e200 and e500v2 */
 #ifdef CONFIG_SPE
/* SPE Unavailable */
START_EXCEPTION(SPEUnavailable)
@@ -622,11 +623,13 @@ END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV)
b   fast_exception_return
 1: addir3,r1,STACK_FRAME_OVERHEAD
EXC_XFER_EE_LITE(0x2010, KernelSPE)
-#else
+#elif defined(CONFIG_E200) || \
+  (defined(CONFIG_E500)  !defined(CONFIG_PPC_E500MC))
EXCEPTION(0x2020, SPE_ALTIVEC_UNAVAIL, SPEUnavailable, \
  unknown_exception, EXC_XFER_EE)
 #endif /* CONFIG_SPE */

 
  diff --git a/arch/powerpc/kernel/cputable.c
 b/arch/powerpc/kernel/cputable.c
  index c1faade..3ab65c2 100644
  --- a/arch/powerpc/kernel/cputable.c
  +++ b/arch/powerpc/kernel/cputable.c
  @@ -2030,6 +2030,7 @@ static struct cpu_spec __initdata cpu_specs[] = {
   #endif /* CONFIG_PPC32 */
   #ifdef CONFIG_E500
   #ifdef CONFIG_PPC32
  +#ifndef CONFIG_PPC_E500MC
  {   /* e500 */
  .pvr_mask   = 0x,
  .pvr_value  = 0x8020,
  @@ -2069,6 +2070,7 @@ static struct cpu_spec __initdata cpu_specs[] = {
  .machine_check  = machine_check_e500,
  .platform   = ppc8548,
  },
  +#endif /* !CONFIG_PPC_E500MC */
  {   /* e500mc */
  .pvr_mask   = 0x,
  .pvr_value  = 0x8023,
 
 
 This looks a bit strange -- e500v2 gets excluded if PPC_E500MC, but
 e500mc gets included in !PPC_E500MC?

Right, my main purpose was to get rid of __setup_e500_ivors on PPC_E500MC
which refers SPEUnavailable. I will add an #else to exclude e500mc.

The generic E500 PPC default cpu advertises PPC_FEATURE_HAS_SPE_COMP.
Do we want to excluded it if PPC_E500MC? Is this cpu useful without cpu_setup()
and if so why don't we also have a default for 64-bit?

-Mike


Re: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for SPE/FP/AltiVec int numbers

2014-07-28 Thread Scott Wood
On Mon, 2014-07-28 at 03:54 -0500, Caraman Mihai Claudiu-B02008 wrote:
  -Original Message-
  From: Wood Scott-B07421
  Sent: Saturday, July 26, 2014 3:11 AM
  To: Caraman Mihai Claudiu-B02008
  Cc: Alexander Graf; kvm-ppc@vger.kernel.org; k...@vger.kernel.org;
  linuxppc-...@lists.ozlabs.org
  Subject: Re: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for
  SPE/FP/AltiVec int numbers
  
  On Thu, 2014-07-24 at 04:16 -0500, Caraman Mihai Claudiu-B02008 wrote:
   Scott, Alex's request to define SPE handlers only for e500v2 implies
  changes
   in 32-bit FSL kernel to have exclusive configurations for e200/e500v2
  and
   e500mc/e5500. We would probably need something like this, what's your
  take on it?
  
  That is already a compile-time decision.
 
 Yes, but is not fully implemented.

We might be missing some kconfig language to prohibit e500v2 boards from
being enabled in an e500mc kernel, but if you try to do so it won't work
(except for obsolete hacks like running QEMU's mpc8544ds platform with
-cpu e500mc).

   diff --git a/arch/powerpc/kernel/head_fsl_booke.S
  b/arch/powerpc/kernel/head_fsl_booke.S
   index b497188..9d41015 100644
   --- a/arch/powerpc/kernel/head_fsl_booke.S
   +++ b/arch/powerpc/kernel/head_fsl_booke.S
   @@ -613,6 +613,8 @@ END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV)
   mfspr   r10, SPRN_SPRG_RSCRATCH0
   b   InstructionStorage
  
   +/* Define SPE handlers only for e500v2 and e200 */
   +#ifndef CONFIG_PPC_E500MC
#ifdef CONFIG_SPE
   /* SPE Unavailable */
   START_EXCEPTION(SPEUnavailable)
   @@ -626,7 +628,9 @@ END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV)
   EXCEPTION(0x2020, SPE_ALTIVEC_UNAVAIL, SPEUnavailable, \
 unknown_exception, EXC_XFER_EE)
#endif /* CONFIG_SPE */
   +#endif
  
  This is redundant:
  
  config SPE
  bool SPE Support
  depends on E200 || (E500  !PPC_E500MC)
  default y
 
 I see what you mean, but it's not redundant.

OK, I didn't realize there was an #else that wasn't included in the
context.  It would have been nice if the comment at the end were
!CONFIG_SPE rather than CONFIG_SPE.

 Alex was looking to remove SPE
 handlers for e500mc+ and the proposal handled !SPE case. In the new
 light I find this variant more readable:
 
 +/* Define SPE handlers for e200 and e500v2 */
  #ifdef CONFIG_SPE
 /* SPE Unavailable */
 START_EXCEPTION(SPEUnavailable)
 @@ -622,11 +623,13 @@ END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV)
 b   fast_exception_return
  1: addir3,r1,STACK_FRAME_OVERHEAD
 EXC_XFER_EE_LITE(0x2010, KernelSPE)
 -#else
 +#elif defined(CONFIG_E200) || \
 +  (defined(CONFIG_E500)  !defined(CONFIG_PPC_E500MC))
 EXCEPTION(0x2020, SPE_ALTIVEC_UNAVAIL, SPEUnavailable, \
   unknown_exception, EXC_XFER_EE)
  #endif /* CONFIG_SPE */

Yes, or better define a CONFIG_SPE_POSSIBLE so that the list only has to
exist in one place, and the intent is clearer.
 
   diff --git a/arch/powerpc/kernel/cputable.c
  b/arch/powerpc/kernel/cputable.c
   index c1faade..3ab65c2 100644
   --- a/arch/powerpc/kernel/cputable.c
   +++ b/arch/powerpc/kernel/cputable.c
   @@ -2030,6 +2030,7 @@ static struct cpu_spec __initdata cpu_specs[] = {
#endif /* CONFIG_PPC32 */
#ifdef CONFIG_E500
#ifdef CONFIG_PPC32
   +#ifndef CONFIG_PPC_E500MC
   {   /* e500 */
   .pvr_mask   = 0x,
   .pvr_value  = 0x8020,
   @@ -2069,6 +2070,7 @@ static struct cpu_spec __initdata cpu_specs[] = {
   .machine_check  = machine_check_e500,
   .platform   = ppc8548,
   },
   +#endif /* !CONFIG_PPC_E500MC */
   {   /* e500mc */
   .pvr_mask   = 0x,
   .pvr_value  = 0x8023,
  
  
  This looks a bit strange -- e500v2 gets excluded if PPC_E500MC, but
  e500mc gets included in !PPC_E500MC?
 
 Right, my main purpose was to get rid of __setup_e500_ivors on PPC_E500MC
 which refers SPEUnavailable. I will add an #else to exclude e500mc.
 
 The generic E500 PPC default cpu advertises PPC_FEATURE_HAS_SPE_COMP.
 Do we want to excluded it if PPC_E500MC? Is this cpu useful without 
 cpu_setup()
 and if so why don't we also have a default for 64-bit?

I don't think that default will do anything useful.

-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: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for SPE/FP/AltiVec int numbers

2014-07-25 Thread Scott Wood
On Thu, 2014-07-24 at 04:16 -0500, Caraman Mihai Claudiu-B02008 wrote:
 Scott, Alex's request to define SPE handlers only for e500v2 implies changes
 in 32-bit FSL kernel to have exclusive configurations for e200/e500v2 and
 e500mc/e5500. We would probably need something like this, what's your take on 
 it?

That is already a compile-time decision.

 diff --git a/arch/powerpc/kernel/head_fsl_booke.S 
 b/arch/powerpc/kernel/head_fsl_booke.S
 index b497188..9d41015 100644
 --- a/arch/powerpc/kernel/head_fsl_booke.S
 +++ b/arch/powerpc/kernel/head_fsl_booke.S
 @@ -613,6 +613,8 @@ END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV)
 mfspr   r10, SPRN_SPRG_RSCRATCH0
 b   InstructionStorage
  
 +/* Define SPE handlers only for e500v2 and e200 */
 +#ifndef CONFIG_PPC_E500MC
  #ifdef CONFIG_SPE
 /* SPE Unavailable */
 START_EXCEPTION(SPEUnavailable)
 @@ -626,7 +628,9 @@ END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV)
 EXCEPTION(0x2020, SPE_ALTIVEC_UNAVAIL, SPEUnavailable, \
   unknown_exception, EXC_XFER_EE)
  #endif /* CONFIG_SPE */
 +#endif

This is redundant:

config SPE
bool SPE Support
depends on E200 || (E500  !PPC_E500MC)
default y 

 diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
 index c1faade..3ab65c2 100644
 --- a/arch/powerpc/kernel/cputable.c
 +++ b/arch/powerpc/kernel/cputable.c
 @@ -2030,6 +2030,7 @@ static struct cpu_spec __initdata cpu_specs[] = {
  #endif /* CONFIG_PPC32 */
  #ifdef CONFIG_E500
  #ifdef CONFIG_PPC32
 +#ifndef CONFIG_PPC_E500MC
 {   /* e500 */
 .pvr_mask   = 0x,
 .pvr_value  = 0x8020,
 @@ -2069,6 +2070,7 @@ static struct cpu_spec __initdata cpu_specs[] = {
 .machine_check  = machine_check_e500,
 .platform   = ppc8548,
 },
 +#endif /* !CONFIG_PPC_E500MC */
 {   /* e500mc */
 .pvr_mask   = 0x,
 .pvr_value  = 0x8023,
 

This looks a bit strange -- e500v2 gets excluded if PPC_E500MC, but
e500mc gets included in !PPC_E500MC?

-Scott


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


Re: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for SPE/FP/AltiVec int numbers

2014-07-25 Thread Scott Wood
On Thu, 2014-07-24 at 04:16 -0500, Caraman Mihai Claudiu-B02008 wrote:
 Scott, Alex's request to define SPE handlers only for e500v2 implies changes
 in 32-bit FSL kernel to have exclusive configurations for e200/e500v2 and
 e500mc/e5500. We would probably need something like this, what's your take on 
 it?

That is already a compile-time decision.

 diff --git a/arch/powerpc/kernel/head_fsl_booke.S 
 b/arch/powerpc/kernel/head_fsl_booke.S
 index b497188..9d41015 100644
 --- a/arch/powerpc/kernel/head_fsl_booke.S
 +++ b/arch/powerpc/kernel/head_fsl_booke.S
 @@ -613,6 +613,8 @@ END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV)
 mfspr   r10, SPRN_SPRG_RSCRATCH0
 b   InstructionStorage
  
 +/* Define SPE handlers only for e500v2 and e200 */
 +#ifndef CONFIG_PPC_E500MC
  #ifdef CONFIG_SPE
 /* SPE Unavailable */
 START_EXCEPTION(SPEUnavailable)
 @@ -626,7 +628,9 @@ END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV)
 EXCEPTION(0x2020, SPE_ALTIVEC_UNAVAIL, SPEUnavailable, \
   unknown_exception, EXC_XFER_EE)
  #endif /* CONFIG_SPE */
 +#endif

This is redundant:

config SPE
bool SPE Support
depends on E200 || (E500  !PPC_E500MC)
default y 

 diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
 index c1faade..3ab65c2 100644
 --- a/arch/powerpc/kernel/cputable.c
 +++ b/arch/powerpc/kernel/cputable.c
 @@ -2030,6 +2030,7 @@ static struct cpu_spec __initdata cpu_specs[] = {
  #endif /* CONFIG_PPC32 */
  #ifdef CONFIG_E500
  #ifdef CONFIG_PPC32
 +#ifndef CONFIG_PPC_E500MC
 {   /* e500 */
 .pvr_mask   = 0x,
 .pvr_value  = 0x8020,
 @@ -2069,6 +2070,7 @@ static struct cpu_spec __initdata cpu_specs[] = {
 .machine_check  = machine_check_e500,
 .platform   = ppc8548,
 },
 +#endif /* !CONFIG_PPC_E500MC */
 {   /* e500mc */
 .pvr_mask   = 0x,
 .pvr_value  = 0x8023,
 

This looks a bit strange -- e500v2 gets excluded if PPC_E500MC, but
e500mc gets included in !PPC_E500MC?

-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: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for SPE/FP/AltiVec int numbers

2014-07-24 Thread mihai.cara...@freescale.com
 -Original Message-
 From: kvm-ppc-ow...@vger.kernel.org [mailto:kvm-ppc-
 ow...@vger.kernel.org] On Behalf Of mihai.cara...@freescale.com
 Sent: Monday, July 21, 2014 4:23 PM
 To: Alexander Graf; Wood Scott-B07421
 Cc: kvm-...@vger.kernel.org; kvm@vger.kernel.org; linuxppc-
 d...@lists.ozlabs.org
 Subject: RE: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for
 SPE/FP/AltiVec int numbers
 
  -Original Message-
  From: Alexander Graf [mailto:ag...@suse.de]
  Sent: Thursday, July 03, 2014 3:21 PM
  To: Caraman Mihai Claudiu-B02008; kvm-...@vger.kernel.org
  Cc: kvm@vger.kernel.org; linuxppc-...@lists.ozlabs.org
  Subject: Re: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for
  SPE/FP/AltiVec int numbers
 
 
  On 30.06.14 17:34, Mihai Caraman wrote:
   Use common BOOKE_IRQPRIO and BOOKE_INTERRUPT defines for
 SPE/FP/AltiVec
   which share the same interrupt numbers.
  
   Signed-off-by: Mihai Caraman mihai.cara...@freescale.com
   ---
   v2:
 - remove outdated definitions
  
 arch/powerpc/include/asm/kvm_asm.h|  8 
 arch/powerpc/kvm/booke.c  | 17 +
 arch/powerpc/kvm/booke.h  |  4 ++--
 arch/powerpc/kvm/booke_interrupts.S   |  9 +
 arch/powerpc/kvm/bookehv_interrupts.S |  4 ++--
 arch/powerpc/kvm/e500.c   | 10 ++
 arch/powerpc/kvm/e500_emulate.c   | 10 ++
 7 files changed, 30 insertions(+), 32 deletions(-)
  
   diff --git a/arch/powerpc/include/asm/kvm_asm.h
  b/arch/powerpc/include/asm/kvm_asm.h
   index 9601741..c94fd33 100644
   --- a/arch/powerpc/include/asm/kvm_asm.h
   +++ b/arch/powerpc/include/asm/kvm_asm.h
   @@ -56,14 +56,6 @@
 /* E500 */
 #define BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL 32
 #define BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST 33
   -/*
   - * TODO: Unify 32-bit and 64-bit kernel exception handlers to use
 same
  defines
   - */
   -#define BOOKE_INTERRUPT_SPE_UNAVAIL
  BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL
   -#define BOOKE_INTERRUPT_SPE_FP_DATA
  BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST
   -#define BOOKE_INTERRUPT_ALTIVEC_UNAVAIL
  BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL
   -#define BOOKE_INTERRUPT_ALTIVEC_ASSIST \
   - BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST
 
  I think I'd prefer to keep them separate.
 
 #define BOOKE_INTERRUPT_SPE_FP_ROUND 34
 #define BOOKE_INTERRUPT_PERFORMANCE_MONITOR 35
 #define BOOKE_INTERRUPT_DOORBELL 36
   diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
   index ab62109..3c86d9b 100644
   --- a/arch/powerpc/kvm/booke.c
   +++ b/arch/powerpc/kvm/booke.c
   @@ -388,8 +388,8 @@ static int kvmppc_booke_irqprio_deliver(struct
  kvm_vcpu *vcpu,
 case BOOKE_IRQPRIO_ITLB_MISS:
 case BOOKE_IRQPRIO_SYSCALL:
 case BOOKE_IRQPRIO_FP_UNAVAIL:
   - case BOOKE_IRQPRIO_SPE_UNAVAIL:
   - case BOOKE_IRQPRIO_SPE_FP_DATA:
   + case BOOKE_IRQPRIO_SPE_ALTIVEC_UNAVAIL:
   + case BOOKE_IRQPRIO_SPE_FP_DATA_ALTIVEC_ASSIST:
 
  #ifdef CONFIG_KVM_E500V2
 case ...SPE:
  #else
 case ..ALTIVEC:
  #endif
 
 case BOOKE_IRQPRIO_SPE_FP_ROUND:
 case BOOKE_IRQPRIO_AP_UNAVAIL:
 allowed = 1;
   @@ -977,18 +977,19 @@ int kvmppc_handle_exit(struct kvm_run *run,
  struct kvm_vcpu *vcpu,
 break;
  
 #ifdef CONFIG_SPE
   - case BOOKE_INTERRUPT_SPE_UNAVAIL: {
   + case BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL: {
 if (vcpu-arch.shared-msr  MSR_SPE)
 kvmppc_vcpu_enable_spe(vcpu);
 else
 kvmppc_booke_queue_irqprio(vcpu,
   -BOOKE_IRQPRIO_SPE_UNAVAIL);
   + BOOKE_IRQPRIO_SPE_ALTIVEC_UNAVAIL);
 r = RESUME_GUEST;
 break;
 }
  
   - case BOOKE_INTERRUPT_SPE_FP_DATA:
   - kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_SPE_FP_DATA);
   + case BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST:
   + kvmppc_booke_queue_irqprio(vcpu,
   + BOOKE_IRQPRIO_SPE_FP_DATA_ALTIVEC_ASSIST);
 r = RESUME_GUEST;
 break;
  
   @@ -997,7 +998,7 @@ int kvmppc_handle_exit(struct kvm_run *run,
 struct
  kvm_vcpu *vcpu,
 r = RESUME_GUEST;
 break;
 #else
   - case BOOKE_INTERRUPT_SPE_UNAVAIL:
   + case BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL:
 /*
  * Guest wants SPE, but host kernel doesn't support it.
 Send
  * an unimplemented operation program check to the
 guest.
   @@ -1010,7 +1011,7 @@ int kvmppc_handle_exit(struct kvm_run *run,
  struct kvm_vcpu *vcpu,
  * These really should never happen without CONFIG_SPE,
  * as we should never enable the real MSR[SPE] in the guest.
  */
   - case

RE: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for SPE/FP/AltiVec int numbers

2014-07-24 Thread mihai.cara...@freescale.com
 -Original Message-
 From: kvm-ppc-ow...@vger.kernel.org [mailto:kvm-ppc-
 ow...@vger.kernel.org] On Behalf Of mihai.cara...@freescale.com
 Sent: Monday, July 21, 2014 4:23 PM
 To: Alexander Graf; Wood Scott-B07421
 Cc: kvm-ppc@vger.kernel.org; k...@vger.kernel.org; linuxppc-
 d...@lists.ozlabs.org
 Subject: RE: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for
 SPE/FP/AltiVec int numbers
 
  -Original Message-
  From: Alexander Graf [mailto:ag...@suse.de]
  Sent: Thursday, July 03, 2014 3:21 PM
  To: Caraman Mihai Claudiu-B02008; kvm-ppc@vger.kernel.org
  Cc: k...@vger.kernel.org; linuxppc-...@lists.ozlabs.org
  Subject: Re: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for
  SPE/FP/AltiVec int numbers
 
 
  On 30.06.14 17:34, Mihai Caraman wrote:
   Use common BOOKE_IRQPRIO and BOOKE_INTERRUPT defines for
 SPE/FP/AltiVec
   which share the same interrupt numbers.
  
   Signed-off-by: Mihai Caraman mihai.cara...@freescale.com
   ---
   v2:
 - remove outdated definitions
  
 arch/powerpc/include/asm/kvm_asm.h|  8 
 arch/powerpc/kvm/booke.c  | 17 +
 arch/powerpc/kvm/booke.h  |  4 ++--
 arch/powerpc/kvm/booke_interrupts.S   |  9 +
 arch/powerpc/kvm/bookehv_interrupts.S |  4 ++--
 arch/powerpc/kvm/e500.c   | 10 ++
 arch/powerpc/kvm/e500_emulate.c   | 10 ++
 7 files changed, 30 insertions(+), 32 deletions(-)
  
   diff --git a/arch/powerpc/include/asm/kvm_asm.h
  b/arch/powerpc/include/asm/kvm_asm.h
   index 9601741..c94fd33 100644
   --- a/arch/powerpc/include/asm/kvm_asm.h
   +++ b/arch/powerpc/include/asm/kvm_asm.h
   @@ -56,14 +56,6 @@
 /* E500 */
 #define BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL 32
 #define BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST 33
   -/*
   - * TODO: Unify 32-bit and 64-bit kernel exception handlers to use
 same
  defines
   - */
   -#define BOOKE_INTERRUPT_SPE_UNAVAIL
  BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL
   -#define BOOKE_INTERRUPT_SPE_FP_DATA
  BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST
   -#define BOOKE_INTERRUPT_ALTIVEC_UNAVAIL
  BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL
   -#define BOOKE_INTERRUPT_ALTIVEC_ASSIST \
   - BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST
 
  I think I'd prefer to keep them separate.
 
 #define BOOKE_INTERRUPT_SPE_FP_ROUND 34
 #define BOOKE_INTERRUPT_PERFORMANCE_MONITOR 35
 #define BOOKE_INTERRUPT_DOORBELL 36
   diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
   index ab62109..3c86d9b 100644
   --- a/arch/powerpc/kvm/booke.c
   +++ b/arch/powerpc/kvm/booke.c
   @@ -388,8 +388,8 @@ static int kvmppc_booke_irqprio_deliver(struct
  kvm_vcpu *vcpu,
 case BOOKE_IRQPRIO_ITLB_MISS:
 case BOOKE_IRQPRIO_SYSCALL:
 case BOOKE_IRQPRIO_FP_UNAVAIL:
   - case BOOKE_IRQPRIO_SPE_UNAVAIL:
   - case BOOKE_IRQPRIO_SPE_FP_DATA:
   + case BOOKE_IRQPRIO_SPE_ALTIVEC_UNAVAIL:
   + case BOOKE_IRQPRIO_SPE_FP_DATA_ALTIVEC_ASSIST:
 
  #ifdef CONFIG_KVM_E500V2
 case ...SPE:
  #else
 case ..ALTIVEC:
  #endif
 
 case BOOKE_IRQPRIO_SPE_FP_ROUND:
 case BOOKE_IRQPRIO_AP_UNAVAIL:
 allowed = 1;
   @@ -977,18 +977,19 @@ int kvmppc_handle_exit(struct kvm_run *run,
  struct kvm_vcpu *vcpu,
 break;
  
 #ifdef CONFIG_SPE
   - case BOOKE_INTERRUPT_SPE_UNAVAIL: {
   + case BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL: {
 if (vcpu-arch.shared-msr  MSR_SPE)
 kvmppc_vcpu_enable_spe(vcpu);
 else
 kvmppc_booke_queue_irqprio(vcpu,
   -BOOKE_IRQPRIO_SPE_UNAVAIL);
   + BOOKE_IRQPRIO_SPE_ALTIVEC_UNAVAIL);
 r = RESUME_GUEST;
 break;
 }
  
   - case BOOKE_INTERRUPT_SPE_FP_DATA:
   - kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_SPE_FP_DATA);
   + case BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST:
   + kvmppc_booke_queue_irqprio(vcpu,
   + BOOKE_IRQPRIO_SPE_FP_DATA_ALTIVEC_ASSIST);
 r = RESUME_GUEST;
 break;
  
   @@ -997,7 +998,7 @@ int kvmppc_handle_exit(struct kvm_run *run,
 struct
  kvm_vcpu *vcpu,
 r = RESUME_GUEST;
 break;
 #else
   - case BOOKE_INTERRUPT_SPE_UNAVAIL:
   + case BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL:
 /*
  * Guest wants SPE, but host kernel doesn't support it.
 Send
  * an unimplemented operation program check to the
 guest.
   @@ -1010,7 +1011,7 @@ int kvmppc_handle_exit(struct kvm_run *run,
  struct kvm_vcpu *vcpu,
  * These really should never happen without CONFIG_SPE,
  * as we should never enable the real MSR[SPE] in the guest.
  */
   - case

RE: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for SPE/FP/AltiVec int numbers

2014-07-21 Thread mihai.cara...@freescale.com
 -Original Message-
 From: Alexander Graf [mailto:ag...@suse.de]
 Sent: Thursday, July 03, 2014 3:21 PM
 To: Caraman Mihai Claudiu-B02008; kvm-...@vger.kernel.org
 Cc: kvm@vger.kernel.org; linuxppc-...@lists.ozlabs.org
 Subject: Re: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for
 SPE/FP/AltiVec int numbers
 
 
 On 30.06.14 17:34, Mihai Caraman wrote:
  Use common BOOKE_IRQPRIO and BOOKE_INTERRUPT defines for SPE/FP/AltiVec
  which share the same interrupt numbers.
 
  Signed-off-by: Mihai Caraman mihai.cara...@freescale.com
  ---
  v2:
- remove outdated definitions
 
arch/powerpc/include/asm/kvm_asm.h|  8 
arch/powerpc/kvm/booke.c  | 17 +
arch/powerpc/kvm/booke.h  |  4 ++--
arch/powerpc/kvm/booke_interrupts.S   |  9 +
arch/powerpc/kvm/bookehv_interrupts.S |  4 ++--
arch/powerpc/kvm/e500.c   | 10 ++
arch/powerpc/kvm/e500_emulate.c   | 10 ++
7 files changed, 30 insertions(+), 32 deletions(-)
 
  diff --git a/arch/powerpc/include/asm/kvm_asm.h
 b/arch/powerpc/include/asm/kvm_asm.h
  index 9601741..c94fd33 100644
  --- a/arch/powerpc/include/asm/kvm_asm.h
  +++ b/arch/powerpc/include/asm/kvm_asm.h
  @@ -56,14 +56,6 @@
/* E500 */
#define BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL 32
#define BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST 33
  -/*
  - * TODO: Unify 32-bit and 64-bit kernel exception handlers to use same
 defines
  - */
  -#define BOOKE_INTERRUPT_SPE_UNAVAIL
 BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL
  -#define BOOKE_INTERRUPT_SPE_FP_DATA
 BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST
  -#define BOOKE_INTERRUPT_ALTIVEC_UNAVAIL
 BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL
  -#define BOOKE_INTERRUPT_ALTIVEC_ASSIST \
  -   BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST
 
 I think I'd prefer to keep them separate.
 
#define BOOKE_INTERRUPT_SPE_FP_ROUND 34
#define BOOKE_INTERRUPT_PERFORMANCE_MONITOR 35
#define BOOKE_INTERRUPT_DOORBELL 36
  diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
  index ab62109..3c86d9b 100644
  --- a/arch/powerpc/kvm/booke.c
  +++ b/arch/powerpc/kvm/booke.c
  @@ -388,8 +388,8 @@ static int kvmppc_booke_irqprio_deliver(struct
 kvm_vcpu *vcpu,
  case BOOKE_IRQPRIO_ITLB_MISS:
  case BOOKE_IRQPRIO_SYSCALL:
  case BOOKE_IRQPRIO_FP_UNAVAIL:
  -   case BOOKE_IRQPRIO_SPE_UNAVAIL:
  -   case BOOKE_IRQPRIO_SPE_FP_DATA:
  +   case BOOKE_IRQPRIO_SPE_ALTIVEC_UNAVAIL:
  +   case BOOKE_IRQPRIO_SPE_FP_DATA_ALTIVEC_ASSIST:
 
 #ifdef CONFIG_KVM_E500V2
case ...SPE:
 #else
case ..ALTIVEC:
 #endif
 
  case BOOKE_IRQPRIO_SPE_FP_ROUND:
  case BOOKE_IRQPRIO_AP_UNAVAIL:
  allowed = 1;
  @@ -977,18 +977,19 @@ int kvmppc_handle_exit(struct kvm_run *run,
 struct kvm_vcpu *vcpu,
  break;
 
#ifdef CONFIG_SPE
  -   case BOOKE_INTERRUPT_SPE_UNAVAIL: {
  +   case BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL: {
  if (vcpu-arch.shared-msr  MSR_SPE)
  kvmppc_vcpu_enable_spe(vcpu);
  else
  kvmppc_booke_queue_irqprio(vcpu,
  -  BOOKE_IRQPRIO_SPE_UNAVAIL);
  +   BOOKE_IRQPRIO_SPE_ALTIVEC_UNAVAIL);
  r = RESUME_GUEST;
  break;
  }
 
  -   case BOOKE_INTERRUPT_SPE_FP_DATA:
  -   kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_SPE_FP_DATA);
  +   case BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST:
  +   kvmppc_booke_queue_irqprio(vcpu,
  +   BOOKE_IRQPRIO_SPE_FP_DATA_ALTIVEC_ASSIST);
  r = RESUME_GUEST;
  break;
 
  @@ -997,7 +998,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct
 kvm_vcpu *vcpu,
  r = RESUME_GUEST;
  break;
#else
  -   case BOOKE_INTERRUPT_SPE_UNAVAIL:
  +   case BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL:
  /*
   * Guest wants SPE, but host kernel doesn't support it.  Send
   * an unimplemented operation program check to the guest.
  @@ -1010,7 +1011,7 @@ int kvmppc_handle_exit(struct kvm_run *run,
 struct kvm_vcpu *vcpu,
   * These really should never happen without CONFIG_SPE,
   * as we should never enable the real MSR[SPE] in the guest.
   */
  -   case BOOKE_INTERRUPT_SPE_FP_DATA:
  +   case BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST:
  case BOOKE_INTERRUPT_SPE_FP_ROUND:
  printk(KERN_CRIT %s: unexpected SPE interrupt %u at
 %08lx\n,
 __func__, exit_nr, vcpu-arch.pc);
  diff --git a/arch/powerpc/kvm/booke.h b/arch/powerpc/kvm/booke.h
  index b632cd3..f182b32 100644
  --- a/arch/powerpc/kvm/booke.h
  +++ b/arch/powerpc/kvm/booke.h
  @@ -32,8 +32,8 @@
#define BOOKE_IRQPRIO_ALIGNMENT 2
#define BOOKE_IRQPRIO_PROGRAM 3
#define BOOKE_IRQPRIO_FP_UNAVAIL 4
  -#define BOOKE_IRQPRIO_SPE_UNAVAIL 5
  -#define BOOKE_IRQPRIO_SPE_FP_DATA 6
  +#define

RE: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for SPE/FP/AltiVec int numbers

2014-07-21 Thread mihai.cara...@freescale.com
 -Original Message-
 From: Alexander Graf [mailto:ag...@suse.de]
 Sent: Thursday, July 03, 2014 3:21 PM
 To: Caraman Mihai Claudiu-B02008; kvm-ppc@vger.kernel.org
 Cc: k...@vger.kernel.org; linuxppc-...@lists.ozlabs.org
 Subject: Re: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for
 SPE/FP/AltiVec int numbers
 
 
 On 30.06.14 17:34, Mihai Caraman wrote:
  Use common BOOKE_IRQPRIO and BOOKE_INTERRUPT defines for SPE/FP/AltiVec
  which share the same interrupt numbers.
 
  Signed-off-by: Mihai Caraman mihai.cara...@freescale.com
  ---
  v2:
- remove outdated definitions
 
arch/powerpc/include/asm/kvm_asm.h|  8 
arch/powerpc/kvm/booke.c  | 17 +
arch/powerpc/kvm/booke.h  |  4 ++--
arch/powerpc/kvm/booke_interrupts.S   |  9 +
arch/powerpc/kvm/bookehv_interrupts.S |  4 ++--
arch/powerpc/kvm/e500.c   | 10 ++
arch/powerpc/kvm/e500_emulate.c   | 10 ++
7 files changed, 30 insertions(+), 32 deletions(-)
 
  diff --git a/arch/powerpc/include/asm/kvm_asm.h
 b/arch/powerpc/include/asm/kvm_asm.h
  index 9601741..c94fd33 100644
  --- a/arch/powerpc/include/asm/kvm_asm.h
  +++ b/arch/powerpc/include/asm/kvm_asm.h
  @@ -56,14 +56,6 @@
/* E500 */
#define BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL 32
#define BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST 33
  -/*
  - * TODO: Unify 32-bit and 64-bit kernel exception handlers to use same
 defines
  - */
  -#define BOOKE_INTERRUPT_SPE_UNAVAIL
 BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL
  -#define BOOKE_INTERRUPT_SPE_FP_DATA
 BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST
  -#define BOOKE_INTERRUPT_ALTIVEC_UNAVAIL
 BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL
  -#define BOOKE_INTERRUPT_ALTIVEC_ASSIST \
  -   BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST
 
 I think I'd prefer to keep them separate.
 
#define BOOKE_INTERRUPT_SPE_FP_ROUND 34
#define BOOKE_INTERRUPT_PERFORMANCE_MONITOR 35
#define BOOKE_INTERRUPT_DOORBELL 36
  diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
  index ab62109..3c86d9b 100644
  --- a/arch/powerpc/kvm/booke.c
  +++ b/arch/powerpc/kvm/booke.c
  @@ -388,8 +388,8 @@ static int kvmppc_booke_irqprio_deliver(struct
 kvm_vcpu *vcpu,
  case BOOKE_IRQPRIO_ITLB_MISS:
  case BOOKE_IRQPRIO_SYSCALL:
  case BOOKE_IRQPRIO_FP_UNAVAIL:
  -   case BOOKE_IRQPRIO_SPE_UNAVAIL:
  -   case BOOKE_IRQPRIO_SPE_FP_DATA:
  +   case BOOKE_IRQPRIO_SPE_ALTIVEC_UNAVAIL:
  +   case BOOKE_IRQPRIO_SPE_FP_DATA_ALTIVEC_ASSIST:
 
 #ifdef CONFIG_KVM_E500V2
case ...SPE:
 #else
case ..ALTIVEC:
 #endif
 
  case BOOKE_IRQPRIO_SPE_FP_ROUND:
  case BOOKE_IRQPRIO_AP_UNAVAIL:
  allowed = 1;
  @@ -977,18 +977,19 @@ int kvmppc_handle_exit(struct kvm_run *run,
 struct kvm_vcpu *vcpu,
  break;
 
#ifdef CONFIG_SPE
  -   case BOOKE_INTERRUPT_SPE_UNAVAIL: {
  +   case BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL: {
  if (vcpu-arch.shared-msr  MSR_SPE)
  kvmppc_vcpu_enable_spe(vcpu);
  else
  kvmppc_booke_queue_irqprio(vcpu,
  -  BOOKE_IRQPRIO_SPE_UNAVAIL);
  +   BOOKE_IRQPRIO_SPE_ALTIVEC_UNAVAIL);
  r = RESUME_GUEST;
  break;
  }
 
  -   case BOOKE_INTERRUPT_SPE_FP_DATA:
  -   kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_SPE_FP_DATA);
  +   case BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST:
  +   kvmppc_booke_queue_irqprio(vcpu,
  +   BOOKE_IRQPRIO_SPE_FP_DATA_ALTIVEC_ASSIST);
  r = RESUME_GUEST;
  break;
 
  @@ -997,7 +998,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct
 kvm_vcpu *vcpu,
  r = RESUME_GUEST;
  break;
#else
  -   case BOOKE_INTERRUPT_SPE_UNAVAIL:
  +   case BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL:
  /*
   * Guest wants SPE, but host kernel doesn't support it.  Send
   * an unimplemented operation program check to the guest.
  @@ -1010,7 +1011,7 @@ int kvmppc_handle_exit(struct kvm_run *run,
 struct kvm_vcpu *vcpu,
   * These really should never happen without CONFIG_SPE,
   * as we should never enable the real MSR[SPE] in the guest.
   */
  -   case BOOKE_INTERRUPT_SPE_FP_DATA:
  +   case BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST:
  case BOOKE_INTERRUPT_SPE_FP_ROUND:
  printk(KERN_CRIT %s: unexpected SPE interrupt %u at
 %08lx\n,
 __func__, exit_nr, vcpu-arch.pc);
  diff --git a/arch/powerpc/kvm/booke.h b/arch/powerpc/kvm/booke.h
  index b632cd3..f182b32 100644
  --- a/arch/powerpc/kvm/booke.h
  +++ b/arch/powerpc/kvm/booke.h
  @@ -32,8 +32,8 @@
#define BOOKE_IRQPRIO_ALIGNMENT 2
#define BOOKE_IRQPRIO_PROGRAM 3
#define BOOKE_IRQPRIO_FP_UNAVAIL 4
  -#define BOOKE_IRQPRIO_SPE_UNAVAIL 5
  -#define BOOKE_IRQPRIO_SPE_FP_DATA 6
  +#define

Re: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for SPE/FP/AltiVec int numbers

2014-07-03 Thread Alexander Graf


On 30.06.14 17:34, Mihai Caraman wrote:

Use common BOOKE_IRQPRIO and BOOKE_INTERRUPT defines for SPE/FP/AltiVec
which share the same interrupt numbers.

Signed-off-by: Mihai Caraman mihai.cara...@freescale.com
---
v2:
  - remove outdated definitions

  arch/powerpc/include/asm/kvm_asm.h|  8 
  arch/powerpc/kvm/booke.c  | 17 +
  arch/powerpc/kvm/booke.h  |  4 ++--
  arch/powerpc/kvm/booke_interrupts.S   |  9 +
  arch/powerpc/kvm/bookehv_interrupts.S |  4 ++--
  arch/powerpc/kvm/e500.c   | 10 ++
  arch/powerpc/kvm/e500_emulate.c   | 10 ++
  7 files changed, 30 insertions(+), 32 deletions(-)

diff --git a/arch/powerpc/include/asm/kvm_asm.h 
b/arch/powerpc/include/asm/kvm_asm.h
index 9601741..c94fd33 100644
--- a/arch/powerpc/include/asm/kvm_asm.h
+++ b/arch/powerpc/include/asm/kvm_asm.h
@@ -56,14 +56,6 @@
  /* E500 */
  #define BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL 32
  #define BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST 33
-/*
- * TODO: Unify 32-bit and 64-bit kernel exception handlers to use same defines
- */
-#define BOOKE_INTERRUPT_SPE_UNAVAIL BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL
-#define BOOKE_INTERRUPT_SPE_FP_DATA BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST
-#define BOOKE_INTERRUPT_ALTIVEC_UNAVAIL BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL
-#define BOOKE_INTERRUPT_ALTIVEC_ASSIST \
-   BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST


I think I'd prefer to keep them separate.


  #define BOOKE_INTERRUPT_SPE_FP_ROUND 34
  #define BOOKE_INTERRUPT_PERFORMANCE_MONITOR 35
  #define BOOKE_INTERRUPT_DOORBELL 36
diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
index ab62109..3c86d9b 100644
--- a/arch/powerpc/kvm/booke.c
+++ b/arch/powerpc/kvm/booke.c
@@ -388,8 +388,8 @@ static int kvmppc_booke_irqprio_deliver(struct kvm_vcpu 
*vcpu,
case BOOKE_IRQPRIO_ITLB_MISS:
case BOOKE_IRQPRIO_SYSCALL:
case BOOKE_IRQPRIO_FP_UNAVAIL:
-   case BOOKE_IRQPRIO_SPE_UNAVAIL:
-   case BOOKE_IRQPRIO_SPE_FP_DATA:
+   case BOOKE_IRQPRIO_SPE_ALTIVEC_UNAVAIL:
+   case BOOKE_IRQPRIO_SPE_FP_DATA_ALTIVEC_ASSIST:


#ifdef CONFIG_KVM_E500V2
  case ...SPE:
#else
  case ..ALTIVEC:
#endif


case BOOKE_IRQPRIO_SPE_FP_ROUND:
case BOOKE_IRQPRIO_AP_UNAVAIL:
allowed = 1;
@@ -977,18 +977,19 @@ int kvmppc_handle_exit(struct kvm_run *run, struct 
kvm_vcpu *vcpu,
break;
  
  #ifdef CONFIG_SPE

-   case BOOKE_INTERRUPT_SPE_UNAVAIL: {
+   case BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL: {
if (vcpu-arch.shared-msr  MSR_SPE)
kvmppc_vcpu_enable_spe(vcpu);
else
kvmppc_booke_queue_irqprio(vcpu,
-  BOOKE_IRQPRIO_SPE_UNAVAIL);
+   BOOKE_IRQPRIO_SPE_ALTIVEC_UNAVAIL);
r = RESUME_GUEST;
break;
}
  
-	case BOOKE_INTERRUPT_SPE_FP_DATA:

-   kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_SPE_FP_DATA);
+   case BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST:
+   kvmppc_booke_queue_irqprio(vcpu,
+   BOOKE_IRQPRIO_SPE_FP_DATA_ALTIVEC_ASSIST);
r = RESUME_GUEST;
break;
  
@@ -997,7 +998,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,

r = RESUME_GUEST;
break;
  #else
-   case BOOKE_INTERRUPT_SPE_UNAVAIL:
+   case BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL:
/*
 * Guest wants SPE, but host kernel doesn't support it.  Send
 * an unimplemented operation program check to the guest.
@@ -1010,7 +1011,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct 
kvm_vcpu *vcpu,
 * These really should never happen without CONFIG_SPE,
 * as we should never enable the real MSR[SPE] in the guest.
 */
-   case BOOKE_INTERRUPT_SPE_FP_DATA:
+   case BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST:
case BOOKE_INTERRUPT_SPE_FP_ROUND:
printk(KERN_CRIT %s: unexpected SPE interrupt %u at %08lx\n,
   __func__, exit_nr, vcpu-arch.pc);
diff --git a/arch/powerpc/kvm/booke.h b/arch/powerpc/kvm/booke.h
index b632cd3..f182b32 100644
--- a/arch/powerpc/kvm/booke.h
+++ b/arch/powerpc/kvm/booke.h
@@ -32,8 +32,8 @@
  #define BOOKE_IRQPRIO_ALIGNMENT 2
  #define BOOKE_IRQPRIO_PROGRAM 3
  #define BOOKE_IRQPRIO_FP_UNAVAIL 4
-#define BOOKE_IRQPRIO_SPE_UNAVAIL 5
-#define BOOKE_IRQPRIO_SPE_FP_DATA 6
+#define BOOKE_IRQPRIO_SPE_ALTIVEC_UNAVAIL 5
+#define BOOKE_IRQPRIO_SPE_FP_DATA_ALTIVEC_ASSIST 6


#ifdef CONFIG_KVM_E500V2
#define ...SPE...
#else
#define ...ALTIVEC...
#endif

That way we can be 100% sure that no SPE cruft leaks into anything.



  #define BOOKE_IRQPRIO_SPE_FP_ROUND 7
  #define BOOKE_IRQPRIO_SYSCALL 8
  #define BOOKE_IRQPRIO_AP_UNAVAIL 9
diff --git 

RE: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for SPE/FP/AltiVec int numbers

2014-07-03 Thread mihai.cara...@freescale.com
 -Original Message-
 From: Alexander Graf [mailto:ag...@suse.de]
 Sent: Thursday, July 03, 2014 3:21 PM
 To: Caraman Mihai Claudiu-B02008; kvm-...@vger.kernel.org
 Cc: kvm@vger.kernel.org; linuxppc-...@lists.ozlabs.org
 Subject: Re: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for
 SPE/FP/AltiVec int numbers
 
 
 On 30.06.14 17:34, Mihai Caraman wrote:
  Use common BOOKE_IRQPRIO and BOOKE_INTERRUPT defines for SPE/FP/AltiVec
  which share the same interrupt numbers.
 
  Signed-off-by: Mihai Caraman mihai.cara...@freescale.com
  ---
  v2:
- remove outdated definitions
 
arch/powerpc/include/asm/kvm_asm.h|  8 
arch/powerpc/kvm/booke.c  | 17 +
arch/powerpc/kvm/booke.h  |  4 ++--
arch/powerpc/kvm/booke_interrupts.S   |  9 +
arch/powerpc/kvm/bookehv_interrupts.S |  4 ++--
arch/powerpc/kvm/e500.c   | 10 ++
arch/powerpc/kvm/e500_emulate.c   | 10 ++
7 files changed, 30 insertions(+), 32 deletions(-)
 
  diff --git a/arch/powerpc/include/asm/kvm_asm.h
 b/arch/powerpc/include/asm/kvm_asm.h
  index 9601741..c94fd33 100644
  --- a/arch/powerpc/include/asm/kvm_asm.h
  +++ b/arch/powerpc/include/asm/kvm_asm.h
  @@ -56,14 +56,6 @@
/* E500 */
#define BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL 32
#define BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST 33
  -/*
  - * TODO: Unify 32-bit and 64-bit kernel exception handlers to use same
 defines
  - */
  -#define BOOKE_INTERRUPT_SPE_UNAVAIL
 BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL
  -#define BOOKE_INTERRUPT_SPE_FP_DATA
 BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST
  -#define BOOKE_INTERRUPT_ALTIVEC_UNAVAIL
 BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL
  -#define BOOKE_INTERRUPT_ALTIVEC_ASSIST \
  -   BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST
 
 I think I'd prefer to keep them separate.

What is the reason from changing your mind from ver 1? Do you want to have
different defines with same values (we specifically mapped them to the
hardware interrupt numbers). We already upstreamed the necessary changes
in the kernel. Scott, please share your opinion here.

 
#define BOOKE_INTERRUPT_SPE_FP_ROUND 34
#define BOOKE_INTERRUPT_PERFORMANCE_MONITOR 35
#define BOOKE_INTERRUPT_DOORBELL 36
  diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
  index ab62109..3c86d9b 100644
  --- a/arch/powerpc/kvm/booke.c
  +++ b/arch/powerpc/kvm/booke.c
  @@ -388,8 +388,8 @@ static int kvmppc_booke_irqprio_deliver(struct
 kvm_vcpu *vcpu,
  case BOOKE_IRQPRIO_ITLB_MISS:
  case BOOKE_IRQPRIO_SYSCALL:
  case BOOKE_IRQPRIO_FP_UNAVAIL:
  -   case BOOKE_IRQPRIO_SPE_UNAVAIL:
  -   case BOOKE_IRQPRIO_SPE_FP_DATA:
  +   case BOOKE_IRQPRIO_SPE_ALTIVEC_UNAVAIL:
  +   case BOOKE_IRQPRIO_SPE_FP_DATA_ALTIVEC_ASSIST:
 
 #ifdef CONFIG_KVM_E500V2
case ...SPE:
 #else
case ..ALTIVEC:
 #endif

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


Re: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for SPE/FP/AltiVec int numbers

2014-07-03 Thread Alexander Graf


On 03.07.14 17:25, mihai.cara...@freescale.com wrote:

-Original Message-
From: Alexander Graf [mailto:ag...@suse.de]
Sent: Thursday, July 03, 2014 3:21 PM
To: Caraman Mihai Claudiu-B02008; kvm-...@vger.kernel.org
Cc: kvm@vger.kernel.org; linuxppc-...@lists.ozlabs.org
Subject: Re: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for
SPE/FP/AltiVec int numbers


On 30.06.14 17:34, Mihai Caraman wrote:

Use common BOOKE_IRQPRIO and BOOKE_INTERRUPT defines for SPE/FP/AltiVec
which share the same interrupt numbers.

Signed-off-by: Mihai Caraman mihai.cara...@freescale.com
---
v2:
   - remove outdated definitions

   arch/powerpc/include/asm/kvm_asm.h|  8 
   arch/powerpc/kvm/booke.c  | 17 +
   arch/powerpc/kvm/booke.h  |  4 ++--
   arch/powerpc/kvm/booke_interrupts.S   |  9 +
   arch/powerpc/kvm/bookehv_interrupts.S |  4 ++--
   arch/powerpc/kvm/e500.c   | 10 ++
   arch/powerpc/kvm/e500_emulate.c   | 10 ++
   7 files changed, 30 insertions(+), 32 deletions(-)

diff --git a/arch/powerpc/include/asm/kvm_asm.h

b/arch/powerpc/include/asm/kvm_asm.h

index 9601741..c94fd33 100644
--- a/arch/powerpc/include/asm/kvm_asm.h
+++ b/arch/powerpc/include/asm/kvm_asm.h
@@ -56,14 +56,6 @@
   /* E500 */
   #define BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL 32
   #define BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST 33
-/*
- * TODO: Unify 32-bit and 64-bit kernel exception handlers to use same

defines

- */
-#define BOOKE_INTERRUPT_SPE_UNAVAIL

BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL

-#define BOOKE_INTERRUPT_SPE_FP_DATA

BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST

-#define BOOKE_INTERRUPT_ALTIVEC_UNAVAIL

BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL

-#define BOOKE_INTERRUPT_ALTIVEC_ASSIST \
-   BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST

I think I'd prefer to keep them separate.

What is the reason from changing your mind from ver 1? Do you want to have


Uh, mind to point me to an email where I said I like the approach? :)


different defines with same values (we specifically mapped them to the
hardware interrupt numbers). We already upstreamed the necessary changes


Yes, I think that'd end up the most readable flow of things.


in the kernel. Scott, please share your opinion here.


I'm not going to be religious about it, but names like 
BOOKE_IRQPRIO_SPE_FP_DATA_ALTIVEC_ASSIST are


  1) too long
  2) too ambiguous

It just means the code gets harder to read. Any way we can take to 
simplify the code flow is a win IMHO. And if I don't even remotely have 
to consider SPE when reading an Altivec path, I think that's a good 
thing :).



Alex

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


RE: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for SPE/FP/AltiVec int numbers

2014-07-03 Thread mihai.cara...@freescale.com
 -Original Message-
 From: Alexander Graf [mailto:ag...@suse.de]
 Sent: Thursday, July 03, 2014 6:31 PM
 To: Caraman Mihai Claudiu-B02008; Wood Scott-B07421; kvm-
 p...@vger.kernel.org
 Cc: kvm@vger.kernel.org; linuxppc-...@lists.ozlabs.org
 Subject: Re: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for
 SPE/FP/AltiVec int numbers
 
 
 On 03.07.14 17:25, mihai.cara...@freescale.com wrote:
  -Original Message-
  From: Alexander Graf [mailto:ag...@suse.de]
  Sent: Thursday, July 03, 2014 3:21 PM
  To: Caraman Mihai Claudiu-B02008; kvm-...@vger.kernel.org
  Cc: kvm@vger.kernel.org; linuxppc-...@lists.ozlabs.org
  Subject: Re: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for
  SPE/FP/AltiVec int numbers
 
 
  On 30.06.14 17:34, Mihai Caraman wrote:
  Use common BOOKE_IRQPRIO and BOOKE_INTERRUPT defines for
 SPE/FP/AltiVec
  which share the same interrupt numbers.
 
  Signed-off-by: Mihai Caraman mihai.cara...@freescale.com
  ---
  v2:
 - remove outdated definitions
 
 arch/powerpc/include/asm/kvm_asm.h|  8 
 arch/powerpc/kvm/booke.c  | 17 +
 arch/powerpc/kvm/booke.h  |  4 ++--
 arch/powerpc/kvm/booke_interrupts.S   |  9 +
 arch/powerpc/kvm/bookehv_interrupts.S |  4 ++--
 arch/powerpc/kvm/e500.c   | 10 ++
 arch/powerpc/kvm/e500_emulate.c   | 10 ++
 7 files changed, 30 insertions(+), 32 deletions(-)
 
  diff --git a/arch/powerpc/include/asm/kvm_asm.h
  b/arch/powerpc/include/asm/kvm_asm.h
  index 9601741..c94fd33 100644
  --- a/arch/powerpc/include/asm/kvm_asm.h
  +++ b/arch/powerpc/include/asm/kvm_asm.h
  @@ -56,14 +56,6 @@
 /* E500 */
 #define BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL 32
 #define BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST 33
  -/*
  - * TODO: Unify 32-bit and 64-bit kernel exception handlers to use
 same
  defines
  - */
  -#define BOOKE_INTERRUPT_SPE_UNAVAIL
  BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL
  -#define BOOKE_INTERRUPT_SPE_FP_DATA
  BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST
  -#define BOOKE_INTERRUPT_ALTIVEC_UNAVAIL
  BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL
  -#define BOOKE_INTERRUPT_ALTIVEC_ASSIST \
  - BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST
  I think I'd prefer to keep them separate.
  What is the reason from changing your mind from ver 1? Do you want to
 have
 
 Uh, mind to point me to an email where I said I like the approach? :)

You tacitly approved it in this thread ... I did not say you like it :)

https://lists.ozlabs.org/pipermail/linuxppc-dev/2013-July/108501.html

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


Re: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for SPE/FP/AltiVec int numbers

2014-07-03 Thread Scott Wood
On Thu, 2014-07-03 at 10:25 -0500, Caraman Mihai Claudiu-B02008 wrote:
  -Original Message-
  From: Alexander Graf [mailto:ag...@suse.de]
  Sent: Thursday, July 03, 2014 3:21 PM
  To: Caraman Mihai Claudiu-B02008; kvm-...@vger.kernel.org
  Cc: kvm@vger.kernel.org; linuxppc-...@lists.ozlabs.org
  Subject: Re: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for
  SPE/FP/AltiVec int numbers
  
  
  On 30.06.14 17:34, Mihai Caraman wrote:
   Use common BOOKE_IRQPRIO and BOOKE_INTERRUPT defines for SPE/FP/AltiVec
   which share the same interrupt numbers.
  
   Signed-off-by: Mihai Caraman mihai.cara...@freescale.com
   ---
   v2:
 - remove outdated definitions
  
 arch/powerpc/include/asm/kvm_asm.h|  8 
 arch/powerpc/kvm/booke.c  | 17 +
 arch/powerpc/kvm/booke.h  |  4 ++--
 arch/powerpc/kvm/booke_interrupts.S   |  9 +
 arch/powerpc/kvm/bookehv_interrupts.S |  4 ++--
 arch/powerpc/kvm/e500.c   | 10 ++
 arch/powerpc/kvm/e500_emulate.c   | 10 ++
 7 files changed, 30 insertions(+), 32 deletions(-)
  
   diff --git a/arch/powerpc/include/asm/kvm_asm.h
  b/arch/powerpc/include/asm/kvm_asm.h
   index 9601741..c94fd33 100644
   --- a/arch/powerpc/include/asm/kvm_asm.h
   +++ b/arch/powerpc/include/asm/kvm_asm.h
   @@ -56,14 +56,6 @@
 /* E500 */
 #define BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL 32
 #define BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST 33
   -/*
   - * TODO: Unify 32-bit and 64-bit kernel exception handlers to use same
  defines
   - */
   -#define BOOKE_INTERRUPT_SPE_UNAVAIL
  BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL
   -#define BOOKE_INTERRUPT_SPE_FP_DATA
  BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST
   -#define BOOKE_INTERRUPT_ALTIVEC_UNAVAIL
  BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL
   -#define BOOKE_INTERRUPT_ALTIVEC_ASSIST \
   - BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST
  
  I think I'd prefer to keep them separate.
 
 What is the reason from changing your mind from ver 1? Do you want to have
 different defines with same values (we specifically mapped them to the
 hardware interrupt numbers). We already upstreamed the necessary changes
 in the kernel. Scott, please share your opinion here.

I don't like hiding the fact that they're the same number, which could
lead to wrong code in the absence of ifdefs that strictly mutually
exclude SPE and Altivec code -- there was an instance of this with
MSR_VEC versus MSR_SPE in a previous patchset.
 
 #define BOOKE_INTERRUPT_SPE_FP_ROUND 34
 #define BOOKE_INTERRUPT_PERFORMANCE_MONITOR 35
 #define BOOKE_INTERRUPT_DOORBELL 36
   diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
   index ab62109..3c86d9b 100644
   --- a/arch/powerpc/kvm/booke.c
   +++ b/arch/powerpc/kvm/booke.c
   @@ -388,8 +388,8 @@ static int kvmppc_booke_irqprio_deliver(struct
  kvm_vcpu *vcpu,
 case BOOKE_IRQPRIO_ITLB_MISS:
 case BOOKE_IRQPRIO_SYSCALL:
 case BOOKE_IRQPRIO_FP_UNAVAIL:
   - case BOOKE_IRQPRIO_SPE_UNAVAIL:
   - case BOOKE_IRQPRIO_SPE_FP_DATA:
   + case BOOKE_IRQPRIO_SPE_ALTIVEC_UNAVAIL:
   + case BOOKE_IRQPRIO_SPE_FP_DATA_ALTIVEC_ASSIST:
  
  #ifdef CONFIG_KVM_E500V2
 case ...SPE:
  #else
 case ..ALTIVEC:
  #endif

I don't think that's an improvement.

-Scott


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


Re: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for SPE/FP/AltiVec int numbers

2014-07-03 Thread Alexander Graf


On 04.07.14 00:15, Scott Wood wrote:

On Thu, 2014-07-03 at 10:25 -0500, Caraman Mihai Claudiu-B02008 wrote:

-Original Message-
From: Alexander Graf [mailto:ag...@suse.de]
Sent: Thursday, July 03, 2014 3:21 PM
To: Caraman Mihai Claudiu-B02008; kvm-...@vger.kernel.org
Cc: kvm@vger.kernel.org; linuxppc-...@lists.ozlabs.org
Subject: Re: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for
SPE/FP/AltiVec int numbers


On 30.06.14 17:34, Mihai Caraman wrote:

Use common BOOKE_IRQPRIO and BOOKE_INTERRUPT defines for SPE/FP/AltiVec
which share the same interrupt numbers.

Signed-off-by: Mihai Caraman mihai.cara...@freescale.com
---
v2:
   - remove outdated definitions

   arch/powerpc/include/asm/kvm_asm.h|  8 
   arch/powerpc/kvm/booke.c  | 17 +
   arch/powerpc/kvm/booke.h  |  4 ++--
   arch/powerpc/kvm/booke_interrupts.S   |  9 +
   arch/powerpc/kvm/bookehv_interrupts.S |  4 ++--
   arch/powerpc/kvm/e500.c   | 10 ++
   arch/powerpc/kvm/e500_emulate.c   | 10 ++
   7 files changed, 30 insertions(+), 32 deletions(-)

diff --git a/arch/powerpc/include/asm/kvm_asm.h

b/arch/powerpc/include/asm/kvm_asm.h

index 9601741..c94fd33 100644
--- a/arch/powerpc/include/asm/kvm_asm.h
+++ b/arch/powerpc/include/asm/kvm_asm.h
@@ -56,14 +56,6 @@
   /* E500 */
   #define BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL 32
   #define BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST 33
-/*
- * TODO: Unify 32-bit and 64-bit kernel exception handlers to use same

defines

- */
-#define BOOKE_INTERRUPT_SPE_UNAVAIL

BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL

-#define BOOKE_INTERRUPT_SPE_FP_DATA

BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST

-#define BOOKE_INTERRUPT_ALTIVEC_UNAVAIL

BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL

-#define BOOKE_INTERRUPT_ALTIVEC_ASSIST \
-   BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST

I think I'd prefer to keep them separate.

What is the reason from changing your mind from ver 1? Do you want to have
different defines with same values (we specifically mapped them to the
hardware interrupt numbers). We already upstreamed the necessary changes
in the kernel. Scott, please share your opinion here.

I don't like hiding the fact that they're the same number, which could
lead to wrong code in the absence of ifdefs that strictly mutually
exclude SPE and Altivec code -- there was an instance of this with
MSR_VEC versus MSR_SPE in a previous patchset.


The nice thing here is that we use almost all of these numbers in 
switch() statements which give us automated duplicate checking - so we 
don't accidentally go into the wrong code path without knowing it.



Alex

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


Re: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for SPE/FP/AltiVec int numbers

2014-07-03 Thread Scott Wood
On Thu, 2014-07-03 at 17:15 -0500, Scott Wood wrote:
 On Thu, 2014-07-03 at 10:25 -0500, Caraman Mihai Claudiu-B02008 wrote:
   -Original Message-
   From: Alexander Graf [mailto:ag...@suse.de]
   Sent: Thursday, July 03, 2014 3:21 PM
   To: Caraman Mihai Claudiu-B02008; kvm-...@vger.kernel.org
   Cc: kvm@vger.kernel.org; linuxppc-...@lists.ozlabs.org
   Subject: Re: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for
   SPE/FP/AltiVec int numbers
   
   
   On 30.06.14 17:34, Mihai Caraman wrote:
Use common BOOKE_IRQPRIO and BOOKE_INTERRUPT defines for SPE/FP/AltiVec
which share the same interrupt numbers.
   
Signed-off-by: Mihai Caraman mihai.cara...@freescale.com
---
v2:
  - remove outdated definitions
   
  arch/powerpc/include/asm/kvm_asm.h|  8 
  arch/powerpc/kvm/booke.c  | 17 +
  arch/powerpc/kvm/booke.h  |  4 ++--
  arch/powerpc/kvm/booke_interrupts.S   |  9 +
  arch/powerpc/kvm/bookehv_interrupts.S |  4 ++--
  arch/powerpc/kvm/e500.c   | 10 ++
  arch/powerpc/kvm/e500_emulate.c   | 10 ++
  7 files changed, 30 insertions(+), 32 deletions(-)
   
diff --git a/arch/powerpc/include/asm/kvm_asm.h
   b/arch/powerpc/include/asm/kvm_asm.h
index 9601741..c94fd33 100644
--- a/arch/powerpc/include/asm/kvm_asm.h
+++ b/arch/powerpc/include/asm/kvm_asm.h
@@ -56,14 +56,6 @@
  /* E500 */
  #define BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL 32
  #define BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST 33
-/*
- * TODO: Unify 32-bit and 64-bit kernel exception handlers to use same
   defines
- */
-#define BOOKE_INTERRUPT_SPE_UNAVAIL
   BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL
-#define BOOKE_INTERRUPT_SPE_FP_DATA
   BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST
-#define BOOKE_INTERRUPT_ALTIVEC_UNAVAIL
   BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL
-#define BOOKE_INTERRUPT_ALTIVEC_ASSIST \
-   
BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST
   
   I think I'd prefer to keep them separate.
  
  What is the reason from changing your mind from ver 1? Do you want to have
  different defines with same values (we specifically mapped them to the
  hardware interrupt numbers). We already upstreamed the necessary changes
  in the kernel. Scott, please share your opinion here.
 
 I don't like hiding the fact that they're the same number, which could
 lead to wrong code in the absence of ifdefs that strictly mutually
 exclude SPE and Altivec code -- there was an instance of this with
 MSR_VEC versus MSR_SPE in a previous patchset. 

That said, if you want to enforce that mutual exclusion in a way that is
clear, I won't object too loudly -- but the code does look pretty
similar between the two (as well as between the two IVORs).

-Scott


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


Re: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for SPE/FP/AltiVec int numbers

2014-07-03 Thread Alexander Graf


On 04.07.14 00:31, Scott Wood wrote:

On Thu, 2014-07-03 at 17:15 -0500, Scott Wood wrote:

On Thu, 2014-07-03 at 10:25 -0500, Caraman Mihai Claudiu-B02008 wrote:

-Original Message-
From: Alexander Graf [mailto:ag...@suse.de]
Sent: Thursday, July 03, 2014 3:21 PM
To: Caraman Mihai Claudiu-B02008; kvm-...@vger.kernel.org
Cc: kvm@vger.kernel.org; linuxppc-...@lists.ozlabs.org
Subject: Re: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for
SPE/FP/AltiVec int numbers


On 30.06.14 17:34, Mihai Caraman wrote:

Use common BOOKE_IRQPRIO and BOOKE_INTERRUPT defines for SPE/FP/AltiVec
which share the same interrupt numbers.

Signed-off-by: Mihai Caraman mihai.cara...@freescale.com
---
v2:
   - remove outdated definitions

   arch/powerpc/include/asm/kvm_asm.h|  8 
   arch/powerpc/kvm/booke.c  | 17 +
   arch/powerpc/kvm/booke.h  |  4 ++--
   arch/powerpc/kvm/booke_interrupts.S   |  9 +
   arch/powerpc/kvm/bookehv_interrupts.S |  4 ++--
   arch/powerpc/kvm/e500.c   | 10 ++
   arch/powerpc/kvm/e500_emulate.c   | 10 ++
   7 files changed, 30 insertions(+), 32 deletions(-)

diff --git a/arch/powerpc/include/asm/kvm_asm.h

b/arch/powerpc/include/asm/kvm_asm.h

index 9601741..c94fd33 100644
--- a/arch/powerpc/include/asm/kvm_asm.h
+++ b/arch/powerpc/include/asm/kvm_asm.h
@@ -56,14 +56,6 @@
   /* E500 */
   #define BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL 32
   #define BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST 33
-/*
- * TODO: Unify 32-bit and 64-bit kernel exception handlers to use same

defines

- */
-#define BOOKE_INTERRUPT_SPE_UNAVAIL

BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL

-#define BOOKE_INTERRUPT_SPE_FP_DATA

BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST

-#define BOOKE_INTERRUPT_ALTIVEC_UNAVAIL

BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL

-#define BOOKE_INTERRUPT_ALTIVEC_ASSIST \
-   BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST

I think I'd prefer to keep them separate.

What is the reason from changing your mind from ver 1? Do you want to have
different defines with same values (we specifically mapped them to the
hardware interrupt numbers). We already upstreamed the necessary changes
in the kernel. Scott, please share your opinion here.

I don't like hiding the fact that they're the same number, which could
lead to wrong code in the absence of ifdefs that strictly mutually
exclude SPE and Altivec code -- there was an instance of this with
MSR_VEC versus MSR_SPE in a previous patchset.

That said, if you want to enforce that mutual exclusion in a way that is
clear, I won't object too loudly -- but the code does look pretty
similar between the two (as well as between the two IVORs).


Yes, I want to make sure we have 2 separate code paths for SPE and 
Altivec. No code sharing at all unless it's very generically possible.


Also, which code does look pretty similar? The fact that we deflect 
interrupts back into the guest? That's mostly boilerplate.



Alex

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


Re: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for SPE/FP/AltiVec int numbers

2014-07-03 Thread Scott Wood
On Fri, 2014-07-04 at 00:35 +0200, Alexander Graf wrote:
 On 04.07.14 00:31, Scott Wood wrote:
  On Thu, 2014-07-03 at 17:15 -0500, Scott Wood wrote:
  On Thu, 2014-07-03 at 10:25 -0500, Caraman Mihai Claudiu-B02008 wrote:
  -Original Message-
  From: Alexander Graf [mailto:ag...@suse.de]
  Sent: Thursday, July 03, 2014 3:21 PM
  To: Caraman Mihai Claudiu-B02008; kvm-...@vger.kernel.org
  Cc: kvm@vger.kernel.org; linuxppc-...@lists.ozlabs.org
  Subject: Re: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for
  SPE/FP/AltiVec int numbers
 
 
  On 30.06.14 17:34, Mihai Caraman wrote:
  Use common BOOKE_IRQPRIO and BOOKE_INTERRUPT defines for SPE/FP/AltiVec
  which share the same interrupt numbers.
 
  Signed-off-by: Mihai Caraman mihai.cara...@freescale.com
  ---
  v2:
 - remove outdated definitions
 
 arch/powerpc/include/asm/kvm_asm.h|  8 
 arch/powerpc/kvm/booke.c  | 17 +
 arch/powerpc/kvm/booke.h  |  4 ++--
 arch/powerpc/kvm/booke_interrupts.S   |  9 +
 arch/powerpc/kvm/bookehv_interrupts.S |  4 ++--
 arch/powerpc/kvm/e500.c   | 10 ++
 arch/powerpc/kvm/e500_emulate.c   | 10 ++
 7 files changed, 30 insertions(+), 32 deletions(-)
 
  diff --git a/arch/powerpc/include/asm/kvm_asm.h
  b/arch/powerpc/include/asm/kvm_asm.h
  index 9601741..c94fd33 100644
  --- a/arch/powerpc/include/asm/kvm_asm.h
  +++ b/arch/powerpc/include/asm/kvm_asm.h
  @@ -56,14 +56,6 @@
 /* E500 */
 #define BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL 32
 #define BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST 33
  -/*
  - * TODO: Unify 32-bit and 64-bit kernel exception handlers to use same
  defines
  - */
  -#define BOOKE_INTERRUPT_SPE_UNAVAIL
  BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL
  -#define BOOKE_INTERRUPT_SPE_FP_DATA
  BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST
  -#define BOOKE_INTERRUPT_ALTIVEC_UNAVAIL
  BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL
  -#define BOOKE_INTERRUPT_ALTIVEC_ASSIST \
  -   
  BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST
  I think I'd prefer to keep them separate.
  What is the reason from changing your mind from ver 1? Do you want to have
  different defines with same values (we specifically mapped them to the
  hardware interrupt numbers). We already upstreamed the necessary changes
  in the kernel. Scott, please share your opinion here.
  I don't like hiding the fact that they're the same number, which could
  lead to wrong code in the absence of ifdefs that strictly mutually
  exclude SPE and Altivec code -- there was an instance of this with
  MSR_VEC versus MSR_SPE in a previous patchset.
  That said, if you want to enforce that mutual exclusion in a way that is
  clear, I won't object too loudly -- but the code does look pretty
  similar between the two (as well as between the two IVORs).
 
 Yes, I want to make sure we have 2 separate code paths for SPE and 
 Altivec. No code sharing at all unless it's very generically possible.
 
 Also, which code does look pretty similar? The fact that we deflect 
 interrupts back into the guest? That's mostly boilerplate.

There's also the injection of a program check (or exiting to userspace)
when CONFIG_SPE/ALTIVEC is missing.  Not a big deal, but maybe it could
be factored into a helper function.  I like minimizing boilerplate.

-Scott


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


Re: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for SPE/FP/AltiVec int numbers

2014-07-03 Thread Alexander Graf


On 04.07.14 01:00, Scott Wood wrote:

On Fri, 2014-07-04 at 00:35 +0200, Alexander Graf wrote:

On 04.07.14 00:31, Scott Wood wrote:

On Thu, 2014-07-03 at 17:15 -0500, Scott Wood wrote:

On Thu, 2014-07-03 at 10:25 -0500, Caraman Mihai Claudiu-B02008 wrote:

-Original Message-
From: Alexander Graf [mailto:ag...@suse.de]
Sent: Thursday, July 03, 2014 3:21 PM
To: Caraman Mihai Claudiu-B02008; kvm-...@vger.kernel.org
Cc: kvm@vger.kernel.org; linuxppc-...@lists.ozlabs.org
Subject: Re: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for
SPE/FP/AltiVec int numbers


On 30.06.14 17:34, Mihai Caraman wrote:

Use common BOOKE_IRQPRIO and BOOKE_INTERRUPT defines for SPE/FP/AltiVec
which share the same interrupt numbers.

Signed-off-by: Mihai Caraman mihai.cara...@freescale.com
---
v2:
- remove outdated definitions

arch/powerpc/include/asm/kvm_asm.h|  8 
arch/powerpc/kvm/booke.c  | 17 +
arch/powerpc/kvm/booke.h  |  4 ++--
arch/powerpc/kvm/booke_interrupts.S   |  9 +
arch/powerpc/kvm/bookehv_interrupts.S |  4 ++--
arch/powerpc/kvm/e500.c   | 10 ++
arch/powerpc/kvm/e500_emulate.c   | 10 ++
7 files changed, 30 insertions(+), 32 deletions(-)

diff --git a/arch/powerpc/include/asm/kvm_asm.h

b/arch/powerpc/include/asm/kvm_asm.h

index 9601741..c94fd33 100644
--- a/arch/powerpc/include/asm/kvm_asm.h
+++ b/arch/powerpc/include/asm/kvm_asm.h
@@ -56,14 +56,6 @@
/* E500 */
#define BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL 32
#define BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST 33
-/*
- * TODO: Unify 32-bit and 64-bit kernel exception handlers to use same

defines

- */
-#define BOOKE_INTERRUPT_SPE_UNAVAIL

BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL

-#define BOOKE_INTERRUPT_SPE_FP_DATA

BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST

-#define BOOKE_INTERRUPT_ALTIVEC_UNAVAIL

BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL

-#define BOOKE_INTERRUPT_ALTIVEC_ASSIST \
-   BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST

I think I'd prefer to keep them separate.

What is the reason from changing your mind from ver 1? Do you want to have
different defines with same values (we specifically mapped them to the
hardware interrupt numbers). We already upstreamed the necessary changes
in the kernel. Scott, please share your opinion here.

I don't like hiding the fact that they're the same number, which could
lead to wrong code in the absence of ifdefs that strictly mutually
exclude SPE and Altivec code -- there was an instance of this with
MSR_VEC versus MSR_SPE in a previous patchset.

That said, if you want to enforce that mutual exclusion in a way that is
clear, I won't object too loudly -- but the code does look pretty
similar between the two (as well as between the two IVORs).

Yes, I want to make sure we have 2 separate code paths for SPE and
Altivec. No code sharing at all unless it's very generically possible.

Also, which code does look pretty similar? The fact that we deflect
interrupts back into the guest? That's mostly boilerplate.

There's also the injection of a program check (or exiting to userspace)
when CONFIG_SPE/ALTIVEC is missing.  Not a big deal, but maybe it could
be factored into a helper function.  I like minimizing boilerplate.


Yes, me too - but I also like to be explicit. If there's enough code to 
share, factoring those into helpers certainly works well for me.



Alex

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


RE: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for SPE/FP/AltiVec int numbers

2014-07-03 Thread mihai.cara...@freescale.com
 -Original Message-
 From: Alexander Graf [mailto:ag...@suse.de]
 Sent: Thursday, July 03, 2014 3:21 PM
 To: Caraman Mihai Claudiu-B02008; kvm-ppc@vger.kernel.org
 Cc: k...@vger.kernel.org; linuxppc-...@lists.ozlabs.org
 Subject: Re: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for
 SPE/FP/AltiVec int numbers
 
 
 On 30.06.14 17:34, Mihai Caraman wrote:
  Use common BOOKE_IRQPRIO and BOOKE_INTERRUPT defines for SPE/FP/AltiVec
  which share the same interrupt numbers.
 
  Signed-off-by: Mihai Caraman mihai.cara...@freescale.com
  ---
  v2:
- remove outdated definitions
 
arch/powerpc/include/asm/kvm_asm.h|  8 
arch/powerpc/kvm/booke.c  | 17 +
arch/powerpc/kvm/booke.h  |  4 ++--
arch/powerpc/kvm/booke_interrupts.S   |  9 +
arch/powerpc/kvm/bookehv_interrupts.S |  4 ++--
arch/powerpc/kvm/e500.c   | 10 ++
arch/powerpc/kvm/e500_emulate.c   | 10 ++
7 files changed, 30 insertions(+), 32 deletions(-)
 
  diff --git a/arch/powerpc/include/asm/kvm_asm.h
 b/arch/powerpc/include/asm/kvm_asm.h
  index 9601741..c94fd33 100644
  --- a/arch/powerpc/include/asm/kvm_asm.h
  +++ b/arch/powerpc/include/asm/kvm_asm.h
  @@ -56,14 +56,6 @@
/* E500 */
#define BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL 32
#define BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST 33
  -/*
  - * TODO: Unify 32-bit and 64-bit kernel exception handlers to use same
 defines
  - */
  -#define BOOKE_INTERRUPT_SPE_UNAVAIL
 BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL
  -#define BOOKE_INTERRUPT_SPE_FP_DATA
 BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST
  -#define BOOKE_INTERRUPT_ALTIVEC_UNAVAIL
 BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL
  -#define BOOKE_INTERRUPT_ALTIVEC_ASSIST \
  -   BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST
 
 I think I'd prefer to keep them separate.

What is the reason from changing your mind from ver 1? Do you want to have
different defines with same values (we specifically mapped them to the
hardware interrupt numbers). We already upstreamed the necessary changes
in the kernel. Scott, please share your opinion here.

 
#define BOOKE_INTERRUPT_SPE_FP_ROUND 34
#define BOOKE_INTERRUPT_PERFORMANCE_MONITOR 35
#define BOOKE_INTERRUPT_DOORBELL 36
  diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
  index ab62109..3c86d9b 100644
  --- a/arch/powerpc/kvm/booke.c
  +++ b/arch/powerpc/kvm/booke.c
  @@ -388,8 +388,8 @@ static int kvmppc_booke_irqprio_deliver(struct
 kvm_vcpu *vcpu,
  case BOOKE_IRQPRIO_ITLB_MISS:
  case BOOKE_IRQPRIO_SYSCALL:
  case BOOKE_IRQPRIO_FP_UNAVAIL:
  -   case BOOKE_IRQPRIO_SPE_UNAVAIL:
  -   case BOOKE_IRQPRIO_SPE_FP_DATA:
  +   case BOOKE_IRQPRIO_SPE_ALTIVEC_UNAVAIL:
  +   case BOOKE_IRQPRIO_SPE_FP_DATA_ALTIVEC_ASSIST:
 
 #ifdef CONFIG_KVM_E500V2
case ...SPE:
 #else
case ..ALTIVEC:
 #endif

-Mike
--
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 1/6 v2] KVM: PPC: Book3E: Use common defines for SPE/FP/AltiVec int numbers

2014-07-03 Thread Alexander Graf


On 03.07.14 17:25, mihai.cara...@freescale.com wrote:

-Original Message-
From: Alexander Graf [mailto:ag...@suse.de]
Sent: Thursday, July 03, 2014 3:21 PM
To: Caraman Mihai Claudiu-B02008; kvm-ppc@vger.kernel.org
Cc: k...@vger.kernel.org; linuxppc-...@lists.ozlabs.org
Subject: Re: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for
SPE/FP/AltiVec int numbers


On 30.06.14 17:34, Mihai Caraman wrote:

Use common BOOKE_IRQPRIO and BOOKE_INTERRUPT defines for SPE/FP/AltiVec
which share the same interrupt numbers.

Signed-off-by: Mihai Caraman mihai.cara...@freescale.com
---
v2:
   - remove outdated definitions

   arch/powerpc/include/asm/kvm_asm.h|  8 
   arch/powerpc/kvm/booke.c  | 17 +
   arch/powerpc/kvm/booke.h  |  4 ++--
   arch/powerpc/kvm/booke_interrupts.S   |  9 +
   arch/powerpc/kvm/bookehv_interrupts.S |  4 ++--
   arch/powerpc/kvm/e500.c   | 10 ++
   arch/powerpc/kvm/e500_emulate.c   | 10 ++
   7 files changed, 30 insertions(+), 32 deletions(-)

diff --git a/arch/powerpc/include/asm/kvm_asm.h

b/arch/powerpc/include/asm/kvm_asm.h

index 9601741..c94fd33 100644
--- a/arch/powerpc/include/asm/kvm_asm.h
+++ b/arch/powerpc/include/asm/kvm_asm.h
@@ -56,14 +56,6 @@
   /* E500 */
   #define BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL 32
   #define BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST 33
-/*
- * TODO: Unify 32-bit and 64-bit kernel exception handlers to use same

defines

- */
-#define BOOKE_INTERRUPT_SPE_UNAVAIL

BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL

-#define BOOKE_INTERRUPT_SPE_FP_DATA

BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST

-#define BOOKE_INTERRUPT_ALTIVEC_UNAVAIL

BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL

-#define BOOKE_INTERRUPT_ALTIVEC_ASSIST \
-   BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST

I think I'd prefer to keep them separate.

What is the reason from changing your mind from ver 1? Do you want to have


Uh, mind to point me to an email where I said I like the approach? :)


different defines with same values (we specifically mapped them to the
hardware interrupt numbers). We already upstreamed the necessary changes


Yes, I think that'd end up the most readable flow of things.


in the kernel. Scott, please share your opinion here.


I'm not going to be religious about it, but names like 
BOOKE_IRQPRIO_SPE_FP_DATA_ALTIVEC_ASSIST are


  1) too long
  2) too ambiguous

It just means the code gets harder to read. Any way we can take to 
simplify the code flow is a win IMHO. And if I don't even remotely have 
to consider SPE when reading an Altivec path, I think that's a good 
thing :).



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: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for SPE/FP/AltiVec int numbers

2014-07-03 Thread mihai.cara...@freescale.com
 -Original Message-
 From: Alexander Graf [mailto:ag...@suse.de]
 Sent: Thursday, July 03, 2014 6:31 PM
 To: Caraman Mihai Claudiu-B02008; Wood Scott-B07421; kvm-
 p...@vger.kernel.org
 Cc: k...@vger.kernel.org; linuxppc-...@lists.ozlabs.org
 Subject: Re: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for
 SPE/FP/AltiVec int numbers
 
 
 On 03.07.14 17:25, mihai.cara...@freescale.com wrote:
  -Original Message-
  From: Alexander Graf [mailto:ag...@suse.de]
  Sent: Thursday, July 03, 2014 3:21 PM
  To: Caraman Mihai Claudiu-B02008; kvm-ppc@vger.kernel.org
  Cc: k...@vger.kernel.org; linuxppc-...@lists.ozlabs.org
  Subject: Re: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for
  SPE/FP/AltiVec int numbers
 
 
  On 30.06.14 17:34, Mihai Caraman wrote:
  Use common BOOKE_IRQPRIO and BOOKE_INTERRUPT defines for
 SPE/FP/AltiVec
  which share the same interrupt numbers.
 
  Signed-off-by: Mihai Caraman mihai.cara...@freescale.com
  ---
  v2:
 - remove outdated definitions
 
 arch/powerpc/include/asm/kvm_asm.h|  8 
 arch/powerpc/kvm/booke.c  | 17 +
 arch/powerpc/kvm/booke.h  |  4 ++--
 arch/powerpc/kvm/booke_interrupts.S   |  9 +
 arch/powerpc/kvm/bookehv_interrupts.S |  4 ++--
 arch/powerpc/kvm/e500.c   | 10 ++
 arch/powerpc/kvm/e500_emulate.c   | 10 ++
 7 files changed, 30 insertions(+), 32 deletions(-)
 
  diff --git a/arch/powerpc/include/asm/kvm_asm.h
  b/arch/powerpc/include/asm/kvm_asm.h
  index 9601741..c94fd33 100644
  --- a/arch/powerpc/include/asm/kvm_asm.h
  +++ b/arch/powerpc/include/asm/kvm_asm.h
  @@ -56,14 +56,6 @@
 /* E500 */
 #define BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL 32
 #define BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST 33
  -/*
  - * TODO: Unify 32-bit and 64-bit kernel exception handlers to use
 same
  defines
  - */
  -#define BOOKE_INTERRUPT_SPE_UNAVAIL
  BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL
  -#define BOOKE_INTERRUPT_SPE_FP_DATA
  BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST
  -#define BOOKE_INTERRUPT_ALTIVEC_UNAVAIL
  BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL
  -#define BOOKE_INTERRUPT_ALTIVEC_ASSIST \
  - BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST
  I think I'd prefer to keep them separate.
  What is the reason from changing your mind from ver 1? Do you want to
 have
 
 Uh, mind to point me to an email where I said I like the approach? :)

You tacitly approved it in this thread ... I did not say you like it :)

https://lists.ozlabs.org/pipermail/linuxppc-dev/2013-July/108501.html

-Mike
--
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 1/6 v2] KVM: PPC: Book3E: Use common defines for SPE/FP/AltiVec int numbers

2014-07-03 Thread Scott Wood
On Thu, 2014-07-03 at 10:25 -0500, Caraman Mihai Claudiu-B02008 wrote:
  -Original Message-
  From: Alexander Graf [mailto:ag...@suse.de]
  Sent: Thursday, July 03, 2014 3:21 PM
  To: Caraman Mihai Claudiu-B02008; kvm-ppc@vger.kernel.org
  Cc: k...@vger.kernel.org; linuxppc-...@lists.ozlabs.org
  Subject: Re: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for
  SPE/FP/AltiVec int numbers
  
  
  On 30.06.14 17:34, Mihai Caraman wrote:
   Use common BOOKE_IRQPRIO and BOOKE_INTERRUPT defines for SPE/FP/AltiVec
   which share the same interrupt numbers.
  
   Signed-off-by: Mihai Caraman mihai.cara...@freescale.com
   ---
   v2:
 - remove outdated definitions
  
 arch/powerpc/include/asm/kvm_asm.h|  8 
 arch/powerpc/kvm/booke.c  | 17 +
 arch/powerpc/kvm/booke.h  |  4 ++--
 arch/powerpc/kvm/booke_interrupts.S   |  9 +
 arch/powerpc/kvm/bookehv_interrupts.S |  4 ++--
 arch/powerpc/kvm/e500.c   | 10 ++
 arch/powerpc/kvm/e500_emulate.c   | 10 ++
 7 files changed, 30 insertions(+), 32 deletions(-)
  
   diff --git a/arch/powerpc/include/asm/kvm_asm.h
  b/arch/powerpc/include/asm/kvm_asm.h
   index 9601741..c94fd33 100644
   --- a/arch/powerpc/include/asm/kvm_asm.h
   +++ b/arch/powerpc/include/asm/kvm_asm.h
   @@ -56,14 +56,6 @@
 /* E500 */
 #define BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL 32
 #define BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST 33
   -/*
   - * TODO: Unify 32-bit and 64-bit kernel exception handlers to use same
  defines
   - */
   -#define BOOKE_INTERRUPT_SPE_UNAVAIL
  BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL
   -#define BOOKE_INTERRUPT_SPE_FP_DATA
  BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST
   -#define BOOKE_INTERRUPT_ALTIVEC_UNAVAIL
  BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL
   -#define BOOKE_INTERRUPT_ALTIVEC_ASSIST \
   - BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST
  
  I think I'd prefer to keep them separate.
 
 What is the reason from changing your mind from ver 1? Do you want to have
 different defines with same values (we specifically mapped them to the
 hardware interrupt numbers). We already upstreamed the necessary changes
 in the kernel. Scott, please share your opinion here.

I don't like hiding the fact that they're the same number, which could
lead to wrong code in the absence of ifdefs that strictly mutually
exclude SPE and Altivec code -- there was an instance of this with
MSR_VEC versus MSR_SPE in a previous patchset.
 
 #define BOOKE_INTERRUPT_SPE_FP_ROUND 34
 #define BOOKE_INTERRUPT_PERFORMANCE_MONITOR 35
 #define BOOKE_INTERRUPT_DOORBELL 36
   diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
   index ab62109..3c86d9b 100644
   --- a/arch/powerpc/kvm/booke.c
   +++ b/arch/powerpc/kvm/booke.c
   @@ -388,8 +388,8 @@ static int kvmppc_booke_irqprio_deliver(struct
  kvm_vcpu *vcpu,
 case BOOKE_IRQPRIO_ITLB_MISS:
 case BOOKE_IRQPRIO_SYSCALL:
 case BOOKE_IRQPRIO_FP_UNAVAIL:
   - case BOOKE_IRQPRIO_SPE_UNAVAIL:
   - case BOOKE_IRQPRIO_SPE_FP_DATA:
   + case BOOKE_IRQPRIO_SPE_ALTIVEC_UNAVAIL:
   + case BOOKE_IRQPRIO_SPE_FP_DATA_ALTIVEC_ASSIST:
  
  #ifdef CONFIG_KVM_E500V2
 case ...SPE:
  #else
 case ..ALTIVEC:
  #endif

I don't think that's an improvement.

-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: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for SPE/FP/AltiVec int numbers

2014-07-03 Thread Alexander Graf


On 04.07.14 00:15, Scott Wood wrote:

On Thu, 2014-07-03 at 10:25 -0500, Caraman Mihai Claudiu-B02008 wrote:

-Original Message-
From: Alexander Graf [mailto:ag...@suse.de]
Sent: Thursday, July 03, 2014 3:21 PM
To: Caraman Mihai Claudiu-B02008; kvm-ppc@vger.kernel.org
Cc: k...@vger.kernel.org; linuxppc-...@lists.ozlabs.org
Subject: Re: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for
SPE/FP/AltiVec int numbers


On 30.06.14 17:34, Mihai Caraman wrote:

Use common BOOKE_IRQPRIO and BOOKE_INTERRUPT defines for SPE/FP/AltiVec
which share the same interrupt numbers.

Signed-off-by: Mihai Caraman mihai.cara...@freescale.com
---
v2:
   - remove outdated definitions

   arch/powerpc/include/asm/kvm_asm.h|  8 
   arch/powerpc/kvm/booke.c  | 17 +
   arch/powerpc/kvm/booke.h  |  4 ++--
   arch/powerpc/kvm/booke_interrupts.S   |  9 +
   arch/powerpc/kvm/bookehv_interrupts.S |  4 ++--
   arch/powerpc/kvm/e500.c   | 10 ++
   arch/powerpc/kvm/e500_emulate.c   | 10 ++
   7 files changed, 30 insertions(+), 32 deletions(-)

diff --git a/arch/powerpc/include/asm/kvm_asm.h

b/arch/powerpc/include/asm/kvm_asm.h

index 9601741..c94fd33 100644
--- a/arch/powerpc/include/asm/kvm_asm.h
+++ b/arch/powerpc/include/asm/kvm_asm.h
@@ -56,14 +56,6 @@
   /* E500 */
   #define BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL 32
   #define BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST 33
-/*
- * TODO: Unify 32-bit and 64-bit kernel exception handlers to use same

defines

- */
-#define BOOKE_INTERRUPT_SPE_UNAVAIL

BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL

-#define BOOKE_INTERRUPT_SPE_FP_DATA

BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST

-#define BOOKE_INTERRUPT_ALTIVEC_UNAVAIL

BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL

-#define BOOKE_INTERRUPT_ALTIVEC_ASSIST \
-   BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST

I think I'd prefer to keep them separate.

What is the reason from changing your mind from ver 1? Do you want to have
different defines with same values (we specifically mapped them to the
hardware interrupt numbers). We already upstreamed the necessary changes
in the kernel. Scott, please share your opinion here.

I don't like hiding the fact that they're the same number, which could
lead to wrong code in the absence of ifdefs that strictly mutually
exclude SPE and Altivec code -- there was an instance of this with
MSR_VEC versus MSR_SPE in a previous patchset.


The nice thing here is that we use almost all of these numbers in 
switch() statements which give us automated duplicate checking - so we 
don't accidentally go into the wrong code path without knowing it.



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: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for SPE/FP/AltiVec int numbers

2014-07-03 Thread Scott Wood
On Thu, 2014-07-03 at 17:15 -0500, Scott Wood wrote:
 On Thu, 2014-07-03 at 10:25 -0500, Caraman Mihai Claudiu-B02008 wrote:
   -Original Message-
   From: Alexander Graf [mailto:ag...@suse.de]
   Sent: Thursday, July 03, 2014 3:21 PM
   To: Caraman Mihai Claudiu-B02008; kvm-ppc@vger.kernel.org
   Cc: k...@vger.kernel.org; linuxppc-...@lists.ozlabs.org
   Subject: Re: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for
   SPE/FP/AltiVec int numbers
   
   
   On 30.06.14 17:34, Mihai Caraman wrote:
Use common BOOKE_IRQPRIO and BOOKE_INTERRUPT defines for SPE/FP/AltiVec
which share the same interrupt numbers.
   
Signed-off-by: Mihai Caraman mihai.cara...@freescale.com
---
v2:
  - remove outdated definitions
   
  arch/powerpc/include/asm/kvm_asm.h|  8 
  arch/powerpc/kvm/booke.c  | 17 +
  arch/powerpc/kvm/booke.h  |  4 ++--
  arch/powerpc/kvm/booke_interrupts.S   |  9 +
  arch/powerpc/kvm/bookehv_interrupts.S |  4 ++--
  arch/powerpc/kvm/e500.c   | 10 ++
  arch/powerpc/kvm/e500_emulate.c   | 10 ++
  7 files changed, 30 insertions(+), 32 deletions(-)
   
diff --git a/arch/powerpc/include/asm/kvm_asm.h
   b/arch/powerpc/include/asm/kvm_asm.h
index 9601741..c94fd33 100644
--- a/arch/powerpc/include/asm/kvm_asm.h
+++ b/arch/powerpc/include/asm/kvm_asm.h
@@ -56,14 +56,6 @@
  /* E500 */
  #define BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL 32
  #define BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST 33
-/*
- * TODO: Unify 32-bit and 64-bit kernel exception handlers to use same
   defines
- */
-#define BOOKE_INTERRUPT_SPE_UNAVAIL
   BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL
-#define BOOKE_INTERRUPT_SPE_FP_DATA
   BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST
-#define BOOKE_INTERRUPT_ALTIVEC_UNAVAIL
   BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL
-#define BOOKE_INTERRUPT_ALTIVEC_ASSIST \
-   
BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST
   
   I think I'd prefer to keep them separate.
  
  What is the reason from changing your mind from ver 1? Do you want to have
  different defines with same values (we specifically mapped them to the
  hardware interrupt numbers). We already upstreamed the necessary changes
  in the kernel. Scott, please share your opinion here.
 
 I don't like hiding the fact that they're the same number, which could
 lead to wrong code in the absence of ifdefs that strictly mutually
 exclude SPE and Altivec code -- there was an instance of this with
 MSR_VEC versus MSR_SPE in a previous patchset. 

That said, if you want to enforce that mutual exclusion in a way that is
clear, I won't object too loudly -- but the code does look pretty
similar between the two (as well as between the two IVORs).

-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: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for SPE/FP/AltiVec int numbers

2014-07-03 Thread Alexander Graf


On 04.07.14 00:31, Scott Wood wrote:

On Thu, 2014-07-03 at 17:15 -0500, Scott Wood wrote:

On Thu, 2014-07-03 at 10:25 -0500, Caraman Mihai Claudiu-B02008 wrote:

-Original Message-
From: Alexander Graf [mailto:ag...@suse.de]
Sent: Thursday, July 03, 2014 3:21 PM
To: Caraman Mihai Claudiu-B02008; kvm-ppc@vger.kernel.org
Cc: k...@vger.kernel.org; linuxppc-...@lists.ozlabs.org
Subject: Re: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for
SPE/FP/AltiVec int numbers


On 30.06.14 17:34, Mihai Caraman wrote:

Use common BOOKE_IRQPRIO and BOOKE_INTERRUPT defines for SPE/FP/AltiVec
which share the same interrupt numbers.

Signed-off-by: Mihai Caraman mihai.cara...@freescale.com
---
v2:
   - remove outdated definitions

   arch/powerpc/include/asm/kvm_asm.h|  8 
   arch/powerpc/kvm/booke.c  | 17 +
   arch/powerpc/kvm/booke.h  |  4 ++--
   arch/powerpc/kvm/booke_interrupts.S   |  9 +
   arch/powerpc/kvm/bookehv_interrupts.S |  4 ++--
   arch/powerpc/kvm/e500.c   | 10 ++
   arch/powerpc/kvm/e500_emulate.c   | 10 ++
   7 files changed, 30 insertions(+), 32 deletions(-)

diff --git a/arch/powerpc/include/asm/kvm_asm.h

b/arch/powerpc/include/asm/kvm_asm.h

index 9601741..c94fd33 100644
--- a/arch/powerpc/include/asm/kvm_asm.h
+++ b/arch/powerpc/include/asm/kvm_asm.h
@@ -56,14 +56,6 @@
   /* E500 */
   #define BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL 32
   #define BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST 33
-/*
- * TODO: Unify 32-bit and 64-bit kernel exception handlers to use same

defines

- */
-#define BOOKE_INTERRUPT_SPE_UNAVAIL

BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL

-#define BOOKE_INTERRUPT_SPE_FP_DATA

BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST

-#define BOOKE_INTERRUPT_ALTIVEC_UNAVAIL

BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL

-#define BOOKE_INTERRUPT_ALTIVEC_ASSIST \
-   BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST

I think I'd prefer to keep them separate.

What is the reason from changing your mind from ver 1? Do you want to have
different defines with same values (we specifically mapped them to the
hardware interrupt numbers). We already upstreamed the necessary changes
in the kernel. Scott, please share your opinion here.

I don't like hiding the fact that they're the same number, which could
lead to wrong code in the absence of ifdefs that strictly mutually
exclude SPE and Altivec code -- there was an instance of this with
MSR_VEC versus MSR_SPE in a previous patchset.

That said, if you want to enforce that mutual exclusion in a way that is
clear, I won't object too loudly -- but the code does look pretty
similar between the two (as well as between the two IVORs).


Yes, I want to make sure we have 2 separate code paths for SPE and 
Altivec. No code sharing at all unless it's very generically possible.


Also, which code does look pretty similar? The fact that we deflect 
interrupts back into the guest? That's mostly boilerplate.



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: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for SPE/FP/AltiVec int numbers

2014-07-03 Thread Scott Wood
On Fri, 2014-07-04 at 00:35 +0200, Alexander Graf wrote:
 On 04.07.14 00:31, Scott Wood wrote:
  On Thu, 2014-07-03 at 17:15 -0500, Scott Wood wrote:
  On Thu, 2014-07-03 at 10:25 -0500, Caraman Mihai Claudiu-B02008 wrote:
  -Original Message-
  From: Alexander Graf [mailto:ag...@suse.de]
  Sent: Thursday, July 03, 2014 3:21 PM
  To: Caraman Mihai Claudiu-B02008; kvm-ppc@vger.kernel.org
  Cc: k...@vger.kernel.org; linuxppc-...@lists.ozlabs.org
  Subject: Re: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for
  SPE/FP/AltiVec int numbers
 
 
  On 30.06.14 17:34, Mihai Caraman wrote:
  Use common BOOKE_IRQPRIO and BOOKE_INTERRUPT defines for SPE/FP/AltiVec
  which share the same interrupt numbers.
 
  Signed-off-by: Mihai Caraman mihai.cara...@freescale.com
  ---
  v2:
 - remove outdated definitions
 
 arch/powerpc/include/asm/kvm_asm.h|  8 
 arch/powerpc/kvm/booke.c  | 17 +
 arch/powerpc/kvm/booke.h  |  4 ++--
 arch/powerpc/kvm/booke_interrupts.S   |  9 +
 arch/powerpc/kvm/bookehv_interrupts.S |  4 ++--
 arch/powerpc/kvm/e500.c   | 10 ++
 arch/powerpc/kvm/e500_emulate.c   | 10 ++
 7 files changed, 30 insertions(+), 32 deletions(-)
 
  diff --git a/arch/powerpc/include/asm/kvm_asm.h
  b/arch/powerpc/include/asm/kvm_asm.h
  index 9601741..c94fd33 100644
  --- a/arch/powerpc/include/asm/kvm_asm.h
  +++ b/arch/powerpc/include/asm/kvm_asm.h
  @@ -56,14 +56,6 @@
 /* E500 */
 #define BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL 32
 #define BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST 33
  -/*
  - * TODO: Unify 32-bit and 64-bit kernel exception handlers to use same
  defines
  - */
  -#define BOOKE_INTERRUPT_SPE_UNAVAIL
  BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL
  -#define BOOKE_INTERRUPT_SPE_FP_DATA
  BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST
  -#define BOOKE_INTERRUPT_ALTIVEC_UNAVAIL
  BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL
  -#define BOOKE_INTERRUPT_ALTIVEC_ASSIST \
  -   
  BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST
  I think I'd prefer to keep them separate.
  What is the reason from changing your mind from ver 1? Do you want to have
  different defines with same values (we specifically mapped them to the
  hardware interrupt numbers). We already upstreamed the necessary changes
  in the kernel. Scott, please share your opinion here.
  I don't like hiding the fact that they're the same number, which could
  lead to wrong code in the absence of ifdefs that strictly mutually
  exclude SPE and Altivec code -- there was an instance of this with
  MSR_VEC versus MSR_SPE in a previous patchset.
  That said, if you want to enforce that mutual exclusion in a way that is
  clear, I won't object too loudly -- but the code does look pretty
  similar between the two (as well as between the two IVORs).
 
 Yes, I want to make sure we have 2 separate code paths for SPE and 
 Altivec. No code sharing at all unless it's very generically possible.
 
 Also, which code does look pretty similar? The fact that we deflect 
 interrupts back into the guest? That's mostly boilerplate.

There's also the injection of a program check (or exiting to userspace)
when CONFIG_SPE/ALTIVEC is missing.  Not a big deal, but maybe it could
be factored into a helper function.  I like minimizing boilerplate.

-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: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for SPE/FP/AltiVec int numbers

2014-07-03 Thread Alexander Graf


On 04.07.14 01:00, Scott Wood wrote:

On Fri, 2014-07-04 at 00:35 +0200, Alexander Graf wrote:

On 04.07.14 00:31, Scott Wood wrote:

On Thu, 2014-07-03 at 17:15 -0500, Scott Wood wrote:

On Thu, 2014-07-03 at 10:25 -0500, Caraman Mihai Claudiu-B02008 wrote:

-Original Message-
From: Alexander Graf [mailto:ag...@suse.de]
Sent: Thursday, July 03, 2014 3:21 PM
To: Caraman Mihai Claudiu-B02008; kvm-ppc@vger.kernel.org
Cc: k...@vger.kernel.org; linuxppc-...@lists.ozlabs.org
Subject: Re: [PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for
SPE/FP/AltiVec int numbers


On 30.06.14 17:34, Mihai Caraman wrote:

Use common BOOKE_IRQPRIO and BOOKE_INTERRUPT defines for SPE/FP/AltiVec
which share the same interrupt numbers.

Signed-off-by: Mihai Caraman mihai.cara...@freescale.com
---
v2:
- remove outdated definitions

arch/powerpc/include/asm/kvm_asm.h|  8 
arch/powerpc/kvm/booke.c  | 17 +
arch/powerpc/kvm/booke.h  |  4 ++--
arch/powerpc/kvm/booke_interrupts.S   |  9 +
arch/powerpc/kvm/bookehv_interrupts.S |  4 ++--
arch/powerpc/kvm/e500.c   | 10 ++
arch/powerpc/kvm/e500_emulate.c   | 10 ++
7 files changed, 30 insertions(+), 32 deletions(-)

diff --git a/arch/powerpc/include/asm/kvm_asm.h

b/arch/powerpc/include/asm/kvm_asm.h

index 9601741..c94fd33 100644
--- a/arch/powerpc/include/asm/kvm_asm.h
+++ b/arch/powerpc/include/asm/kvm_asm.h
@@ -56,14 +56,6 @@
/* E500 */
#define BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL 32
#define BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST 33
-/*
- * TODO: Unify 32-bit and 64-bit kernel exception handlers to use same

defines

- */
-#define BOOKE_INTERRUPT_SPE_UNAVAIL

BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL

-#define BOOKE_INTERRUPT_SPE_FP_DATA

BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST

-#define BOOKE_INTERRUPT_ALTIVEC_UNAVAIL

BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL

-#define BOOKE_INTERRUPT_ALTIVEC_ASSIST \
-   BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST

I think I'd prefer to keep them separate.

What is the reason from changing your mind from ver 1? Do you want to have
different defines with same values (we specifically mapped them to the
hardware interrupt numbers). We already upstreamed the necessary changes
in the kernel. Scott, please share your opinion here.

I don't like hiding the fact that they're the same number, which could
lead to wrong code in the absence of ifdefs that strictly mutually
exclude SPE and Altivec code -- there was an instance of this with
MSR_VEC versus MSR_SPE in a previous patchset.

That said, if you want to enforce that mutual exclusion in a way that is
clear, I won't object too loudly -- but the code does look pretty
similar between the two (as well as between the two IVORs).

Yes, I want to make sure we have 2 separate code paths for SPE and
Altivec. No code sharing at all unless it's very generically possible.

Also, which code does look pretty similar? The fact that we deflect
interrupts back into the guest? That's mostly boilerplate.

There's also the injection of a program check (or exiting to userspace)
when CONFIG_SPE/ALTIVEC is missing.  Not a big deal, but maybe it could
be factored into a helper function.  I like minimizing boilerplate.


Yes, me too - but I also like to be explicit. If there's enough code to 
share, factoring those into helpers certainly works well for me.



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


[PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for SPE/FP/AltiVec int numbers

2014-06-30 Thread Mihai Caraman
Use common BOOKE_IRQPRIO and BOOKE_INTERRUPT defines for SPE/FP/AltiVec
which share the same interrupt numbers.

Signed-off-by: Mihai Caraman mihai.cara...@freescale.com
---
v2:
 - remove outdated definitions

 arch/powerpc/include/asm/kvm_asm.h|  8 
 arch/powerpc/kvm/booke.c  | 17 +
 arch/powerpc/kvm/booke.h  |  4 ++--
 arch/powerpc/kvm/booke_interrupts.S   |  9 +
 arch/powerpc/kvm/bookehv_interrupts.S |  4 ++--
 arch/powerpc/kvm/e500.c   | 10 ++
 arch/powerpc/kvm/e500_emulate.c   | 10 ++
 7 files changed, 30 insertions(+), 32 deletions(-)

diff --git a/arch/powerpc/include/asm/kvm_asm.h 
b/arch/powerpc/include/asm/kvm_asm.h
index 9601741..c94fd33 100644
--- a/arch/powerpc/include/asm/kvm_asm.h
+++ b/arch/powerpc/include/asm/kvm_asm.h
@@ -56,14 +56,6 @@
 /* E500 */
 #define BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL 32
 #define BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST 33
-/*
- * TODO: Unify 32-bit and 64-bit kernel exception handlers to use same defines
- */
-#define BOOKE_INTERRUPT_SPE_UNAVAIL BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL
-#define BOOKE_INTERRUPT_SPE_FP_DATA BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST
-#define BOOKE_INTERRUPT_ALTIVEC_UNAVAIL BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL
-#define BOOKE_INTERRUPT_ALTIVEC_ASSIST \
-   BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST
 #define BOOKE_INTERRUPT_SPE_FP_ROUND 34
 #define BOOKE_INTERRUPT_PERFORMANCE_MONITOR 35
 #define BOOKE_INTERRUPT_DOORBELL 36
diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
index ab62109..3c86d9b 100644
--- a/arch/powerpc/kvm/booke.c
+++ b/arch/powerpc/kvm/booke.c
@@ -388,8 +388,8 @@ static int kvmppc_booke_irqprio_deliver(struct kvm_vcpu 
*vcpu,
case BOOKE_IRQPRIO_ITLB_MISS:
case BOOKE_IRQPRIO_SYSCALL:
case BOOKE_IRQPRIO_FP_UNAVAIL:
-   case BOOKE_IRQPRIO_SPE_UNAVAIL:
-   case BOOKE_IRQPRIO_SPE_FP_DATA:
+   case BOOKE_IRQPRIO_SPE_ALTIVEC_UNAVAIL:
+   case BOOKE_IRQPRIO_SPE_FP_DATA_ALTIVEC_ASSIST:
case BOOKE_IRQPRIO_SPE_FP_ROUND:
case BOOKE_IRQPRIO_AP_UNAVAIL:
allowed = 1;
@@ -977,18 +977,19 @@ int kvmppc_handle_exit(struct kvm_run *run, struct 
kvm_vcpu *vcpu,
break;
 
 #ifdef CONFIG_SPE
-   case BOOKE_INTERRUPT_SPE_UNAVAIL: {
+   case BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL: {
if (vcpu-arch.shared-msr  MSR_SPE)
kvmppc_vcpu_enable_spe(vcpu);
else
kvmppc_booke_queue_irqprio(vcpu,
-  BOOKE_IRQPRIO_SPE_UNAVAIL);
+   BOOKE_IRQPRIO_SPE_ALTIVEC_UNAVAIL);
r = RESUME_GUEST;
break;
}
 
-   case BOOKE_INTERRUPT_SPE_FP_DATA:
-   kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_SPE_FP_DATA);
+   case BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST:
+   kvmppc_booke_queue_irqprio(vcpu,
+   BOOKE_IRQPRIO_SPE_FP_DATA_ALTIVEC_ASSIST);
r = RESUME_GUEST;
break;
 
@@ -997,7 +998,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu 
*vcpu,
r = RESUME_GUEST;
break;
 #else
-   case BOOKE_INTERRUPT_SPE_UNAVAIL:
+   case BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL:
/*
 * Guest wants SPE, but host kernel doesn't support it.  Send
 * an unimplemented operation program check to the guest.
@@ -1010,7 +1011,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct 
kvm_vcpu *vcpu,
 * These really should never happen without CONFIG_SPE,
 * as we should never enable the real MSR[SPE] in the guest.
 */
-   case BOOKE_INTERRUPT_SPE_FP_DATA:
+   case BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST:
case BOOKE_INTERRUPT_SPE_FP_ROUND:
printk(KERN_CRIT %s: unexpected SPE interrupt %u at %08lx\n,
   __func__, exit_nr, vcpu-arch.pc);
diff --git a/arch/powerpc/kvm/booke.h b/arch/powerpc/kvm/booke.h
index b632cd3..f182b32 100644
--- a/arch/powerpc/kvm/booke.h
+++ b/arch/powerpc/kvm/booke.h
@@ -32,8 +32,8 @@
 #define BOOKE_IRQPRIO_ALIGNMENT 2
 #define BOOKE_IRQPRIO_PROGRAM 3
 #define BOOKE_IRQPRIO_FP_UNAVAIL 4
-#define BOOKE_IRQPRIO_SPE_UNAVAIL 5
-#define BOOKE_IRQPRIO_SPE_FP_DATA 6
+#define BOOKE_IRQPRIO_SPE_ALTIVEC_UNAVAIL 5
+#define BOOKE_IRQPRIO_SPE_FP_DATA_ALTIVEC_ASSIST 6
 #define BOOKE_IRQPRIO_SPE_FP_ROUND 7
 #define BOOKE_IRQPRIO_SYSCALL 8
 #define BOOKE_IRQPRIO_AP_UNAVAIL 9
diff --git a/arch/powerpc/kvm/booke_interrupts.S 
b/arch/powerpc/kvm/booke_interrupts.S
index 2c6deb5ef..a275dc5 100644
--- a/arch/powerpc/kvm/booke_interrupts.S
+++ b/arch/powerpc/kvm/booke_interrupts.S
@@ -137,8 +137,9 @@ KVM_HANDLER BOOKE_INTERRUPT_WATCHDOG 
SPRN_SPRG_RSCRATCH_CRIT SPRN_CSRR0
 KVM_HANDLER BOOKE_INTERRUPT_DTLB_MISS SPRN_SPRG_RSCRATCH0 

[PATCH 1/6 v2] KVM: PPC: Book3E: Use common defines for SPE/FP/AltiVec int numbers

2014-06-30 Thread Mihai Caraman
Use common BOOKE_IRQPRIO and BOOKE_INTERRUPT defines for SPE/FP/AltiVec
which share the same interrupt numbers.

Signed-off-by: Mihai Caraman mihai.cara...@freescale.com
---
v2:
 - remove outdated definitions

 arch/powerpc/include/asm/kvm_asm.h|  8 
 arch/powerpc/kvm/booke.c  | 17 +
 arch/powerpc/kvm/booke.h  |  4 ++--
 arch/powerpc/kvm/booke_interrupts.S   |  9 +
 arch/powerpc/kvm/bookehv_interrupts.S |  4 ++--
 arch/powerpc/kvm/e500.c   | 10 ++
 arch/powerpc/kvm/e500_emulate.c   | 10 ++
 7 files changed, 30 insertions(+), 32 deletions(-)

diff --git a/arch/powerpc/include/asm/kvm_asm.h 
b/arch/powerpc/include/asm/kvm_asm.h
index 9601741..c94fd33 100644
--- a/arch/powerpc/include/asm/kvm_asm.h
+++ b/arch/powerpc/include/asm/kvm_asm.h
@@ -56,14 +56,6 @@
 /* E500 */
 #define BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL 32
 #define BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST 33
-/*
- * TODO: Unify 32-bit and 64-bit kernel exception handlers to use same defines
- */
-#define BOOKE_INTERRUPT_SPE_UNAVAIL BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL
-#define BOOKE_INTERRUPT_SPE_FP_DATA BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST
-#define BOOKE_INTERRUPT_ALTIVEC_UNAVAIL BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL
-#define BOOKE_INTERRUPT_ALTIVEC_ASSIST \
-   BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST
 #define BOOKE_INTERRUPT_SPE_FP_ROUND 34
 #define BOOKE_INTERRUPT_PERFORMANCE_MONITOR 35
 #define BOOKE_INTERRUPT_DOORBELL 36
diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
index ab62109..3c86d9b 100644
--- a/arch/powerpc/kvm/booke.c
+++ b/arch/powerpc/kvm/booke.c
@@ -388,8 +388,8 @@ static int kvmppc_booke_irqprio_deliver(struct kvm_vcpu 
*vcpu,
case BOOKE_IRQPRIO_ITLB_MISS:
case BOOKE_IRQPRIO_SYSCALL:
case BOOKE_IRQPRIO_FP_UNAVAIL:
-   case BOOKE_IRQPRIO_SPE_UNAVAIL:
-   case BOOKE_IRQPRIO_SPE_FP_DATA:
+   case BOOKE_IRQPRIO_SPE_ALTIVEC_UNAVAIL:
+   case BOOKE_IRQPRIO_SPE_FP_DATA_ALTIVEC_ASSIST:
case BOOKE_IRQPRIO_SPE_FP_ROUND:
case BOOKE_IRQPRIO_AP_UNAVAIL:
allowed = 1;
@@ -977,18 +977,19 @@ int kvmppc_handle_exit(struct kvm_run *run, struct 
kvm_vcpu *vcpu,
break;
 
 #ifdef CONFIG_SPE
-   case BOOKE_INTERRUPT_SPE_UNAVAIL: {
+   case BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL: {
if (vcpu-arch.shared-msr  MSR_SPE)
kvmppc_vcpu_enable_spe(vcpu);
else
kvmppc_booke_queue_irqprio(vcpu,
-  BOOKE_IRQPRIO_SPE_UNAVAIL);
+   BOOKE_IRQPRIO_SPE_ALTIVEC_UNAVAIL);
r = RESUME_GUEST;
break;
}
 
-   case BOOKE_INTERRUPT_SPE_FP_DATA:
-   kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_SPE_FP_DATA);
+   case BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST:
+   kvmppc_booke_queue_irqprio(vcpu,
+   BOOKE_IRQPRIO_SPE_FP_DATA_ALTIVEC_ASSIST);
r = RESUME_GUEST;
break;
 
@@ -997,7 +998,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu 
*vcpu,
r = RESUME_GUEST;
break;
 #else
-   case BOOKE_INTERRUPT_SPE_UNAVAIL:
+   case BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL:
/*
 * Guest wants SPE, but host kernel doesn't support it.  Send
 * an unimplemented operation program check to the guest.
@@ -1010,7 +1011,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct 
kvm_vcpu *vcpu,
 * These really should never happen without CONFIG_SPE,
 * as we should never enable the real MSR[SPE] in the guest.
 */
-   case BOOKE_INTERRUPT_SPE_FP_DATA:
+   case BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST:
case BOOKE_INTERRUPT_SPE_FP_ROUND:
printk(KERN_CRIT %s: unexpected SPE interrupt %u at %08lx\n,
   __func__, exit_nr, vcpu-arch.pc);
diff --git a/arch/powerpc/kvm/booke.h b/arch/powerpc/kvm/booke.h
index b632cd3..f182b32 100644
--- a/arch/powerpc/kvm/booke.h
+++ b/arch/powerpc/kvm/booke.h
@@ -32,8 +32,8 @@
 #define BOOKE_IRQPRIO_ALIGNMENT 2
 #define BOOKE_IRQPRIO_PROGRAM 3
 #define BOOKE_IRQPRIO_FP_UNAVAIL 4
-#define BOOKE_IRQPRIO_SPE_UNAVAIL 5
-#define BOOKE_IRQPRIO_SPE_FP_DATA 6
+#define BOOKE_IRQPRIO_SPE_ALTIVEC_UNAVAIL 5
+#define BOOKE_IRQPRIO_SPE_FP_DATA_ALTIVEC_ASSIST 6
 #define BOOKE_IRQPRIO_SPE_FP_ROUND 7
 #define BOOKE_IRQPRIO_SYSCALL 8
 #define BOOKE_IRQPRIO_AP_UNAVAIL 9
diff --git a/arch/powerpc/kvm/booke_interrupts.S 
b/arch/powerpc/kvm/booke_interrupts.S
index 2c6deb5ef..a275dc5 100644
--- a/arch/powerpc/kvm/booke_interrupts.S
+++ b/arch/powerpc/kvm/booke_interrupts.S
@@ -137,8 +137,9 @@ KVM_HANDLER BOOKE_INTERRUPT_WATCHDOG 
SPRN_SPRG_RSCRATCH_CRIT SPRN_CSRR0
 KVM_HANDLER BOOKE_INTERRUPT_DTLB_MISS SPRN_SPRG_RSCRATCH0