Date: Sat, 26 Jan 2008 07:26:39 GMT From: Kip Macy <kmacy@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 134123 for review Message-ID: <200801260726.m0Q7QdRR046975@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=134123 Change 134123 by kmacy@pandemonium:kmacy:xen31 on 2008/01/26 07:26:23 fix pmap_enter_quick routines to ensure that they don't submit garbage Affected files ... .. //depot/projects/xen31/sys/i386/xen/pmap.c#34 edit Differences ... ==== //depot/projects/xen31/sys/i386/xen/pmap.c#34 (text+ko) ==== @@ -272,7 +272,7 @@ static void free_pv_entry(pmap_t pmap, pv_entry_t pv); static pv_entry_t get_pv_entry(pmap_t locked_pmap, int try); -static vm_page_t pmap_enter_quick_locked(multicall_entry_t *mcl, pmap_t pmap, vm_offset_t va, +static vm_page_t pmap_enter_quick_locked(multicall_entry_t **mcl, int *count, pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, vm_page_t mpte); static int pmap_remove_pte(pmap_t pmap, pt_entry_t *ptq, vm_offset_t sva, vm_page_t *free); @@ -2755,11 +2755,9 @@ m = m_start; PMAP_LOCK(pmap); while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) { - mpte = pmap_enter_quick_locked(mclp, pmap, start + ptoa(diff), m, + mpte = pmap_enter_quick_locked(&mclp, &count, pmap, start + ptoa(diff), m, prot, mpte); m = TAILQ_NEXT(m, listq); - mclp++; - count++; if (count == 16) { HYPERVISOR_multicall(mcl, count); mclp = mcl; @@ -2783,11 +2781,14 @@ void pmap_enter_quick(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot) { - multicall_entry_t mcl; + multicall_entry_t mcl, *mclp; + int count = 0; + mclp = &mcl; PMAP_LOCK(pmap); - (void) pmap_enter_quick_locked(&mcl, pmap, va, m, prot, NULL); - HYPERVISOR_multicall(&mcl, 1); + (void) pmap_enter_quick_locked(&mclp, &count, pmap, va, m, prot, NULL); + if (count) + HYPERVISOR_multicall(&mcl, count); PMAP_UNLOCK(pmap); } @@ -2803,9 +2804,7 @@ if (!pmap_is_prefaultable_locked(pmap, *addrs)) continue; - (void) pmap_enter_quick_locked(mclp, pmap, *addrs, *pages, *prots, NULL); - index++; - mclp++; + (void) pmap_enter_quick_locked(&mclp, &index, pmap, *addrs, *pages, *prots, NULL); if (index == 16) { HYPERVISOR_multicall(mcl, count); mclp = mcl; @@ -2818,13 +2817,14 @@ } static vm_page_t -pmap_enter_quick_locked(multicall_entry_t *mcl, pmap_t pmap, vm_offset_t va, vm_page_t m, +pmap_enter_quick_locked(multicall_entry_t **mclpp, int *count, pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, vm_page_t mpte) { pt_entry_t *pte; vm_paddr_t pa; vm_page_t free; - + multicall_entry_t *mcl = *mclpp; + KASSERT(va < kmi.clean_sva || va >= kmi.clean_eva || (m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0, ("pmap_enter_quick_locked: managed mapping within the clean submap")); @@ -2936,6 +2936,8 @@ mcl->args[1] = (uint32_t)(pa & 0xffffffff); mcl->args[2] = (uint32_t)(pa >> 32); mcl->args[3] = 0; + *mclpp = mcl + 1; + *count = *count + 1; #endif return mpte; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200801260726.m0Q7QdRR046975>