Skip to content

Commit 4cb699d

Browse files
VincentZWCpalmer-dabbelt
authored andcommitted
riscv: kasan: use local_tlb_flush_all() to avoid uninitialized __sbi_rfence
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 <[email protected]> Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent ba47d84 commit 4cb699d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/riscv/mm/kasan_init.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ asmlinkage void __init kasan_early_init(void)
4444
(__pa(((uintptr_t) kasan_early_shadow_pmd))),
4545
__pgprot(_PAGE_TABLE)));
4646

47-
flush_tlb_all();
47+
local_flush_tlb_all();
4848
}
4949

5050
static void __init populate(void *start, void *end)
@@ -79,7 +79,7 @@ static void __init populate(void *start, void *end)
7979
pfn_pgd(PFN_DOWN(__pa(&pmd[offset])),
8080
__pgprot(_PAGE_TABLE)));
8181

82-
flush_tlb_all();
82+
local_flush_tlb_all();
8383
memset(start, 0, end - start);
8484
}
8585

0 commit comments

Comments
 (0)