ARCv3: mm: Better way to setup kernel mappings in per-task page table

In the current RTP0 only mapping regime, kernel translations are also
setup via RTP0 (which canonically is used for user mappings)

 - early boot code sets RTP0 directly with kernel swapper_pg_dir / swapper_pud

 - when userspace starts, RTP0 has user PGD -> PUD, but kernel identity
   mapppings are copied into user PUD at right location via

So far this was done on demand:
 - activate_mm()   -> execve
 - arch_dup_mmap() -> fork

However a better way to do this is to copy the kernel entries into user pud
right when user pud is allocated (like some other arches). This avoids the
need for the additional arch 2 hooks to do on-demand copy. This patch thus
removes them.

Signed-off-by: Vineet Gupta <>
3 files changed