Message ID | 3807e749871d460f90a57ad47ad2654d@BY2PR03MB508.namprd03.prod.outlook.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
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 = 0xffff0000, > .pvr_value = 0x80200000, > @@ -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 = 0xffff0000, > .pvr_value = 0x80230000, > 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 majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
> -----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; kvm@vger.kernel.org; > linuxppc-dev@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: addi r3,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 = 0xffff0000, > > .pvr_value = 0x80200000, > > @@ -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 = 0xffff0000, > > .pvr_value = 0x80230000, > > > > 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
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; kvm@vger.kernel.org; > > linuxppc-dev@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: addi r3,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 = 0xffff0000, > > > .pvr_value = 0x80200000, > > > @@ -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 = 0xffff0000, > > > .pvr_value = 0x80230000, > > > > > > > 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 majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
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 +#ifndef CONFIG_PPC_E500MC /* SPE Floating Point Data */ #ifdef CONFIG_SPE EXCEPTION(0x2030, SPE_FP_DATA_ALTIVEC_ASSIST, SPEFloatingPointData, @@ -641,6 +645,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV) EXCEPTION(0x2050, SPE_FP_ROUND, SPEFloatingPointRound, \ unknown_exception, EXC_XFER_EE) #endif /* CONFIG_SPE */ +#endif /* Performance Monitor */ EXCEPTION(0x2060, PERFORMANCE_MONITOR, PerformanceMonitor, \ @@ -947,6 +952,7 @@ get_phys_addr: * Global functions */ +#ifdef CONFIG_E200 /* Adjust or setup IVORs for e200 */ _GLOBAL(__setup_e200_ivors) li r3,DebugDebug@l @@ -959,7 +965,9 @@ _GLOBAL(__setup_e200_ivors) mtspr SPRN_IVOR34,r3 sync blr +#endif +#ifndef CONFIG_PPC_E500MC /* Adjust or setup IVORs for e500v1/v2 */ _GLOBAL(__setup_e500_ivors) li r3,DebugCrit@l @@ -974,6 +982,7 @@ _GLOBAL(__setup_e500_ivors) mtspr SPRN_IVOR35,r3 sync blr +#endif /* Adjust or setup IVORs for e500mc */ _GLOBAL(__setup_e500mc_ivors) diff --git a/arch/powerpc/kernel/cpu_setup_fsl_booke.S b/arch/powerpc/kernel/cpu_setup_fsl_booke.S index cc2d896..32afb50 100644 --- a/arch/powerpc/kernel/cpu_setup_fsl_booke.S +++ b/arch/powerpc/kernel/cpu_setup_fsl_booke.S @@ -109,12 +109,16 @@ _GLOBAL(__setup_cpu_e6500) blr #ifdef CONFIG_PPC32 +#ifdef CONFIG_E200 _GLOBAL(__setup_cpu_e200) /* enable dedicated debug exception handling resources (Debug APU) */ mfspr r3,SPRN_HID0 ori r3,r3,HID0_DAPUEN@l mtspr SPRN_HID0,r3 b __setup_e200_ivors +#endif /* CONFIG_E200 */ +#ifdef CONFIG_E500 +#ifndef CONFIG_PPC_E500MC _GLOBAL(__setup_cpu_e500v1) _GLOBAL(__setup_cpu_e500v2) mflr r4 @@ -129,6 +133,8 @@ _GLOBAL(__setup_cpu_e500v2) #endif mtlr r4 blr +#endif /* !CONFIG_PPC_E500MC */ + _GLOBAL(__setup_cpu_e500mc) _GLOBAL(__setup_cpu_e5500) mflr r5 @@ -223,3 +229,4 @@ _GLOBAL(__setup_cpu_e5500) mtlr r5 blr #endif +#endif /* CONFIG_E500 */ 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 = 0xffff0000, .pvr_value = 0x80200000, @@ -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 = 0xffff0000, .pvr_value = 0x80230000,