On Tue, 14 Jun 2011 10:56:31 +0200 Thomas De Schampheleire <patrickdepinguin+linux...@gmail.com> wrote:
> * Therefore, to make sure that the mapping I intended with __ioremap() > is actually reflected in the TLB tables, I added dummy reads of each > page in the TLB, prior to jumping to the boot code, as follows: > /* make sure memory is read, once every 4Kbyte is enough */ > for (p = vaddr; p < vaddr + map_size; p += 0x1000) { > unsigned long dummy = *(volatile unsigned long *)p; > (void)dummy; > } > > * After these changes (make sure all code is mapped + make sure to > read all pages so that the TLBs are updated), my scenario works fine. This is fragile -- you are assuming that it's possible to fit this set of pages in TLB0 all at once, and that none of them will be evicted/invalidated by the time you're done. If you really need to do this, I sugest using settlbcam() from arch/powerpc/mm/fsl_booke_mmu.c to create TLB1 entries with IPROT set. Better still if you could live with whatever memory the kernel has already pinned. -Scott _______________________________________________ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev