提交 dc0687eb 编写于 作者: H Huacai Chen 提交者: Hongchen Zhang

LoongArch: Fix EENTRY/MERRENTRY setting in setup_tlb_handler()

mainline inclusion
from mainline-v5.19-rc4
commit 26808ceb
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I5OHOB
CVE: NA

--------------------------------

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: NWANG Xuerui <git@xen0n.name>
Signed-off-by: NHuacai Chen <chenhuacai@loongson.cn>
上级 0c6d83f7
...@@ -286,10 +286,11 @@ void setup_tlb_handler(int cpu) ...@@ -286,10 +286,11 @@ void setup_tlb_handler(int cpu)
return; return;
addr = page_address(page); addr = page_address(page);
pcpu_handlers[cpu] = virt_to_phys(addr); pcpu_handlers[cpu] = (unsigned long)addr;
memcpy((void *)addr, (void *)eentry, vec_sz); memcpy((void *)addr, (void *)eentry, vec_sz);
local_flush_icache_range((unsigned long)addr, (unsigned long)addr + 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); csr_write64(pcpu_handlers[cpu] + 80*VECSIZE, LOONGARCH_CSR_TLBRENTRY);
} }
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册