Date: Thu, 15 Mar 2007 12:12:56 -0500 From: Alan Cox <alc@cs.rice.edu> To: Oleksandr Tymoshenko <gonzo@FreeBSD.org> Cc: Perforce Change Reviews <perforce@FreeBSD.org> Subject: Re: PERFORCE change 115881 for review Message-ID: <45F97E98.7060106@cs.rice.edu> In-Reply-To: <200703142057.l2EKv05Y038529@repoman.freebsd.org> References: <200703142057.l2EKv05Y038529@repoman.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?45F97E98.7060106>