riscv: kasan: use local_tlb_flush_all() to avoid uninitialized __sbi_rfence
authorVincent Chen <vincent.chen@sifive.com>
Fri, 10 Jul 2020 02:40:54 +0000 (10:40 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Aug 2020 07:58:49 +0000 (09:58 +0200)
commit4255c45aef23f960c8cb1f9ba8995b01e86a97e7
treed79412377e1b5ee96744e33832a01685cddb42dd
parent01f3ac5fcc8824306898ea25af0e9eadafcd5da5
riscv: kasan: use local_tlb_flush_all() to avoid uninitialized __sbi_rfence

[ Upstream commit 4cb699d0447be8e0906539f93cbe41e19598ee5a ]

It fails to boot the v5.8-rc4 kernel with CONFIG_KASAN because kasan_init
and kasan_early_init use uninitialized __sbi_rfence as executing the
tlb_flush_all(). Actually, at this moment, only the CPU which is
responsible for the system initialization enables the MMU. Other CPUs are
parking at the .Lsecondary_start. Hence the tlb_flush_all() is able to be
replaced by local_tlb_flush_all() to avoid using uninitialized
__sbi_rfence.

Signed-off-by: Vincent Chen <vincent.chen@sifive.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/riscv/mm/kasan_init.c