summaryrefslogtreecommitdiffstats
path: root/sys/powerpc
diff options
context:
space:
mode:
authorjake <jake@FreeBSD.org>2000-12-23 19:43:10 +0000
committerjake <jake@FreeBSD.org>2000-12-23 19:43:10 +0000
commitfa7a58ab48542df270919dc02881d5c4a2d4f344 (patch)
tree51c7f08e6064351afd60db7b45fcd14756284805 /sys/powerpc
parent974f411f61d6549db784519d520f6a33719e3f6c (diff)
downloadFreeBSD-src-fa7a58ab48542df270919dc02881d5c4a2d4f344.zip
FreeBSD-src-fa7a58ab48542df270919dc02881d5c4a2d4f344.tar.gz
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@
Diffstat (limited to 'sys/powerpc')
-rw-r--r--sys/powerpc/aim/vm_machdep.c12
-rw-r--r--sys/powerpc/powerpc/vm_machdep.c12
2 files changed, 24 insertions, 0 deletions
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");
OpenPOWER on IntegriCloud