From: visa Date: Tue, 23 Aug 2016 12:54:09 +0000 (+0000) Subject: The TLB refill and XTLB refill exceptions use distinct exception vectors X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c5cb0eb4c053b4603d07b1b34882601ebfbb7ce0;p=openbsd The TLB refill and XTLB refill exceptions use distinct exception vectors on Loongson 3A. Consequently, the kernel has to set up both vectors to prevent panics with virtual address references. On Loongson 2F, it is enough to set up the TLB refill vector because the XTLB refill exception uses the same vector address. ok miod@ --- diff --git a/sys/arch/loongson/loongson/machdep.c b/sys/arch/loongson/loongson/machdep.c index c65ebcd5295..695c5359813 100644 --- a/sys/arch/loongson/loongson/machdep.c +++ b/sys/arch/loongson/loongson/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.64 2016/03/06 19:42:27 mpi Exp $ */ +/* $OpenBSD: machdep.c,v 1.65 2016/08/23 12:54:09 visa Exp $ */ /* * Copyright (c) 2009, 2010, 2014 Miodrag Vallat. @@ -703,10 +703,14 @@ mips_init(uint64_t argc, uint64_t argv, uint64_t envp, uint64_t cv, /* * Build proper TLB refill handler trampolines. + * + * On Loongson 2F, the XTLB refill exception actually uses + * the TLB refill vector. */ xtlb_handler = (vaddr_t)&xtlb_miss; build_trampoline(TLB_MISS_EXC_VEC, xtlb_handler); + build_trampoline(XTLB_MISS_EXC_VEC, xtlb_handler); /* * Turn off bootstrap exception vectors.