Skip to content

Commit 4e67526

Browse files
committed
LoongArch: Use physical addresses for CSR_MERRENTRY/CSR_TLBRENTRY
Now we use virtual addresses to fill CSR_MERRENTRY/CSR_TLBRENTRY, but hardware hope physical addresses. Now it works well because the high bits are ignored above PA_BITS (48 bits), but explicitly use physical addresses can avoid potential bugs. So fix it. Cc: stable@vger.kernel.org Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
1 parent f28abb9 commit 4e67526

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

arch/loongarch/kernel/traps.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,8 +1131,8 @@ static void configure_exception_vector(void)
11311131
tlbrentry = (unsigned long)exception_handlers + 80*VECSIZE;
11321132

11331133
csr_write64(eentry, LOONGARCH_CSR_EENTRY);
1134-
csr_write64(eentry, LOONGARCH_CSR_MERRENTRY);
1135-
csr_write64(tlbrentry, LOONGARCH_CSR_TLBRENTRY);
1134+
csr_write64(__pa(eentry), LOONGARCH_CSR_MERRENTRY);
1135+
csr_write64(__pa(tlbrentry), LOONGARCH_CSR_TLBRENTRY);
11361136
}
11371137

11381138
void per_cpu_trap_init(int cpu)

0 commit comments

Comments
 (0)