riscv: Cleanup KASAN_VMALLOC support
authorAlexandre Ghiti <alex@ghiti.fr>
Sat, 13 Mar 2021 08:45:05 +0000 (03:45 -0500)
committerPalmer Dabbelt <palmerdabbelt@google.com>
Tue, 30 Mar 2021 06:13:29 +0000 (23:13 -0700)
commit2da073c19641bb6820c3591d3d865120263f14e8
treec60b934124b45604c1724fc3cbe1233267ef912f
parentf35bb4b8d10a8ce356f0fff634fa885926f8d439
riscv: Cleanup KASAN_VMALLOC support

When KASAN vmalloc region is populated, there is no userspace process and
the page table in use is swapper_pg_dir, so there is no need to read
SATP. Then we can use the same scheme used by kasan_populate_p*d
functions to go through the page table, which harmonizes the code.

In addition, make use of set_pgd that goes through all unused page table
levels, contrary to p*d_populate functions, which makes this function work
whatever the number of page table levels.

Signed-off-by: Alexandre Ghiti <alex@ghiti.fr>
Reviewed-by: Palmer Dabbelt <palmerdabbelt@google.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
arch/riscv/mm/kasan_init.c