From b817dbdbb03b016cacb36f2ef670949ce3c40532 Mon Sep 17 00:00:00 2001 From: Youling Tang Date: Mon, 6 Feb 2023 09:47:35 +0800 Subject: [PATCH] LoongArch: Flush TLB earlier at initialization LoongArch inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I736HO -------------------------------- Move local_flush_tlb_all() earlier (just after setup_ptwalker() and before page allocation). This can avoid stale TLB entries misguiding the later page allocation. Without this patch the second kernel of kexec/kdump fails to boot SMP. Signed-off-by: Huacai Chen Signed-off-by: Youling Tang Change-Id: I118e0c8aafabfef28bc47a0d06286db850b6e79e --- arch/loongarch/mm/tlb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/loongarch/mm/tlb.c b/arch/loongarch/mm/tlb.c index 9818ce11546b..e18e2aadab65 100644 --- a/arch/loongarch/mm/tlb.c +++ b/arch/loongarch/mm/tlb.c @@ -258,6 +258,7 @@ extern long exception_handlers[VECSIZE * 128 / sizeof(long)]; void setup_tlb_handler(int cpu) { setup_ptwalker(); + local_flush_tlb_all(); output_pgtable_bits_defines(); /* The tlb handlers are generated only once */ @@ -302,5 +303,4 @@ void tlb_init(int cpu) write_csr_stlbpgsize(PS_DEFAULT_SIZE); write_csr_tlbrefill_pagesize(PS_DEFAULT_SIZE); setup_tlb_handler(cpu); - local_flush_tlb_all(); } -- GitLab