summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2016-08-08 19:27:13 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2016-08-08 19:27:13 +0000
commit961539067a3cd7ba6e75001c7aac9de0debd0c35 (patch)
treef95f33f4d429778c8d7090bbdb66b6f8f5af3ac6 /sys/arch
parent90732f242e35c3822571e72efe0f94b67ca5b07f (diff)
Move the cpu_setup() call to the end of initarm(). On Cortex-A53 processors
atomic instructions don't work unless the data cache is enabled. This happens in cpu_setup(), but that gets currently called from cpu_startup() which runs after a number of kernel subsystems have been initialized. Since some of these subsystems use locks, which need atomic instructions, we fault on Cortex-A53. Since at the end of initarm() we're done setting up the pmap and initializing other low-level sense, calling cpu_setup() here makes much more sense. Remove setting up proc0paddr as well from cpu_startup(), since that already happens in initarm(). Tested on zaurus by deraadt@. ok jsg@, patrick@
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/arm/arm/arm32_machdep.c10
-rw-r--r--sys/arch/armish/armish/armish_machdep.c4
-rw-r--r--sys/arch/armv7/armv7/armv7_machdep.c4
-rw-r--r--sys/arch/zaurus/zaurus/zaurus_machdep.c4
4 files changed, 11 insertions, 11 deletions
diff --git a/sys/arch/arm/arm/arm32_machdep.c b/sys/arch/arm/arm/arm32_machdep.c
index 0149df78c68..1551f9dca72 100644
--- a/sys/arch/arm/arm/arm32_machdep.c
+++ b/sys/arch/arm/arm/arm32_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: arm32_machdep.c,v 1.48 2016/01/31 00:14:50 jsg Exp $ */
+/* $OpenBSD: arm32_machdep.c,v 1.49 2016/08/08 19:27:12 kettenis Exp $ */
/* $NetBSD: arm32_machdep.c,v 1.42 2003/12/30 12:33:15 pk Exp $ */
/*
@@ -165,7 +165,7 @@ arm32_vector_init(vaddr_t va, int which)
*
* Note: This has to be done here (and not just in
* cpu_setup()) because the vector page needs to be
- * accessible *before* cpu_startup() is called.
+ * accessible *before* main() is called.
* Think ddb(9) ...
*
* NOTE: If the CPU control register is not readable,
@@ -237,12 +237,6 @@ cpu_startup()
paddr_t minaddr;
paddr_t maxaddr;
- proc0paddr = (struct user *)kernelstack.pv_va;
- proc0.p_addr = proc0paddr;
-
- /* Set the cpu control register */
- cpu_setup();
-
/* Lock down zero page */
vector_page_setprot(PROT_READ | PROT_EXEC);
diff --git a/sys/arch/armish/armish/armish_machdep.c b/sys/arch/armish/armish/armish_machdep.c
index ec3279c7ca0..a73b54e5caf 100644
--- a/sys/arch/armish/armish/armish_machdep.c
+++ b/sys/arch/armish/armish/armish_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: armish_machdep.c,v 1.39 2015/05/10 15:56:28 jsg Exp $ */
+/* $OpenBSD: armish_machdep.c,v 1.40 2016/08/08 19:27:12 kettenis Exp $ */
/* $NetBSD: lubbock_machdep.c,v 1.2 2003/07/15 00:25:06 lukem Exp $ */
/*
@@ -770,6 +770,8 @@ initarm(void *arg0, void *arg1, void *arg2)
Debugger();
#endif
+ cpu_setup();
+
/* We return the new stack pointer address */
return(kernelstack.pv_va + USPACE_SVC_STACK_TOP);
}
diff --git a/sys/arch/armv7/armv7/armv7_machdep.c b/sys/arch/armv7/armv7/armv7_machdep.c
index 11b2af1d54f..8c1bda586a2 100644
--- a/sys/arch/armv7/armv7/armv7_machdep.c
+++ b/sys/arch/armv7/armv7/armv7_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: armv7_machdep.c,v 1.34 2016/07/30 08:07:01 kettenis Exp $ */
+/* $OpenBSD: armv7_machdep.c,v 1.35 2016/08/08 19:27:12 kettenis Exp $ */
/* $NetBSD: lubbock_machdep.c,v 1.2 2003/07/15 00:25:06 lukem Exp $ */
/*
@@ -795,6 +795,8 @@ initarm(void *arg0, void *arg1, void *arg2)
#endif
printf("board type: %u\n", board_id);
+ cpu_setup();
+
/* We return the new stack pointer address */
return(kernelstack.pv_va + USPACE_SVC_STACK_TOP);
}
diff --git a/sys/arch/zaurus/zaurus/zaurus_machdep.c b/sys/arch/zaurus/zaurus/zaurus_machdep.c
index af987a98da1..f2148169d54 100644
--- a/sys/arch/zaurus/zaurus/zaurus_machdep.c
+++ b/sys/arch/zaurus/zaurus/zaurus_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: zaurus_machdep.c,v 1.59 2015/05/10 15:56:28 jsg Exp $ */
+/* $OpenBSD: zaurus_machdep.c,v 1.60 2016/08/08 19:27:12 kettenis Exp $ */
/* $NetBSD: lubbock_machdep.c,v 1.2 2003/07/15 00:25:06 lukem Exp $ */
/*
@@ -1110,6 +1110,8 @@ initarm(void *arg0, void *arg1, void *arg2)
Debugger();
#endif
+ cpu_setup();
+
/* We return the new stack pointer address */
return(kernelstack.pv_va + USPACE_SVC_STACK_TOP);
}