From fa7a58ab48542df270919dc02881d5c4a2d4f344 Mon Sep 17 00:00:00 2001 From: jake Date: Sat, 23 Dec 2000 19:43:10 +0000 Subject: Protect proc.p_pptr and proc.p_children/p_sibling with the proctree_lock. linprocfs not locked pending response from informal maintainer. Reviewed by: jhb, -smp@ --- sys/powerpc/aim/vm_machdep.c | 12 ++++++++++++ sys/powerpc/powerpc/vm_machdep.c | 12 ++++++++++++ 2 files changed, 24 insertions(+) (limited to 'sys/powerpc') diff --git a/sys/powerpc/aim/vm_machdep.c b/sys/powerpc/aim/vm_machdep.c index ba5004d..c60f971 100644 --- a/sys/powerpc/aim/vm_machdep.c +++ b/sys/powerpc/aim/vm_machdep.c @@ -256,6 +256,18 @@ cpu_exit(p) mtx_enter(&sched_lock, MTX_SPIN); mtx_exit(&Giant, MTX_DEF | MTX_NOSWITCH); mtx_assert(&Giant, MA_NOTOWNED); + + /* + * We have to wait until after releasing all locks before + * changing p_stat. If we block on a mutex then we will be + * back at SRUN when we resume and our parent will never + * harvest us. + */ + p->p_stat = SZOMB; + + mp_fixme("assumption: p_pptr won't change at this time"); + wakeup(p->p_pptr); + cnt.v_swtch++; cpu_switch(); panic("cpu_exit"); diff --git a/sys/powerpc/powerpc/vm_machdep.c b/sys/powerpc/powerpc/vm_machdep.c index ba5004d..c60f971 100644 --- a/sys/powerpc/powerpc/vm_machdep.c +++ b/sys/powerpc/powerpc/vm_machdep.c @@ -256,6 +256,18 @@ cpu_exit(p) mtx_enter(&sched_lock, MTX_SPIN); mtx_exit(&Giant, MTX_DEF | MTX_NOSWITCH); mtx_assert(&Giant, MA_NOTOWNED); + + /* + * We have to wait until after releasing all locks before + * changing p_stat. If we block on a mutex then we will be + * back at SRUN when we resume and our parent will never + * harvest us. + */ + p->p_stat = SZOMB; + + mp_fixme("assumption: p_pptr won't change at this time"); + wakeup(p->p_pptr); + cnt.v_swtch++; cpu_switch(); panic("cpu_exit"); -- cgit v1.1