]> git.baikalelectronics.ru Git - kernel.git/commit
riscv: Fix kasan pud population
authorAlexandre Ghiti <alexandre.ghiti@canonical.com>
Fri, 25 Feb 2022 12:39:53 +0000 (13:39 +0100)
committerPalmer Dabbelt <palmer@rivosinc.com>
Thu, 3 Mar 2022 23:34:29 +0000 (15:34 -0800)
commitb5df5e12db9f122d19d3b57fafec030da1bccae0
tree4b10d6e95f382337251bd12e6a8f084cf43179fe
parent808871b4ad4e8cb28cf55870e4ff882d60d42c5c
riscv: Fix kasan pud population

In sv48, the kasan inner regions are not aligned on PGDIR_SIZE and then
when we populate the kasan linear mapping region, we clear the kasan
vmalloc region which is in the same PGD.

Fix this by copying the content of the kasan early pud after allocating a
new PGD for the first time.

Fixes: d20ee68dc310 ("riscv: Implement sv48 support")
Signed-off-by: Alexandre Ghiti <alexandre.ghiti@canonical.com>
Cc: stable@vger.kernel.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/mm/kasan_init.c