Module Name:    src
Committed By:   ad
Date:           Sun May 17 12:11:11 UTC 2020

Modified Files:
        src/sys/arch/amd64/amd64: spl.S

Log Message:
comments


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/amd64/amd64/spl.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/amd64/amd64/spl.S
diff -u src/sys/arch/amd64/amd64/spl.S:1.45 src/sys/arch/amd64/amd64/spl.S:1.46
--- src/sys/arch/amd64/amd64/spl.S:1.45	Sat May  2 11:12:49 2020
+++ src/sys/arch/amd64/amd64/spl.S	Sun May 17 12:11:11 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: spl.S,v 1.45 2020/05/02 11:12:49 maxv Exp $	*/
+/*	$NetBSD: spl.S,v 1.46 2020/05/17 12:11:11 ad Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -157,7 +157,12 @@ IDTVEC(softintr)
 	movq	L_PCB(%r15),%rcx
 	movq	PCB_RSP(%rcx),%rsp
 
-	xchgq	%r15,CPUVAR(CURLWP)	/* must be globally visible */
+	/*
+	 * for non-interlocked mutex release to work safely the change
+	 * to ci_curlwp must not languish in the store buffer. therefore
+	 * we use XCHG and not MOV here.  see kern_mutex.c.
+	 */
+	xchgq	%r15,CPUVAR(CURLWP)	/* restore curlwp */
 	popq	%r15			/* unwind switchframe */
 	addq	$(5 * 8),%rsp
 	jmp	*%r13			/* back to Xspllower/Xdoreti */

Reply via email to