From owner-freebsd-ia64@FreeBSD.ORG Fri Jul 8 15:08:02 2005 Return-Path: X-Original-To: ia64@FreeBSD.org Delivered-To: freebsd-ia64@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 696C516A41C for ; Fri, 8 Jul 2005 15:08:02 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: from mv.twc.weather.com (mv.twc.weather.com [65.212.71.225]) by mx1.FreeBSD.org (Postfix) with ESMTP id 12C7043D45 for ; Fri, 8 Jul 2005 15:08:01 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: from [10.50.40.201] (Not Verified[65.202.103.25]) by mv.twc.weather.com with NetIQ MailMarshal (v6, 0, 3, 8) id ; Fri, 08 Jul 2005 11:21:54 -0400 From: John Baldwin To: ia64@FreeBSD.org Date: Fri, 8 Jul 2005 10:59:19 -0400 User-Agent: KMail/1.8 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200507081059.19769.jhb@FreeBSD.org> Cc: Subject: Lock Giant around freebsd32_mmap hack X-BeenThere: freebsd-ia64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the IA-64 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jul 2005 15:08:02 -0000 Can someone test this patch or at least sign off on it? Thanks! --- //depot/projects/smpng/sys/compat/freebsd32/freebsd32_misc.c 2005/07/07 19:45:15 +++ //depot/user/jhb/proc/compat/freebsd32/freebsd32_misc.c 2005/07/07 21:21:45 @@ -397,6 +396,7 @@ start = addr; end = addr + len; + mtx_lock(&Giant); if (start != trunc_page(start)) { error = freebsd32_mmap_partial(td, start, round_page(start), prot, @@ -427,11 +427,14 @@ prot |= VM_PROT_WRITE; map = &td->td_proc->p_vmspace->vm_map; rv = vm_map_remove(map, start, end); - if (rv != KERN_SUCCESS) + if (rv != KERN_SUCCESS) { + mtx_unlock(&Giant); return (EINVAL); + } rv = vm_map_find(map, 0, 0, &start, end - start, FALSE, prot, VM_PROT_ALL, 0); + mtx_unlock(&Giant); if (rv != KERN_SUCCESS) return (EINVAL); r.fd = fd; @@ -445,6 +448,7 @@ td->td_retval[0] = addr; return (0); } + mtx_unlock(&Giant); if (end == start) { /* * After dealing with the ragged ends, there -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org