From owner-p4-projects@FreeBSD.ORG Thu Mar 15 17:31:57 2007 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 7D60E16A405; Thu, 15 Mar 2007 17:31:57 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 35DC816A402; Thu, 15 Mar 2007 17:31:57 +0000 (UTC) (envelope-from alc@cs.rice.edu) Received: from mail.cs.rice.edu (mail.cs.rice.edu [128.42.1.31]) by mx1.freebsd.org (Postfix) with ESMTP id 05FC813C54F; Thu, 15 Mar 2007 17:31:56 +0000 (UTC) (envelope-from alc@cs.rice.edu) Received: from mail.cs.rice.edu (localhost.localdomain [127.0.0.1]) by mail.cs.rice.edu (Postfix) with ESMTP id 6442F2C2A8D; Thu, 15 Mar 2007 12:12:58 -0500 (CDT) X-Virus-Scanned: by amavis-2.4.0 at mail.cs.rice.edu Received: from mail.cs.rice.edu ([127.0.0.1]) by mail.cs.rice.edu (mail.cs.rice.edu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 8SWXzFclkkcv; Thu, 15 Mar 2007 12:12:57 -0500 (CDT) Received: from [216.63.78.18] (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.cs.rice.edu (Postfix) with ESMTP id A6DD42C2A82; Thu, 15 Mar 2007 12:12:57 -0500 (CDT) Message-ID: <45F97E98.7060106@cs.rice.edu> Date: Thu, 15 Mar 2007 12:12:56 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.13) Gecko/20061115 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Oleksandr Tymoshenko References: <200703142057.l2EKv05Y038529@repoman.freebsd.org> In-Reply-To: <200703142057.l2EKv05Y038529@repoman.freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Perforce Change Reviews Subject: Re: PERFORCE change 115881 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: Thu, 15 Mar 2007 17:31:57 -0000 Oleksandr Tymoshenko wrote: >http://perforce.freebsd.org/chv.cgi?CH=115881 > >Change 115881 by gonzo@gonzo_jeeves on 2007/03/14 20:56:39 > > o vm_fault_prefault calls pmap_enter with corespondent entry > protection, so if we're prefaulting R/W region with COW > all pages except faulting one are mapped with R/W permissions i > and therefore fail to perform COW operation. This issue is to > be investigated, meanwhile work it around with disabling prefault > for MIPS at all. > o Some spellchecking stuff. > >Affected files ... > >.. //depot/projects/mips2/src/sys/mips/mips/pmap.c#21 edit > >Differences ... > >==== //depot/projects/mips2/src/sys/mips/mips/pmap.c#21 (text+ko) ==== > >@@ -1657,18 +1657,17 @@ > /* > * pmap_is_prefaultable: > * >- * Return whether or not the specified virtual address is elgible >+ * Return whether or not the specified virtual address is eligible > * for prefault. > */ > boolean_t > pmap_is_prefaultable(pmap_t pmap, vm_offset_t va) > { >- pt_entry_t *pte; >- >- pte = pmap_pte(pmap, va); >- if (pte_valid(pte)) >- return (FALSE); >- return (TRUE); >+ /* >+ * XXX: prefault causes bugs with COW, so let's stick >+ * with all pages not eligible to prefault. >+ */ >+ return (FALSE); > } > > /* > > vm_fault_prefault() calls pmap_enter_quick(), not pmap_enter(). However, some implementations of pmap_enter_quick() are little more than a call to pmap_enter(). These implementations remove write access from the allowed access permissions. The sparc64 implementation below is representative: void pmap_enter_quick(pmap_t pm, vm_offset_t va, vm_page_t m, vm_prot_t prot) { PMAP_LOCK(pm); pmap_enter_locked(pm, va, m, prot & (VM_PROT_READ | VM_PROT_EXECUTE), FALSE); PMAP_UNLOCK(pm); } Regards, Alan