From owner-p4-projects@FreeBSD.ORG Mon Feb 20 21:17:42 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6A30316A424; Mon, 20 Feb 2006 21:17:41 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4143016A422 for ; Mon, 20 Feb 2006 21:17:41 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id AB67443D62 for ; Mon, 20 Feb 2006 21:17:40 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k1KLHe1v058369 for ; Mon, 20 Feb 2006 21:17:40 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k1KLHeZs058363 for perforce@freebsd.org; Mon, 20 Feb 2006 21:17:40 GMT (envelope-from jhb@freebsd.org) Date: Mon, 20 Feb 2006 21:17:40 GMT Message-Id: <200602202117.k1KLHeZs058363@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Cc: Subject: PERFORCE change 92094 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Feb 2006 21:17:42 -0000 http://perforce.freebsd.org/chv.cgi?CH=92094 Change 92094 by jhb@jhb_slimer on 2006/02/20 21:16:54 ptrace_clear_single_step() needs callers to hold the proc lock and PHOLD/PRELE. Affected files ... .. //depot/projects/smpng/sys/alpha/alpha/trap.c#63 edit .. //depot/projects/smpng/sys/alpha/include/ptrace.h#9 edit .. //depot/projects/smpng/sys/arm/arm/undefined.c#10 edit .. //depot/projects/smpng/sys/kern/kern_kse.c#29 edit Differences ... ==== //depot/projects/smpng/sys/alpha/alpha/trap.c#63 (text+ko) ==== @@ -405,8 +405,12 @@ case ALPHA_IF_CODE_BUGCHK: if (td->td_md.md_flags & (MDTD_STEP1|MDTD_STEP2)) { mtx_lock(&Giant); + PROC_LOCK(p); + _PHOLD(p); ptrace_clear_single_step(td); td->td_frame->tf_regs[FRAME_PC] -= 4; + _PRELE(p); + PROC_UNLOCK(p); mtx_unlock(&Giant); } ucode = a0; /* trap type */ ==== //depot/projects/smpng/sys/alpha/include/ptrace.h#9 (text+ko) ==== @@ -34,7 +34,11 @@ #define _MACHINE_PTRACE_H_ #ifdef _KERNEL -#define FIX_SSTEP(p) ptrace_clear_single_step(p) +#define FIX_SSTEP(p) do { \ + _PHOLD((p)); \ + ptrace_clear_single_step((p)); \ + _PRELE((p)); \ +} while (0) #endif #endif ==== //depot/projects/smpng/sys/arm/arm/undefined.c#10 (text+ko) ==== @@ -261,7 +261,11 @@ break; if (fault_code & FAULT_USER && fault_instruction == PTRACE_BREAKPOINT) { + PROC_LOCK(td->td_proc); + _PHOLD(td->td_proc); ptrace_clear_single_step(td); + _PRELE(td->td_proc); + PROC_UNLOCK(td->td_proc); return; } ==== //depot/projects/smpng/sys/kern/kern_kse.c#29 (text+ko) ==== @@ -787,8 +787,13 @@ */ cpu_set_upcall_kse(newtd, newku->ku_func, newku->ku_mailbox, &newku->ku_stack); - if (p->p_flag & P_TRACED) + PROC_LOCK(p); + if (p->p_flag & P_TRACED) { + _PHOLD(p); ptrace_clear_single_step(newtd); + _PRELE(p); + } + PROC_UNLOCK(p); } } @@ -1381,8 +1386,13 @@ if (!(ku->ku_mflags & KMF_NOUPCALL)) { cpu_set_upcall_kse(td, ku->ku_func, ku->ku_mailbox, &ku->ku_stack); - if (p->p_flag & P_TRACED) + PROC_LOCK(p); + if (p->p_flag & P_TRACED) { + _PHOLD(p); ptrace_clear_single_step(td); + _PRELE(p); + } + PROC_UNLOCK(p); error = suword32(&ku->ku_mailbox->km_lwp, td->td_tid); if (error)