[PATCH v2] powerpc: Add POWER9 architected mode to cputable

Michael Ellerman mpe at ellerman.id.au
Sat Feb 18 18:54:48 AEDT 2017


Russell Currey <ruscur at russell.cc> writes:
> On Fri, 2017-02-17 at 21:26 +1100, Michael Ellerman wrote:
>> Russell Currey <ruscur at russell.cc> writes:
>> > diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
>> > index 6a82ef039c50..d23a54b09436 100644
>> > --- a/arch/powerpc/kernel/cputable.c
>> > +++ b/arch/powerpc/kernel/cputable.c
>> > @@ -386,6 +386,25 @@ static struct cpu_spec __initdata cpu_specs[] = {
>> >  		.machine_check_early	=
>> > __machine_check_early_realmode_p8,
>> >  		.platform		= "power8",
>> >  	},
>> > +	{	/* 3.00-compliant processor, i.e. Power9 "architected"
>> > mode */
>> > +		.pvr_mask		= 0xffffffff,
>> > +		.pvr_value		= 0x0f000005,
>> > +		.cpu_name		= "POWER9 (architected)",
>> > +		.cpu_features		= CPU_FTRS_POWER9,
>> > +		.cpu_user_features	= COMMON_USER_POWER9,
>> > +		.cpu_user_features2	= COMMON_USER2_POWER9,
>> > +		.mmu_features		= MMU_FTRS_POWER9,
>> > +		.icache_bsize		= 128,
>> > +		.dcache_bsize		= 128,
>> > +		.num_pmcs		= 6,
>> 
>> It's important *not* to set num_pmcs for the architected PVRs.
...
>
> Oh and also, do you want me to respin or are you happy to drop it on your end?

I fixed it up:

commit 6ae3f8ad2017079292cb49c8959b527bcbcbefed
Author:     Russell Currey <ruscur at russell.cc>
AuthorDate: Fri Feb 17 13:01:35 2017 +1100
Commit:     Michael Ellerman <mpe at ellerman.id.au>
CommitDate: Fri Feb 17 21:48:56 2017 +1100

    powerpc: Add POWER9 architected mode to cputable
    
    PVR value of 0x0F000005 means we are arch v3.00 compliant (i.e. POWER9).
    
    Acked-by: Michael Neuling <mikey at neuling.org>
    Signed-off-by: Russell Currey <ruscur at russell.cc>
    [mpe: Don't set num_pmcs, so we keep the PMU fields from the raw entry]
    Signed-off-by: Michael Ellerman <mpe at ellerman.id.au>

diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index 6a82ef039c50..bb7a1890aeb7 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -386,6 +386,23 @@ static struct cpu_spec __initdata cpu_specs[] = {
 		.machine_check_early	= __machine_check_early_realmode_p8,
 		.platform		= "power8",
 	},
+	{	/* 3.00-compliant processor, i.e. Power9 "architected" mode */
+		.pvr_mask		= 0xffffffff,
+		.pvr_value		= 0x0f000005,
+		.cpu_name		= "POWER9 (architected)",
+		.cpu_features		= CPU_FTRS_POWER9,
+		.cpu_user_features	= COMMON_USER_POWER9,
+		.cpu_user_features2	= COMMON_USER2_POWER9,
+		.mmu_features		= MMU_FTRS_POWER9,
+		.icache_bsize		= 128,
+		.dcache_bsize		= 128,
+		.oprofile_type		= PPC_OPROFILE_INVALID,
+		.oprofile_cpu_type	= "ppc64/ibm-compat-v1",
+		.cpu_setup		= __setup_cpu_power9,
+		.cpu_restore		= __restore_cpu_power9,
+		.flush_tlb		= __flush_tlb_power9,
+		.platform		= "power9",
+	},
 	{	/* Power7 */
 		.pvr_mask		= 0xffff0000,
 		.pvr_value		= 0x003f0000,


cheers


More information about the Linuxppc-dev mailing list