summaryrefslogtreecommitdiff
path: root/sys/arch/mips64
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2011-07-07 18:11:25 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2011-07-07 18:11:25 +0000
commitf0dbc508cb2d1060a83c43da71f60ac4bab02188 (patch)
tree260e73ca64d22b10f4541858e6ee7fea0b7c1bff /sys/arch/mips64
parent291e013ccd4b9989e6d79d1ae219784a4a37894e (diff)
There is a bunch of places in the kernel entry points where we don't
hold the kernel lock, but still need call one function that needs it. Instead of grabbing the lock all over the place, move the locks into the affected functions: trapsignal, scdebug*, ktrsyscall, ktrsysret, systrace_redirect and ADDUPROF. In the cases we already hold the biglock we'll just recurse. kettenis@, beck@ ok
Diffstat (limited to 'sys/arch/mips64')
-rw-r--r--sys/arch/mips64/mips64/fp_emulate.c4
-rw-r--r--sys/arch/mips64/mips64/trap.c18
2 files changed, 2 insertions, 20 deletions
diff --git a/sys/arch/mips64/mips64/fp_emulate.c b/sys/arch/mips64/mips64/fp_emulate.c
index f23f883a3e2..8daad01d48c 100644
--- a/sys/arch/mips64/mips64/fp_emulate.c
+++ b/sys/arch/mips64/mips64/fp_emulate.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fp_emulate.c,v 1.4 2011/07/06 21:41:37 art Exp $ */
+/* $OpenBSD: fp_emulate.c,v 1.5 2011/07/07 18:11:24 art Exp $ */
/*
* Copyright (c) 2010 Miodrag Vallat.
@@ -385,9 +385,7 @@ deliver:
if (sig != SIGBUS && sig != SIGSEGV)
#endif
sv.sival_ptr = (void *)pc;
- KERNEL_LOCK();
trapsignal(p, sig, 0, fault_type, sv);
- KERNEL_UNLOCK();
}
}
diff --git a/sys/arch/mips64/mips64/trap.c b/sys/arch/mips64/mips64/trap.c
index d7fb139f748..88e2e89dad4 100644
--- a/sys/arch/mips64/mips64/trap.c
+++ b/sys/arch/mips64/mips64/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.74 2011/07/06 21:41:37 art Exp $ */
+/* $OpenBSD: trap.c,v 1.75 2011/07/07 18:11:24 art Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -166,9 +166,7 @@ ast()
p->p_md.md_astpending = 0;
if (p->p_flag & P_OWEUPC) {
- KERNEL_LOCK();
ADDUPROF(p);
- KERNEL_UNLOCK();
}
if (ci->ci_want_resched)
preempt(NULL);
@@ -498,15 +496,11 @@ printf("SIG-BUSB @%p pc %p, ra %p\n", trapframe->badvaddr, trapframe->pc, trapfr
}
}
#ifdef SYSCALL_DEBUG
- KERNEL_LOCK();
scdebug_call(p, code, args.i);
- KERNEL_UNLOCK();
#endif
#ifdef KTRACE
if (KTRPOINT(p, KTR_SYSCALL)) {
- KERNEL_LOCK();
ktrsyscall(p, code, callp->sy_argsize, args.i);
- KERNEL_UNLOCK();
}
#endif
rval[0] = 0;
@@ -518,9 +512,7 @@ printf("SIG-BUSB @%p pc %p, ra %p\n", trapframe->badvaddr, trapframe->pc, trapfr
#if NSYSTRACE > 0
if (ISSET(p->p_flag, P_SYSTRACE)) {
- KERNEL_LOCK();
i = systrace_redirect(code, p, args.i, rval);
- KERNEL_UNLOCK();
} else
#endif
{
@@ -550,15 +542,11 @@ printf("SIG-BUSB @%p pc %p, ra %p\n", trapframe->badvaddr, trapframe->pc, trapfr
locr0->a3 = 1;
}
#ifdef SYSCALL_DEBUG
- KERNEL_LOCK();
scdebug_ret(p, code, i, rval);
- KERNEL_UNLOCK();
#endif
#ifdef KTRACE
if (KTRPOINT(p, KTR_SYSRET)) {
- KERNEL_LOCK();
ktrsysret(p, code, i, rval[0]);
- KERNEL_UNLOCK();
}
#endif
goto out;
@@ -804,9 +792,7 @@ printf("SIG-BUSB @%p pc %p, ra %p\n", trapframe->badvaddr, trapframe->pc, trapfr
p->p_md.md_regs->cause = trapframe->cause;
p->p_md.md_regs->badvaddr = trapframe->badvaddr;
sv.sival_ptr = (void *)trapframe->badvaddr;
- KERNEL_LOCK();
trapsignal(p, i, ucode, typ, sv);
- KERNEL_UNLOCK();
out:
/*
* Note: we should only get here if returning to user mode.
@@ -832,12 +818,10 @@ child_return(arg)
#ifdef KTRACE
if (KTRPOINT(p, KTR_SYSRET)) {
- KERNEL_LOCK();
ktrsysret(p,
(p->p_flag & P_THREAD) ? SYS_rfork :
(p->p_p->ps_flags & PS_PPWAIT) ? SYS_vfork : SYS_fork,
0, 0);
- KERNEL_UNLOCK();
}
#endif
}