summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvisa <visa@openbsd.org>2016-08-23 12:54:09 +0000
committervisa <visa@openbsd.org>2016-08-23 12:54:09 +0000
commitc5cb0eb4c053b4603d07b1b34882601ebfbb7ce0 (patch)
treebc0a9abc4fe0074f32c1d24b3bde7799ce601285
parentpool_setipl (diff)
downloadwireguard-openbsd-c5cb0eb4c053b4603d07b1b34882601ebfbb7ce0.tar.xz
wireguard-openbsd-c5cb0eb4c053b4603d07b1b34882601ebfbb7ce0.zip
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@
-rw-r--r--sys/arch/loongson/loongson/machdep.c6
1 files changed, 5 insertions, 1 deletions
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.