On Sat, 22 Apr 2017 18:02:10 +1000 Benjamin Herrenschmidt <b...@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.