Module Name:    src
Committed By:   ad
Date:           Mon Jan 13 11:40:15 UTC 2020

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

Log Message:
It looks like Xen cpu_hatch() calls cpu_switchto() with prevlwp=NULL,
instead of calling idle_loop() directly.  I can't test a change to
cpu_hatch() right now so allow for prevlwp=NULL.


To generate a diff of this commit:
cvs rdiff -u -r1.198 -r1.199 src/sys/arch/amd64/amd64/locore.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/locore.S
diff -u src/sys/arch/amd64/amd64/locore.S:1.198 src/sys/arch/amd64/amd64/locore.S:1.199
--- src/sys/arch/amd64/amd64/locore.S:1.198	Thu Jan  9 00:42:24 2020
+++ src/sys/arch/amd64/amd64/locore.S	Mon Jan 13 11:40:15 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.198 2020/01/09 00:42:24 manu Exp $	*/
+/*	$NetBSD: locore.S,v 1.199 2020/01/13 11:40:15 ad Exp $	*/
 
 /*
  * Copyright-o-rama!
@@ -1079,10 +1079,14 @@ ENTRY(cpu_switchto)
 	movq	%rdi,%r13	/* oldlwp */
 	movq	%rsi,%r12	/* newlwp */
 
+	testq	%r13,%r13	/* oldlwp = NULL ? */
+	jz	.Lskip_save
+
 	/* Save old context. */
 	movq	L_PCB(%r13),%rax
 	movq	%rsp,PCB_RSP(%rax)
 	movq	%rbp,PCB_RBP(%rax)
+.Lskip_save:
 
 	/* Switch to newlwp's stack. */
 	movq	L_PCB(%r12),%r14

Reply via email to