Undo revivesa damage to userret().

This commit is contained in:
ad 2008-10-21 11:51:23 +00:00
parent 42d611dd37
commit a9327b33e2
13 changed files with 38 additions and 62 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_syscall.c,v 1.27 2008/10/15 06:51:17 wrstuden Exp $ */
/* $NetBSD: linux_syscall.c,v 1.28 2008/10/21 11:51:23 ad Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -89,7 +89,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.27 2008/10/15 06:51:17 wrstuden Exp $");
__KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.28 2008/10/21 11:51:23 ad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -103,7 +103,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.27 2008/10/15 06:51:17 wrstuden
#include <machine/cpu.h>
#include <machine/reg.h>
#include <machine/alpha.h>
#define SA_NO_USERRET
#include <machine/userret.h>
#include <compat/linux/common/linux_types.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: osf1_syscall.c,v 1.29 2008/10/15 06:51:17 wrstuden Exp $ */
/* $NetBSD: osf1_syscall.c,v 1.30 2008/10/21 11:51:23 ad Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -89,7 +89,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: osf1_syscall.c,v 1.29 2008/10/15 06:51:17 wrstuden Exp $");
__KERNEL_RCSID(0, "$NetBSD: osf1_syscall.c,v 1.30 2008/10/21 11:51:23 ad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -103,7 +103,6 @@ __KERNEL_RCSID(0, "$NetBSD: osf1_syscall.c,v 1.29 2008/10/15 06:51:17 wrstuden E
#include <machine/cpu.h>
#include <machine/reg.h>
#include <machine/alpha.h>
#define SA_NO_USERRET
#include <machine/userret.h>
#include <compat/osf1/osf1.h>

View File

@ -1,7 +1,7 @@
/* $NetBSD: linux32_syscall.c,v 1.25 2008/10/15 06:51:17 wrstuden Exp $ */
/* $NetBSD: linux32_syscall.c,v 1.26 2008/10/21 11:51:23 ad Exp $ */
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: linux32_syscall.c,v 1.25 2008/10/15 06:51:17 wrstuden Exp $");
__KERNEL_RCSID(0, "$NetBSD: linux32_syscall.c,v 1.26 2008/10/21 11:51:23 ad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -14,7 +14,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux32_syscall.c,v 1.25 2008/10/15 06:51:17 wrstude
#include <machine/cpu.h>
#include <machine/psl.h>
#define SA_NO_USERRET
#include <machine/userret.h>
#include <compat/linux32/linux32_syscall.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_syscall.c,v 1.27 2008/10/15 06:51:17 wrstuden Exp $ */
/* $NetBSD: linux_syscall.c,v 1.28 2008/10/21 11:51:23 ad Exp $ */
/*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.27 2008/10/15 06:51:17 wrstuden Exp $");
__KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.28 2008/10/21 11:51:23 ad Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_linux.h"
@ -47,7 +47,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.27 2008/10/15 06:51:17 wrstuden
#include <machine/cpu.h>
#include <machine/psl.h>
#define SA_NO_USERRET
#include <machine/userret.h>
#include <compat/linux/linux_syscall.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: freebsd_syscall.c,v 1.33 2008/10/15 06:51:17 wrstuden Exp $ */
/* $NetBSD: freebsd_syscall.c,v 1.34 2008/10/21 11:51:23 ad Exp $ */
/*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: freebsd_syscall.c,v 1.33 2008/10/15 06:51:17 wrstuden Exp $");
__KERNEL_RCSID(0, "$NetBSD: freebsd_syscall.c,v 1.34 2008/10/21 11:51:23 ad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -43,7 +43,6 @@ __KERNEL_RCSID(0, "$NetBSD: freebsd_syscall.c,v 1.33 2008/10/15 06:51:17 wrstude
#include <machine/cpu.h>
#include <machine/psl.h>
#define SA_NO_USERRET
#include <machine/userret.h>
#include <compat/sys/signal.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: ibcs2_syscall.c,v 1.42 2008/10/15 06:51:17 wrstuden Exp $ */
/* $NetBSD: ibcs2_syscall.c,v 1.43 2008/10/21 11:51:23 ad Exp $ */
/*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ibcs2_syscall.c,v 1.42 2008/10/15 06:51:17 wrstuden Exp $");
__KERNEL_RCSID(0, "$NetBSD: ibcs2_syscall.c,v 1.43 2008/10/21 11:51:23 ad Exp $");
#if defined(_KERNEL_OPT)
#include "opt_vm86.h"
@ -47,7 +47,6 @@ __KERNEL_RCSID(0, "$NetBSD: ibcs2_syscall.c,v 1.42 2008/10/15 06:51:17 wrstuden
#include <machine/cpu.h>
#include <machine/psl.h>
#define SA_NO_USERRET
#include <machine/userret.h>
#include <compat/ibcs2/ibcs2_errno.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_syscall.c,v 1.47 2008/10/15 06:51:17 wrstuden Exp $ */
/* $NetBSD: linux_syscall.c,v 1.48 2008/10/21 11:51:23 ad Exp $ */
/*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.47 2008/10/15 06:51:17 wrstuden Exp $");
__KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.48 2008/10/21 11:51:23 ad Exp $");
#if defined(_KERNEL_OPT)
#include "opt_vm86.h"
@ -47,7 +47,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.47 2008/10/15 06:51:17 wrstuden
#include <machine/cpu.h>
#include <machine/psl.h>
#define SA_NO_USERRET
#include <machine/userret.h>
#include <compat/linux/common/linux_types.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: mach_syscall.c,v 1.31 2008/10/15 06:51:17 wrstuden Exp $ */
/* $NetBSD: mach_syscall.c,v 1.32 2008/10/21 11:51:23 ad Exp $ */
/*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mach_syscall.c,v 1.31 2008/10/15 06:51:17 wrstuden Exp $");
__KERNEL_RCSID(0, "$NetBSD: mach_syscall.c,v 1.32 2008/10/21 11:51:23 ad Exp $");
#include "opt_vm86.h"
@ -45,7 +45,6 @@ __KERNEL_RCSID(0, "$NetBSD: mach_syscall.c,v 1.31 2008/10/15 06:51:17 wrstuden E
#include <machine/cpu.h>
#include <machine/psl.h>
#define SA_NO_USERRET
#include <machine/userret.h>
#include <compat/mach/mach_clock.h>
#include <compat/mach/mach_syscall.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_syscall.c,v 1.41 2008/10/15 06:51:17 wrstuden Exp $ */
/* $NetBSD: svr4_syscall.c,v 1.42 2008/10/21 11:51:23 ad Exp $ */
/*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: svr4_syscall.c,v 1.41 2008/10/15 06:51:17 wrstuden Exp $");
__KERNEL_RCSID(0, "$NetBSD: svr4_syscall.c,v 1.42 2008/10/21 11:51:23 ad Exp $");
#if defined(_KERNEL_OPT)
#include "opt_vm86.h"
@ -47,7 +47,6 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_syscall.c,v 1.41 2008/10/15 06:51:17 wrstuden E
#include <machine/cpu.h>
#include <machine/psl.h>
#define SA_NO_USERRET
#include <machine/userret.h>
#include <compat/svr4/svr4_errno.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_trap.c,v 1.6 2008/10/15 06:51:19 wrstuden Exp $ */
/* $NetBSD: linux_trap.c,v 1.7 2008/10/21 11:51:23 ad Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: linux_trap.c,v 1.6 2008/10/15 06:51:19 wrstuden Exp $");
__KERNEL_RCSID(0, "$NetBSD: linux_trap.c,v 1.7 2008/10/21 11:51:23 ad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -55,7 +55,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_trap.c,v 1.6 2008/10/15 06:51:19 wrstuden Exp
#include <machine/psl.h>
#include <machine/reg.h>
#include <machine/trap.h>
#define SA_NO_USERRET
#include <machine/userret.h>
#include <compat/linux/common/linux_exec.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_lwp.c,v 1.124 2008/10/15 06:51:20 wrstuden Exp $ */
/* $NetBSD: kern_lwp.c,v 1.125 2008/10/21 11:51:23 ad Exp $ */
/*-
* Copyright (c) 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@ -206,7 +206,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_lwp.c,v 1.124 2008/10/15 06:51:20 wrstuden Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_lwp.c,v 1.125 2008/10/21 11:51:23 ad Exp $");
#include "opt_ddb.h"
#include "opt_lockdebug.h"
@ -1240,6 +1240,14 @@ lwp_userret(struct lwp *l)
softint_overlay();
#endif
#ifdef KERN_SA
/* Generate UNBLOCKED upcall if needed */
if (l->l_flag & LW_SA_BLOCKING) {
sa_unblock_userret(l);
/* NOTREACHED */
}
#endif
/*
* It should be safe to do this read unlocked on a multiprocessor
* system..
@ -1307,6 +1315,11 @@ lwp_userret(struct lwp *l)
*/
if (p->p_timerpend)
timerupcall(l);
if (l->l_flag & LW_SA_UPCALL)
sa_upcall_userret(l);
else if (__predict_false((l->l_savp)
&& (l->l_savp->savp_pflags & SAVP_FLAG_NOUPCALLS)))
l->l_savp->savp_pflags &= ~SAVP_FLAG_NOUPCALLS;
#endif /* KERN_SA */
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: lwp.h,v 1.111 2008/10/16 08:52:20 ad Exp $ */
/* $NetBSD: lwp.h,v 1.112 2008/10/21 11:51:23 ad Exp $ */
/*-
* Copyright (c) 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@ -244,7 +244,7 @@ extern lwp_t lwp0; /* LWP for proc0 */
* user.
*/
#define LW_USERRET (LW_WEXIT|LW_PENDSIG|LW_WREBOOT|LW_WSUSPEND|LW_WCORE|\
LW_WUSERRET)
LW_WUSERRET|LW_SA_BLOCKING|LW_SA_UPCALL)
/*
* Status values.

View File

@ -1,4 +1,4 @@
/* $NetBSD: userret.h,v 1.18 2008/10/15 08:58:40 cegger Exp $ */
/* $NetBSD: userret.h,v 1.19 2008/10/21 11:51:23 ad Exp $ */
/*-
* Copyright (c) 1998, 2000, 2003, 2006, 2008 The NetBSD Foundation, Inc.
@ -68,12 +68,6 @@
#include <sys/lockdebug.h>
#include <sys/intr.h>
#if defined(_KERNEL_OPT)
#include "opt_sa.h"
#endif
#include <sys/savar.h>
/*
* Define the MI code needed before returning to user mode, for
* trap and syscall.
@ -88,18 +82,6 @@ mi_userret(struct lwp *l)
struct cpu_info *ci;
#endif
/*
* Skip either if SA_NO_USERRET defined or we're in the kernel and KERN_SA
* isn't defined.
*/
#if !defined(SA_NO_USERRET) && !(defined(_KERNEL_OPT) && !defined(KERN_SA))
/* Generate UNBLOCKED upcall if needed */
if (l->l_flag & LW_SA_BLOCKING) {
sa_unblock_userret(l);
/* NOTREACHED */
}
#endif
/*
* Handle "exceptional" events: pending signals, stop/exit actions,
* etc. Note that the event must be flagged BEFORE any AST is
@ -121,15 +103,6 @@ mi_userret(struct lwp *l)
ci->ci_schedstate.spc_curpriority = l->l_priority;
#endif
/* See comment above for logic */
#if !defined(SA_NO_USERRET) && !(defined(_KERNEL_OPT) && !defined(KERN_SA))
if (l->l_flag & LW_SA_UPCALL)
sa_upcall_userret(l);
else if (__predict_false((l->l_savp)
&& (l->l_savp->savp_pflags & SAVP_FLAG_NOUPCALLS)))
l->l_savp->savp_pflags &= ~SAVP_FLAG_NOUPCALLS;
#endif
LOCKDEBUG_BARRIER(NULL, 0);
KASSERT(l->l_nopreempt == 0);
}