Skip to content

Commit

Permalink
LoongArch: Fix EENTRY/MERRENTRY setting in setup_tlb_handler()
Browse files Browse the repository at this point in the history
setup_tlb_handler() is expected to set per-cpu exception handlers, but
it only set the TLBRENTRY successfully because of copy & paste errors,
so fix it.

Reviewed-by: WANG Xuerui <git@xen0n.name>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
  • Loading branch information
Huacai Chen committed Jun 25, 2022
1 parent bab1c29 commit 26808ce
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions arch/loongarch/mm/tlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,11 @@ void setup_tlb_handler(int cpu)
return;

addr = page_address(page);
pcpu_handlers[cpu] = virt_to_phys(addr);
pcpu_handlers[cpu] = (unsigned long)addr;
memcpy((void *)addr, (void *)eentry, vec_sz);
local_flush_icache_range((unsigned long)addr, (unsigned long)addr + vec_sz);
csr_write64(pcpu_handlers[cpu], LOONGARCH_CSR_TLBRENTRY);
csr_write64(pcpu_handlers[cpu], LOONGARCH_CSR_EENTRY);
csr_write64(pcpu_handlers[cpu], LOONGARCH_CSR_MERRENTRY);
csr_write64(pcpu_handlers[cpu] + 80*VECSIZE, LOONGARCH_CSR_TLBRENTRY);
}
#endif
Expand Down

0 comments on commit 26808ce

Please sign in to comment.