Skip to content

Commit 26808ce

Browse files
committed
LoongArch: Fix EENTRY/MERRENTRY setting in setup_tlb_handler()
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 <[email protected]> Signed-off-by: Huacai Chen <[email protected]>
1 parent bab1c29 commit 26808ce

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

arch/loongarch/mm/tlb.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,10 +286,11 @@ void setup_tlb_handler(int cpu)
286286
return;
287287

288288
addr = page_address(page);
289-
pcpu_handlers[cpu] = virt_to_phys(addr);
289+
pcpu_handlers[cpu] = (unsigned long)addr;
290290
memcpy((void *)addr, (void *)eentry, vec_sz);
291291
local_flush_icache_range((unsigned long)addr, (unsigned long)addr + vec_sz);
292-
csr_write64(pcpu_handlers[cpu], LOONGARCH_CSR_TLBRENTRY);
292+
csr_write64(pcpu_handlers[cpu], LOONGARCH_CSR_EENTRY);
293+
csr_write64(pcpu_handlers[cpu], LOONGARCH_CSR_MERRENTRY);
293294
csr_write64(pcpu_handlers[cpu] + 80*VECSIZE, LOONGARCH_CSR_TLBRENTRY);
294295
}
295296
#endif

0 commit comments

Comments
 (0)