diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2014-01-28 20:23:37 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2014-01-28 20:23:37 +0000 |
commit | 71096d6b0b4c0acb28ee803977a7874c0c5068d8 (patch) | |
tree | 5b82d87b9808ce81c5d047ed16b2594d075a49c8 /sys/arch/alpha | |
parent | 191a096fd48f4ff64a7c98c3b1e8fc245a683dbd (diff) |
In cpu_fork(), make sure to set the IPL of the new process to IPL_IPI on
MULTIPROCESSOR kernels, instead of IPL_NONE; they need to be ipi-safe until
proc_trampoline_mp() runs, which will also take care of lowering the ipl
to IPL_NONE.
One less race in the MP kernel, unfortunately a few more to go...
Diffstat (limited to 'sys/arch/alpha')
-rw-r--r-- | sys/arch/alpha/alpha/vm_machdep.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/sys/arch/alpha/alpha/vm_machdep.c b/sys/arch/alpha/alpha/vm_machdep.c index 1b700e07999..6514d6bad19 100644 --- a/sys/arch/alpha/alpha/vm_machdep.c +++ b/sys/arch/alpha/alpha/vm_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vm_machdep.c,v 1.39 2013/01/16 19:04:43 miod Exp $ */ +/* $OpenBSD: vm_machdep.c,v 1.40 2014/01/28 20:23:36 miod Exp $ */ /* $NetBSD: vm_machdep.c,v 1.55 2000/03/29 03:49:48 simonb Exp $ */ /* @@ -107,7 +107,7 @@ cpu_exit(p) /* * Deactivate the exiting address space before the vmspace * is freed. Note that we will continue to run on this - * vmspace's context until the switch to proc0 in switch_exit(). + * vmspace's context until the switch to idle in switch_exit(). */ pmap_deactivate(p); sched_exit(p); @@ -201,8 +201,7 @@ cpu_fork(p1, p2, stack, stacksize, func, arg) */ p2tf = p2->p_md.md_tf = (struct trapframe *) ((char *)p2->p_addr + USPACE - sizeof(struct trapframe)); - bcopy(p1->p_md.md_tf, p2->p_md.md_tf, - sizeof(struct trapframe)); + bcopy(p1->p_md.md_tf, p2->p_md.md_tf, sizeof(struct trapframe)); /* * Set up return-value registers as fork() libc stub expects. @@ -223,7 +222,13 @@ cpu_fork(p1, p2, stack, stacksize, func, arg) up->u_pcb.pcb_context[2] = (u_int64_t)arg; up->u_pcb.pcb_context[7] = (u_int64_t)switch_trampoline; /* ra: assembly magic */ - up->u_pcb.pcb_context[8] = ALPHA_PSL_IPL_0; /* ps: IPL */ +#ifdef MULTIPROCESSOR + up->u_pcb.pcb_context[8] = + ALPHA_PSL_IPL_HIGH; /* ps: IPL */ +#else + up->u_pcb.pcb_context[8] = + ALPHA_PSL_IPL_0; /* ps: IPL */ +#endif } } |