summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2020-06-30 20:23:56 +0000
committerkettenis <kettenis@openbsd.org>2020-06-30 20:23:56 +0000
commit73a7763b5d634bd49ccf0dc79ad29aa91b78a915 (patch)
treef2998efe59e0827e6a4489e2165e024bd72abdae /sys
parentFlush OPAL console when writing kernel messages. Removes annoying delay (diff)
downloadwireguard-openbsd-73a7763b5d634bd49ccf0dc79ad29aa91b78a915.tar.xz
wireguard-openbsd-73a7763b5d634bd49ccf0dc79ad29aa91b78a915.zip
Use a lone stdcx. instruction to clear possible userland reservations upon
context switch.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/powerpc64/powerpc64/locore.S6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/arch/powerpc64/powerpc64/locore.S b/sys/arch/powerpc64/powerpc64/locore.S
index 8328d71ae09..4960e79889d 100644
--- a/sys/arch/powerpc64/powerpc64/locore.S
+++ b/sys/arch/powerpc64/powerpc64/locore.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.S,v 1.26 2020/06/30 20:09:37 kettenis Exp $ */
+/* $OpenBSD: locore.S,v 1.27 2020/06/30 20:23:56 kettenis Exp $ */
/*
* Copyright (c) 2020 Mark Kettenis <kettenis@openbsd.org>
@@ -105,6 +105,10 @@ cpu_switchto_asm:
ld %r31, P_ADDR(%r4)
std %r31, CI_CURPCB(%r13)
ld %r1, PCB_SP(%r31)
+#if PCB_SP != 0
+ addi %r31, %r31, PCB_SP
+#endif
+ stdcx. %r1, 0, %r31 /* clear a possible reservation */
ld %r31, P_MD_USER_SLB_PA(%r4)
std %r31, CI_USER_SLB_PA(%r13)