Module Name:    src
Committed By:   skrll
Date:           Sat Nov 21 19:44:52 UTC 2020

Modified Files:
        src/sys/arch/arm/arm32: cpuswitch.S

Log Message:
Ensure that r5 contains curlwp before DO_AST_AND_RESTORE_ALIGNMENT_FAULTS
in lwp_trampoline as required by the move to make ASTs operate per-LWP
rather than per-CPU.

Thanks to martin@ for bisecting the amap corruption he was seeing and
testing this fix.


To generate a diff of this commit:
cvs rdiff -u -r1.103 -r1.104 src/sys/arch/arm/arm32/cpuswitch.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/arm/arm32/cpuswitch.S
diff -u src/sys/arch/arm/arm32/cpuswitch.S:1.103 src/sys/arch/arm/arm32/cpuswitch.S:1.104
--- src/sys/arch/arm/arm32/cpuswitch.S:1.103	Sat Aug 15 13:33:54 2020
+++ src/sys/arch/arm/arm32/cpuswitch.S	Sat Nov 21 19:44:52 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpuswitch.S,v 1.103 2020/08/15 13:33:54 skrll Exp $	*/
+/*	$NetBSD: cpuswitch.S,v 1.104 2020/11/21 19:44:52 skrll Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -87,7 +87,7 @@
 #include <arm/asm.h>
 #include <arm/locore.h>
 
-	RCSID("$NetBSD: cpuswitch.S,v 1.103 2020/08/15 13:33:54 skrll Exp $")
+	RCSID("$NetBSD: cpuswitch.S,v 1.104 2020/11/21 19:44:52 skrll Exp $")
 
 /* LINTSTUB: include <sys/param.h> */
 
@@ -324,7 +324,8 @@ ENTRY_NP(lwp_trampoline)
 	GET_CPSR(r0)
 	CPSID_I(r0, r0)			/* Kill irq's */
 
-	GET_CURCPU(r4)			/* for DO_AST */
+	/* for DO_AST */
+	GET_CURX(r4, r5)		/* r4 = curcpu, r5 = curlwp */
 	DO_AST_AND_RESTORE_ALIGNMENT_FAULTS
 	PULLFRAME
 

Reply via email to