Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/amd64/amd64 It looks like Xen cpu_hatch() calls cpu...



details:   https://anonhg.NetBSD.org/src/rev/9ff4cc301093
branches:  trunk
changeset: 467096:9ff4cc301093
user:      ad <ad%NetBSD.org@localhost>
date:      Mon Jan 13 11:40:15 2020 +0000

description:
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.

diffstat:

 sys/arch/amd64/amd64/locore.S |  6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diffs (24 lines):

diff -r cc4ec30a801c -r 9ff4cc301093 sys/arch/amd64/amd64/locore.S
--- a/sys/arch/amd64/amd64/locore.S     Mon Jan 13 09:53:54 2020 +0000
+++ b/sys/arch/amd64/amd64/locore.S     Mon Jan 13 11:40:15 2020 +0000
@@ -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 @@
        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



Home | Main Index | Thread Index | Old Index