foss-for-synopsys-dwc-arc-processors / linux

Helpful resources for users & developers of Linux kernel for ARC
22 stars 13 forks source link

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

Closed vineetgarc closed 2 years ago

vineetgarc commented 2 years ago

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

So far this was done on demand:

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.

The only caveat is, when you swtich to linking kernel in RTP1, the copying needs to happen on user PGD (not PUD) for the last pgd index. But that would have required changing arc_map_kernel_in_mm() in current regime too.

Signed-off-by: Vineet Gupta vgupta@kernel.org

vineetgarc commented 2 years ago

Absolutely this is more of a proof of concept to show that things can be done in a better way - and keep the code portable so both low mapping and high mapping work out of the box w/o gimmics.