riscv: Fix is_linear_mapping with recent move of KASAN region
authorAlexandre Ghiti <alexandre.ghiti@canonical.com>
Fri, 25 Feb 2022 12:39:48 +0000 (13:39 +0100)
committerPalmer Dabbelt <palmer@rivosinc.com>
Thu, 3 Mar 2022 21:11:02 +0000 (13:11 -0800)
commit8b274f2238950c55570ff14fcc278a7fcbecc663
tree31983a111e6ac4bb99dae6870fac541071a70337
parent22e2100b1b07d6f5acc71cc1acb53f680c677d77
riscv: Fix is_linear_mapping with recent move of KASAN region

The KASAN region was recently moved between the linear mapping and the
kernel mapping, is_linear_mapping used to check the validity of an
address by using the start of the kernel mapping, which is now wrong.

Fix this by using the maximum size of the physical memory.

Fixes: f7ae02333d13 ("riscv: Move KASAN mapping next to the kernel mapping")
Signed-off-by: Alexandre Ghiti <alexandre.ghiti@canonical.com>
Cc: stable@vger.kernel.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/include/asm/page.h
arch/riscv/include/asm/pgtable.h