[PATCH] powerpc/64s: use ibm,tlbiel-congruence-classes-(hash|radix) dt property

Nicholas Piggin npiggin at gmail.com
Sun Apr 23 09:14:28 AEST 2017


On Sat, 22 Apr 2017 18:02:10 +1000
Benjamin Herrenschmidt <benh at kernel.crashing.org> wrote:

> On Sat, 2017-04-22 at 10:58 +1000, Nicholas Piggin wrote:
> > +static void __init init_mmu_tlb_sets_hash(unsigned long node)
> > +{
> > +       const __be32 *ptr;
> > +
> > +       ptr = of_get_flat_dt_prop(node, "ibm,tlbiel-congruence-classes-hash", NULL);
> > +       if (ptr)
> > +               cur_cpu_spec->tlb_sets_hash = be32_to_cpup(ptr);
> > +}
> > +
> > +static void __init init_mmu_tlb_sets_radix(unsigned long node)
> > +{
> > +       const __be32 *ptr;
> > +
> > +       ptr = of_get_flat_dt_prop(node, "ibm,tlbiel-congruence-classes-radix", NULL);
> > +       if (ptr)
> > +               cur_cpu_spec->tlb_sets_radix = be32_to_cpup(ptr);
> > +}
> >  #else
> >  #define init_mmu_slb_size(node) do { } while(0)
> > +#define init_mmu_hash_sets(node) do { } while(0)
> > +#define init_mmu_radix_sets(node) do { } while(0)
> >  #endif  
> 
> Why 2 functions ? I would have done one checking both props :-)

Probably mindless copy paste. I'll consolidate.


> Anothe thing to do is remove the assembly TLB flush from cpu_setup_power.S.
> 
> That happens too early anyway and do it later, at MMU init.
> 
> In fact, I wonder ... a lot of the stuff in there still requires us to more
> or less know the PVR of the CPU. We could move the call to after we've done
> the early DT parsing I reckon.
> 
> That way we can use arch level to set things like LPCR appropriately.

I think we were going to take another look at moving the setup code later,
but I think that might wait until 4.13.



More information about the Linuxppc-dev mailing list