Merge from vmlocking.
This commit is contained in:
parent
7a09009b52
commit
395a384526
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: locore.S,v 1.34 2007/12/02 21:43:11 dsl Exp $ */
|
/* $NetBSD: locore.S,v 1.35 2007/12/03 20:21:32 ad Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright-o-rama!
|
* Copyright-o-rama!
|
||||||
|
@ -865,7 +865,8 @@ ENTRY(dumpsys)
|
||||||
ret
|
ret
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* struct lwp *cpu_switchto(struct lwp *, struct lwp *)
|
* struct lwp *cpu_switchto(struct lwp *oldlwp, struct newlwp,
|
||||||
|
* bool returning)
|
||||||
*
|
*
|
||||||
* 1. if (oldlwp != NULL), save its context.
|
* 1. if (oldlwp != NULL), save its context.
|
||||||
* 2. then, restore context of newlwp.
|
* 2. then, restore context of newlwp.
|
||||||
|
@ -903,6 +904,13 @@ ENTRY(cpu_switchto)
|
||||||
movq PCB_RSP(%r14),%rsp
|
movq PCB_RSP(%r14),%rsp
|
||||||
movq PCB_RBP(%r14),%rbp
|
movq PCB_RBP(%r14),%rbp
|
||||||
|
|
||||||
|
/* Set curlwp. */
|
||||||
|
movq %r12,CPUVAR(CURLWP)
|
||||||
|
|
||||||
|
/* Skip the rest if returning to a pinned LWP. */
|
||||||
|
testb %dl,%dl
|
||||||
|
jnz 4f
|
||||||
|
|
||||||
/* Switch TSS. Reset "task busy" flag before loading. */
|
/* Switch TSS. Reset "task busy" flag before loading. */
|
||||||
#ifdef XEN
|
#ifdef XEN
|
||||||
movq %r14, %rdi
|
movq %r14, %rdi
|
||||||
|
@ -914,9 +922,6 @@ ENTRY(cpu_switchto)
|
||||||
ltr %dx
|
ltr %dx
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Set curlwp. */
|
|
||||||
movq %r12,CPUVAR(CURLWP)
|
|
||||||
|
|
||||||
/* Don't bother with the rest if switching to a system process. */
|
/* Don't bother with the rest if switching to a system process. */
|
||||||
testl $LW_SYSTEM,L_FLAG(%r12)
|
testl $LW_SYSTEM,L_FLAG(%r12)
|
||||||
jnz 4f
|
jnz 4f
|
||||||
|
@ -1103,10 +1108,8 @@ syscall_return:
|
||||||
movl CPUVAR(ILEVEL),%r8d
|
movl CPUVAR(ILEVEL),%r8d
|
||||||
xorq %rax,%rax
|
xorq %rax,%rax
|
||||||
call _C_LABEL(printf)
|
call _C_LABEL(printf)
|
||||||
#ifdef DDB
|
movl $IPL_NONE,%edi
|
||||||
int $3
|
call _C_LABEL(spllower)
|
||||||
#endif /* DDB */
|
|
||||||
movl $IPL_NONE,CPUVAR(ILEVEL)
|
|
||||||
jmp .Lsyscall_checkast
|
jmp .Lsyscall_checkast
|
||||||
4: .asciz "WARNING: SPL NOT LOWERED ON SYSCALL %d %d EXIT %x %x\n"
|
4: .asciz "WARNING: SPL NOT LOWERED ON SYSCALL %d %d EXIT %x %x\n"
|
||||||
#endif
|
#endif
|
||||||
|
@ -1218,10 +1221,8 @@ iret_return:
|
||||||
movabsq $4f, %rdi
|
movabsq $4f, %rdi
|
||||||
xorq %rax,%rax
|
xorq %rax,%rax
|
||||||
call _C_LABEL(printf)
|
call _C_LABEL(printf)
|
||||||
#ifdef DDB
|
movl $IPL_NONE,%edi
|
||||||
int $3
|
call _C_LABEL(spllower)
|
||||||
#endif /* DDB */
|
|
||||||
movl $IPL_NONE,CPUVAR(ILEVEL)
|
|
||||||
jmp .Losyscall_checkast
|
jmp .Losyscall_checkast
|
||||||
4: .asciz "WARNING: SPL NOT LOWERED ON SYSCALL EXIT\n"
|
4: .asciz "WARNING: SPL NOT LOWERED ON SYSCALL EXIT\n"
|
||||||
#endif /* DIAGNOSTIC */
|
#endif /* DIAGNOSTIC */
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: trap.c,v 1.39 2007/12/02 16:37:58 ad Exp $ */
|
/* $NetBSD: trap.c,v 1.40 2007/12/03 20:21:32 ad Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
|
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
|
||||||
|
@ -75,7 +75,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.39 2007/12/02 16:37:58 ad Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.40 2007/12/03 20:21:32 ad Exp $");
|
||||||
|
|
||||||
#include "opt_ddb.h"
|
#include "opt_ddb.h"
|
||||||
#include "opt_kgdb.h"
|
#include "opt_kgdb.h"
|
||||||
|
@ -376,9 +376,7 @@ copyfault:
|
||||||
uvmexp.softs++;
|
uvmexp.softs++;
|
||||||
if (l->l_flag & LP_OWEUPC) {
|
if (l->l_flag & LP_OWEUPC) {
|
||||||
p->p_flag &= ~LP_OWEUPC;
|
p->p_flag &= ~LP_OWEUPC;
|
||||||
KERNEL_LOCK(1, l);
|
|
||||||
ADDUPROF(l);
|
ADDUPROF(l);
|
||||||
KERNEL_UNLOCK_LAST(l);
|
|
||||||
}
|
}
|
||||||
/* Allow a forced task switch. */
|
/* Allow a forced task switch. */
|
||||||
if (curcpu()->ci_want_resched)
|
if (curcpu()->ci_want_resched)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: vector.S,v 1.16 2007/12/03 15:33:10 ad Exp $ */
|
/* $NetBSD: vector.S,v 1.17 2007/12/03 20:21:33 ad Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001 Wasabi Systems, Inc.
|
* Copyright (c) 2001 Wasabi Systems, Inc.
|
||||||
|
@ -261,10 +261,8 @@ calltrap:
|
||||||
movl %ebx,%edx
|
movl %ebx,%edx
|
||||||
xorq %rax,%rax
|
xorq %rax,%rax
|
||||||
call _C_LABEL(printf)
|
call _C_LABEL(printf)
|
||||||
#ifdef DDB
|
movl %ebx,%edi
|
||||||
int $3
|
call _C_LABEL(spllower)
|
||||||
#endif /* DDB */
|
|
||||||
movl %ebx,CPUVAR(ILEVEL)
|
|
||||||
jmp .Lalltraps_checkast
|
jmp .Lalltraps_checkast
|
||||||
4: .asciz "WARNING: SPL NOT LOWERED ON TRAP EXIT %x %x\n"
|
4: .asciz "WARNING: SPL NOT LOWERED ON TRAP EXIT %x %x\n"
|
||||||
#endif /* DIAGNOSTIC */
|
#endif /* DIAGNOSTIC */
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: trap.c,v 1.227 2007/12/02 16:37:58 ad Exp $ */
|
/* $NetBSD: trap.c,v 1.228 2007/12/03 20:21:33 ad Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1998, 2000, 2005 The NetBSD Foundation, Inc.
|
* Copyright (c) 1998, 2000, 2005 The NetBSD Foundation, Inc.
|
||||||
|
@ -75,7 +75,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.227 2007/12/02 16:37:58 ad Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.228 2007/12/03 20:21:33 ad Exp $");
|
||||||
|
|
||||||
#include "opt_ddb.h"
|
#include "opt_ddb.h"
|
||||||
#include "opt_kgdb.h"
|
#include "opt_kgdb.h"
|
||||||
|
@ -530,9 +530,7 @@ copyfault:
|
||||||
uvmexp.softs++;
|
uvmexp.softs++;
|
||||||
if (l->l_pflag & LP_OWEUPC) {
|
if (l->l_pflag & LP_OWEUPC) {
|
||||||
l->l_pflag &= ~LP_OWEUPC;
|
l->l_pflag &= ~LP_OWEUPC;
|
||||||
KERNEL_LOCK(1, l);
|
|
||||||
ADDUPROF(l);
|
ADDUPROF(l);
|
||||||
KERNEL_UNLOCK_LAST(l);
|
|
||||||
}
|
}
|
||||||
/* Allow a forced task switch. */
|
/* Allow a forced task switch. */
|
||||||
if (curcpu()->ci_want_resched)
|
if (curcpu()->ci_want_resched)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: vector.S,v 1.31 2007/12/03 15:33:46 ad Exp $ */
|
/* $NetBSD: vector.S,v 1.32 2007/12/03 20:21:33 ad Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2002 (c) Wasabi Systems, Inc.
|
* Copyright 2002 (c) Wasabi Systems, Inc.
|
||||||
|
@ -901,10 +901,9 @@ calltrap:
|
||||||
pushl $4f
|
pushl $4f
|
||||||
call _C_LABEL(printf)
|
call _C_LABEL(printf)
|
||||||
addl $4,%esp
|
addl $4,%esp
|
||||||
#ifdef DDB
|
pushl %ebx
|
||||||
int $3
|
call _C_LABEL(spllower)
|
||||||
#endif /* DDB */
|
addl $4,%esp
|
||||||
movl %ebx,CPUVAR(ILEVEL)
|
|
||||||
jmp .Lalltraps_checkast /* re-check ASTs */
|
jmp .Lalltraps_checkast /* re-check ASTs */
|
||||||
4: .asciz "WARNING: SPL NOT LOWERED ON TRAP EXIT\n"
|
4: .asciz "WARNING: SPL NOT LOWERED ON TRAP EXIT\n"
|
||||||
#endif /* DIAGNOSTIC */
|
#endif /* DIAGNOSTIC */
|
||||||
|
|
Loading…
Reference in New Issue