Date: Sat, 11 Mar 2006 22:55:38 GMT From: Kip Macy <kmacy@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 93175 for review Message-ID: <200603112255.k2BMtcB5042609@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=93175 Change 93175 by kmacy@kmacy_storage:sun4v_work on 2006/03/11 22:55:12 pmap_enter_quick was not setting the TTE flags correctly Affected files ... .. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/pmap.c#22 edit Differences ... ==== //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/pmap.c#22 (text+ko) ==== @@ -702,8 +702,9 @@ vm_page_t om; int invlva; #if 0 - printf("ctx=%d va=%lx prot=%x wired=%x\n", pmap->pm_context, - va, prot, wired); + if (pmap->pm_context) + printf("ctx=%d va=%lx prot=%x wired=%x\n", (int)pmap->pm_context, + va, prot, wired); #endif om = NULL; @@ -779,6 +780,7 @@ tte_data |= VTD_X; if (wired) tte_data |= VTD_WIRED; + if (pmap == kernel_pmap) tte_data |= TTE_KERNEL_MINFLAGS; else @@ -804,7 +806,6 @@ if (invlva) pmap_invalidate_page(pmap, va); } else { - tsb_set_tte(&pmap->pm_tsb, va, tte_data, pmap->pm_context); tte_hash_insert(pmap->pm_hash, va, tte_data); } } @@ -821,11 +822,13 @@ pmap_enter_quick(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, vm_page_t mpte) { - uint64_t pa; + + uint64_t tte_data; mtx_assert(&vm_page_queue_mtx, MA_OWNED); VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); PMAP_LOCK(pmap); + /* * Enter on the PV list if part of our managed memory. Note that we * raise IPL while manipulating pv_table since pmap_enter can be @@ -836,12 +839,22 @@ pmap->pm_stats.resident_count++; - pa = VM_PAGE_TO_PHYS(m); + tte_data = VM_PAGE_TO_PHYS(m); + + if ((prot & VM_PROT_WRITE) != 0) + tte_data |= VTD_SW_W; + if ((prot & VM_PROT_EXECUTE) != 0) + tte_data |= VTD_X; + + if (pmap == kernel_pmap) + tte_data |= TTE_KERNEL_MINFLAGS; + else + tte_data |= TTE_MINFLAGS; - if (m->flags & (PG_FICTITIOUS|PG_UNMANAGED)) - pa |= VTD_MANAGED; + if (!(m->flags & (PG_FICTITIOUS|PG_UNMANAGED))) + tte_data |= VTD_MANAGED; - tte_hash_insert(pmap->pm_hash, va, pa | TTE_MINFLAGS); + tte_hash_insert(pmap->pm_hash, va, tte_data | TTE_MINFLAGS); PMAP_UNLOCK(pmap); @@ -1014,6 +1027,8 @@ void pmap_kenter(vm_offset_t va, vm_paddr_t pa) { + tsb_set_tte(&kernel_pmap->pm_tsb, va, pa | TTE_KERNEL | VTD_8K, + kernel_pmap->pm_context); tte_hash_insert(kernel_pmap->pm_hash, va, pa | TTE_KERNEL | VTD_8K); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200603112255.k2BMtcB5042609>