Commit b817dbdb authored by Youling Tang's avatar Youling Tang Committed by Hongchen Zhang
Browse files

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: default avatarHuacai Chen <chenhuacai@loongson.cn>
Signed-off-by: default avatarYouling Tang <tangyouling@loongson.cn>
Change-Id: I118e0c8aafabfef28bc47a0d06286db850b6e79e
parent 530b3d21
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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();
}