Lines Matching refs:seg
102 static int segvn_dup(struct seg *seg, struct seg *newseg);
103 static int segvn_unmap(struct seg *seg, caddr_t addr, size_t len);
104 static void segvn_free(struct seg *seg);
105 static faultcode_t segvn_fault(struct hat *hat, struct seg *seg,
108 static faultcode_t segvn_faulta(struct seg *seg, caddr_t addr);
109 static int segvn_setprot(struct seg *seg, caddr_t addr,
111 static int segvn_checkprot(struct seg *seg, caddr_t addr,
113 static int segvn_kluster(struct seg *seg, caddr_t addr, ssize_t delta);
114 static size_t segvn_swapout(struct seg *seg);
115 static int segvn_sync(struct seg *seg, caddr_t addr, size_t len,
117 static size_t segvn_incore(struct seg *seg, caddr_t addr, size_t len,
119 static int segvn_lockop(struct seg *seg, caddr_t addr, size_t len,
121 static int segvn_getprot(struct seg *seg, caddr_t addr, size_t len,
123 static u_offset_t segvn_getoffset(struct seg *seg, caddr_t addr);
124 static int segvn_gettype(struct seg *seg, caddr_t addr);
125 static int segvn_getvp(struct seg *seg, caddr_t addr,
127 static int segvn_advise(struct seg *seg, caddr_t addr, size_t len,
129 static void segvn_dump(struct seg *seg);
130 static int segvn_pagelock(struct seg *seg, caddr_t addr, size_t len,
132 static int segvn_setpagesize(struct seg *seg, caddr_t addr, size_t len,
134 static int segvn_getmemid(struct seg *seg, caddr_t addr,
136 static lgrp_mem_policy_info_t *segvn_getpolicy(struct seg *, caddr_t);
137 static int segvn_capable(struct seg *seg, segcapability_t capable);
138 static int segvn_inherit(struct seg *, caddr_t, size_t, uint_t);
192 static int segvn_concat(struct seg *, struct seg *, int);
193 static int segvn_extend_prev(struct seg *, struct seg *,
195 static int segvn_extend_next(struct seg *, struct seg *,
197 static void segvn_softunlock(struct seg *, caddr_t, size_t, enum seg_rw);
204 static faultcode_t segvn_fault_vnodepages(struct hat *, struct seg *, caddr_t,
206 static faultcode_t segvn_fault_anonpages(struct hat *, struct seg *, caddr_t,
208 static faultcode_t segvn_faultpage(struct hat *, struct seg *, caddr_t,
211 static void segvn_vpage(struct seg *);
212 static size_t segvn_count_swap_by_vpages(struct seg *);
214 static void segvn_purge(struct seg *seg);
220 static int sameprot(struct seg *, caddr_t, size_t);
222 static int segvn_demote_range(struct seg *, caddr_t, size_t, int, uint_t);
223 static int segvn_clrszc(struct seg *);
224 static struct seg *segvn_split_seg(struct seg *, caddr_t);
225 static int segvn_claim_pages(struct seg *, struct vpage *, u_offset_t,
249 #define CALC_LPG_REGION(pgsz, seg, addr, len, lpgaddr, lpgeaddr) { \ argument
252 ASSERT(lpgaddr >= (seg)->s_base); \
256 ASSERT(lpgeaddr <= (seg)->s_base + (seg)->s_size); \
397 static void segvn_textrepl(struct seg *);
398 static void segvn_textunrepl(struct seg *, int);
403 static void segvn_trupdate_seg(struct seg *, segvn_data_t *, svntr_t *,
541 segvn_create(struct seg *seg, void *argsp) in segvn_create() argument
554 ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as)); in segvn_create()
583 (a->flags & MAP_NORESERVE) || seg->s_as == &kas) { in segvn_create()
589 if (!IS_P2ALIGNED(seg->s_base, pgsz) || in segvn_create()
590 !IS_P2ALIGNED(seg->s_size, pgsz)) { in segvn_create()
600 } else if (map_addr_vacalign_check(seg->s_base, in segvn_create()
619 if (anon_resv_zone(seg->s_size, in segvn_create()
620 seg->s_as->a_proc->p_zone) == 0) in segvn_create()
622 swresv = seg->s_size; in segvn_create()
624 seg, swresv, 1); in segvn_create()
634 hat_map(seg->s_as->a_hat, seg->s_base, seg->s_size, HAT_MAP); in segvn_create()
647 seg->s_as, seg->s_base, seg->s_size, a->prot, in segvn_create()
652 seg->s_as->a_proc->p_zone); in segvn_create()
654 "anon proc:%p %lu %u", seg, swresv, 0); in segvn_create()
658 hat_unload(seg->s_as->a_hat, seg->s_base, in segvn_create()
659 seg->s_size, HAT_UNLOAD_UNMAP); in segvn_create()
667 (seg->s_size > textrepl_size_thresh || in segvn_create()
672 seg->s_as != &kas && a->vp->v_type == VREG); in segvn_create()
683 seg->s_as->a_resvsize -= seg->s_size; in segvn_create()
693 struct seg *pseg, *nseg; in segvn_create()
704 !(a->flags & MAP_NORESERVE) && (seg->s_as != &kas)) { in segvn_create()
710 mpolicy = lgrp_mem_policy_default(seg->s_size, a->type); in segvn_create()
716 pseg = AS_SEGPREV(seg->s_as, seg); in segvn_create()
718 pseg->s_base + pseg->s_size == seg->s_base && in segvn_create()
736 pseg->s_size + seg->s_size, in segvn_create()
742 (pseg->s_size + seg->s_size <= in segvn_create()
744 segvn_extend_prev(pseg, seg, a, swresv) == 0) { in segvn_create()
768 nseg = AS_SEGNEXT(seg->s_as, seg); in segvn_create()
770 seg->s_base + seg->s_size == nseg->s_base && in segvn_create()
788 nseg->s_size + seg->s_size, in segvn_create()
794 segvn_extend_next(seg, nseg, a, swresv) == 0) { in segvn_create()
812 seg->s_ops = &segvn_ops; in segvn_create()
813 seg->s_data = (void *)svd; in segvn_create()
814 seg->s_szc = a->szc; in segvn_create()
816 svd->seg = seg; in segvn_create()
860 svd->amp = anonmap_alloc(seg->s_size, swresv, in segvn_create()
862 svd->amp->a_szc = seg->s_szc; in segvn_create()
884 if ((amp->size - a->offset) < seg->s_size) { in segvn_create()
923 svd->amp = anonmap_alloc(seg->s_size, 0, ANON_SLEEP); in segvn_create()
924 svd->amp->a_szc = seg->s_szc; in segvn_create()
933 eaddr = seg->s_base + seg->s_size; in segvn_create()
935 for (anon_idx = anon_num, addr = seg->s_base; in segvn_create()
948 pp = anon_zero(seg, addr, &ap, cred); in segvn_create()
963 ASSERT(seg->s_szc == 0); in segvn_create()
967 hat_memload(seg->s_as->a_hat, addr, pp, in segvn_create()
972 ASSERT(seg->s_szc == 0); in segvn_create()
974 0, seg->s_size); in segvn_create()
985 (void) lgrp_privm_policy_set(mpolicy, &svd->policy_info, seg->s_size); in segvn_create()
989 svd->vp, svd->offset, seg->s_size); in segvn_create()
994 svd->rcookie = hat_join_region(seg->s_as->a_hat, seg->s_base, in segvn_create()
995 seg->s_size, (void *)svd->vp, svd->offset, svd->prot, in segvn_create()
996 (uchar_t)seg->s_szc, segvn_hat_rgn_unload_callback, in segvn_create()
1013 segvn_concat(struct seg *seg1, struct seg *seg2, int amp_cat) in segvn_concat()
1257 struct seg *seg1, *seg2; in segvn_extend_prev()
1377 struct seg *seg1, in segvn_extend_next()
1378 struct seg *seg2, in segvn_extend_next()
1499 segvn_dup_pages(struct seg *seg, struct seg *newseg) in segvn_dup_pages() argument
1508 struct segvn_data *svd = (struct segvn_data *)seg->s_data; in segvn_dup_pages()
1513 i = btopr(seg->s_size); in segvn_dup_pages()
1514 addr = seg->s_base; in segvn_dup_pages()
1525 vpp = &svd->vpage[seg_page(seg, addr)]; in segvn_dup_pages()
1546 PAGESIZE, seg, addr, S_READ, svd->cred); in segvn_dup_pages()
1569 segvn_dup(struct seg *seg, struct seg *newseg) in segvn_dup() argument
1571 struct segvn_data *svd = (struct segvn_data *)seg->s_data; in segvn_dup()
1573 pgcnt_t npages = seg_pages(seg); in segvn_dup()
1578 ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as)); in segvn_dup()
1594 seg, len, 0); in segvn_dup()
1601 newseg->s_szc = seg->s_szc; in segvn_dup()
1603 newsvd->seg = newseg; in segvn_dup()
1710 segvn_purge(seg); in segvn_dup()
1715 error = segvn_dup_pages(seg, newseg); in segvn_dup()
1721 if (seg->s_szc != 0) { in segvn_dup()
1731 0, seg->s_size, seg->s_szc, in segvn_dup()
1735 newsvd->amp->ahp, 0, seg->s_size); in segvn_dup()
1738 hat_clrattr(seg->s_as->a_hat, seg->s_base, in segvn_dup()
1739 seg->s_size, PROT_WRITE); in segvn_dup()
1815 struct seg *seg = cb->hcb_data; in segvn_hat_unload_callback() local
1816 struct segvn_data *svd = (struct segvn_data *)seg->s_data; in segvn_hat_unload_callback()
1822 ASSERT(cb->hcb_start_addr >= seg->s_base); in segvn_hat_unload_callback()
1825 off = cb->hcb_start_addr - seg->s_base; in segvn_hat_unload_callback()
1835 segvn_count_swap_by_vpages(struct seg *seg) in segvn_count_swap_by_vpages() argument
1837 struct segvn_data *svd = (struct segvn_data *)seg->s_data; in segvn_count_swap_by_vpages()
1844 evp = &svd->vpage[seg_page(seg, seg->s_base + seg->s_size)]; in segvn_count_swap_by_vpages()
1855 segvn_unmap(struct seg *seg, caddr_t addr, size_t len) in segvn_unmap() argument
1857 struct segvn_data *svd = (struct segvn_data *)seg->s_data; in segvn_unmap()
1859 struct seg *nseg; in segvn_unmap()
1875 ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as)); in segvn_unmap()
1899 segvn_purge(seg); in segvn_unmap()
1909 if (addr < seg->s_base || addr + len > seg->s_base + seg->s_size || in segvn_unmap()
1915 if (seg->s_szc != 0) { in segvn_unmap()
1916 size_t pgsz = page_get_pagesize(seg->s_szc); in segvn_unmap()
1919 ASSERT(seg->s_base != addr || seg->s_size != len); in segvn_unmap()
1923 hat_leave_region(seg->s_as->a_hat, in segvn_unmap()
1936 segvn_textunrepl(seg, 1); in segvn_unmap()
1941 err = segvn_demote_range(seg, addr, len, SDR_END, 0); in segvn_unmap()
1954 (offset_t)svd->offset + (uintptr_t)(addr - seg->s_base), in segvn_unmap()
1955 seg->s_as, addr, len, svd->prot, svd->maxprot, in segvn_unmap()
1968 (void) segvn_lockop(seg, addr, len, 0, MC_UNLOCK, NULL, 0); in segvn_unmap()
1975 hat_leave_region(seg->s_as->a_hat, svd->rcookie, in segvn_unmap()
1981 segvn_textunrepl(seg, 1); in segvn_unmap()
1993 callback.hcb_data = seg; in segvn_unmap()
1997 hat_unload_callback(seg->s_as->a_hat, addr, len, in segvn_unmap()
2010 if (addr == seg->s_base && len == seg->s_size) { in segvn_unmap()
2011 seg_free(seg); in segvn_unmap()
2015 opages = seg_pages(seg); in segvn_unmap()
2019 ASSERT(amp == NULL || amp->a_szc >= seg->s_szc); in segvn_unmap()
2024 if (addr == seg->s_base) { in segvn_unmap()
2054 if (amp->a_szc == seg->s_szc) { in segvn_unmap()
2055 if (seg->s_szc != 0) { in segvn_unmap()
2058 seg->s_szc); in segvn_unmap()
2066 ASSERT(amp->a_szc > seg->s_szc); in segvn_unmap()
2078 seg->s_as->a_proc->p_zone); in segvn_unmap()
2088 seg->s_base += len; in segvn_unmap()
2089 seg->s_size -= len; in segvn_unmap()
2099 seg->s_as->a_proc->p_zone); in segvn_unmap()
2100 if (SEG_IS_PARTIAL_RESV(seg)) in segvn_unmap()
2101 seg->s_as->a_resvsize -= oswresv - in segvn_unmap()
2109 segvn_count_swap_by_vpages(seg); in segvn_unmap()
2114 ASSERT(svd->swresv == seg->s_size); in segvn_unmap()
2118 seg->s_as->a_proc->p_zone); in segvn_unmap()
2121 seg, len, 0); in segvn_unmap()
2130 if (addr + len == seg->s_base + seg->s_size) { in segvn_unmap()
2164 if (amp->a_szc == seg->s_szc) { in segvn_unmap()
2165 if (seg->s_szc != 0) { in segvn_unmap()
2168 seg->s_szc); in segvn_unmap()
2175 ASSERT(amp->a_szc > seg->s_szc); in segvn_unmap()
2187 seg->s_as->a_proc->p_zone); in segvn_unmap()
2194 seg->s_size -= len; in segvn_unmap()
2203 seg->s_as->a_proc->p_zone); in segvn_unmap()
2204 if (SEG_IS_PARTIAL_RESV(seg)) in segvn_unmap()
2205 seg->s_as->a_resvsize -= oswresv - in segvn_unmap()
2213 segvn_count_swap_by_vpages(seg); in segvn_unmap()
2218 ASSERT(svd->swresv == seg->s_size); in segvn_unmap()
2222 seg->s_as->a_proc->p_zone); in segvn_unmap()
2225 "anon proc:%p %lu %u", seg, len, 0); in segvn_unmap()
2237 nsize = (seg->s_base + seg->s_size) - nbase; /* new seg size */ in segvn_unmap()
2238 seg->s_size = addr - seg->s_base; /* shrink old seg */ in segvn_unmap()
2239 nseg = seg_alloc(seg->s_as, nbase, nsize); in segvn_unmap()
2244 nseg->s_ops = seg->s_ops; in segvn_unmap()
2247 nseg->s_szc = seg->s_szc; in segvn_unmap()
2249 nsvd->seg = nseg; in segvn_unmap()
2250 nsvd->offset = svd->offset + (uintptr_t)(nseg->s_base - seg->s_base); in segvn_unmap()
2274 npages = seg_pages(seg); /* seg has shrunk */ in segvn_unmap()
2299 opages = btop((uintptr_t)(addr - seg->s_base)); in segvn_unmap()
2318 if (amp->a_szc == seg->s_szc) { in segvn_unmap()
2319 if (seg->s_szc != 0) { in segvn_unmap()
2321 seg->s_szc); in segvn_unmap()
2328 ASSERT(amp->a_szc > seg->s_szc); in segvn_unmap()
2339 seg->s_as->a_proc->p_zone); in segvn_unmap()
2344 btop((uintptr_t)(nseg->s_base - seg->s_base)); in segvn_unmap()
2353 nahp = anon_create(btop(seg->s_size), ANON_SLEEP); in segvn_unmap()
2355 namp->a_szc = seg->s_szc; in segvn_unmap()
2357 0, btop(seg->s_size), ANON_SLEEP); in segvn_unmap()
2364 amp->size = seg->s_size; in segvn_unmap()
2374 svd->anon_index, btop(seg->s_size))); in segvn_unmap()
2379 seg->s_as->a_proc->p_zone); in segvn_unmap()
2380 if (SEG_IS_PARTIAL_RESV(seg)) in segvn_unmap()
2381 seg->s_as->a_resvsize -= oswresv - in segvn_unmap()
2388 svd->swresv = segvn_count_swap_by_vpages(seg); in segvn_unmap()
2393 if (seg->s_size + nseg->s_size + len != in segvn_unmap()
2399 svd->swresv = seg->s_size; in segvn_unmap()
2404 seg->s_as->a_proc->p_zone); in segvn_unmap()
2407 seg, len, 0); in segvn_unmap()
2414 segvn_free(struct seg *seg) in segvn_free() argument
2416 struct segvn_data *svd = (struct segvn_data *)seg->s_data; in segvn_free()
2417 pgcnt_t npages = seg_pages(seg); in segvn_free()
2425 ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as)); in segvn_free()
2434 (void) segvn_lockop(seg, seg->s_base, seg->s_size, in segvn_free()
2451 ASSERT(amp->a_szc >= seg->s_szc); in segvn_free()
2458 if (seg->s_szc != 0) { in segvn_free()
2460 svd->anon_index, seg->s_size, in segvn_free()
2461 seg->s_szc); in segvn_free()
2464 seg->s_size); in segvn_free()
2489 seg->s_as->a_proc->p_zone); in segvn_free()
2491 "anon proc:%p %lu %u", seg, len, 0); in segvn_free()
2503 if (seg->s_szc != 0) { in segvn_free()
2505 seg->s_size, seg->s_szc); in segvn_free()
2508 seg->s_size); in segvn_free()
2521 seg->s_as->a_proc->p_zone); in segvn_free()
2523 seg, len, 0); in segvn_free()
2524 if (SEG_IS_PARTIAL_RESV(seg)) in segvn_free()
2525 seg->s_as->a_resvsize -= svd->swresv; in segvn_free()
2553 seg->s_data = NULL; in segvn_free()
2564 segvn_softunlock(struct seg *seg, caddr_t addr, size_t len, enum seg_rw rw) in segvn_softunlock() argument
2566 struct segvn_data *svd = (struct segvn_data *)seg->s_data; in segvn_softunlock()
2575 ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as)); in segvn_softunlock()
2576 ASSERT(SEGVN_LOCK_HELD(seg->s_as, &svd->lock)); in segvn_softunlock()
2579 anon_index = svd->anon_index + seg_page(seg, addr); in segvn_softunlock()
2583 hat_unlock_region(seg->s_as->a_hat, addr, len, svd->rcookie); in segvn_softunlock()
2585 hat_unlock(seg->s_as->a_hat, addr, len); in segvn_softunlock()
2596 (uintptr_t)(adr - seg->s_base); in segvn_softunlock()
2602 (uintptr_t)(adr - seg->s_base); in segvn_softunlock()
2619 if (seg->s_as->a_vbits) in segvn_softunlock()
2620 hat_setstat(seg->s_as, adr, PAGESIZE, in segvn_softunlock()
2624 if (seg->s_as->a_vbits) in segvn_softunlock()
2625 hat_setstat(seg->s_as, adr, PAGESIZE, P_REF); in segvn_softunlock()
2640 if (AS_ISUNMAPWAIT(seg->s_as)) { in segvn_softunlock()
2641 mutex_enter(&seg->s_as->a_contents); in segvn_softunlock()
2642 if (AS_ISUNMAPWAIT(seg->s_as)) { in segvn_softunlock()
2643 AS_CLRUNMAPWAIT(seg->s_as); in segvn_softunlock()
2644 cv_broadcast(&seg->s_as->a_cv); in segvn_softunlock()
2646 mutex_exit(&seg->s_as->a_contents); in segvn_softunlock()
2702 struct seg *seg, /* seg_vn of interest */ in segvn_faultpage() argument
2712 struct segvn_data *svd = (struct segvn_data *)seg->s_data; in segvn_faultpage()
2733 ASSERT(SEGVN_READ_HELD(seg->s_as, &svd->lock)); in segvn_faultpage()
2734 ASSERT(seg->s_szc == 0); in segvn_faultpage()
2778 anon_index = svd->anon_index + seg_page(seg, addr); in segvn_faultpage()
2791 seg->s_as->a_proc->p_zone)) { in segvn_faultpage()
2793 atomic_add_long(&seg->s_as->a_resvsize, in segvn_faultpage()
2800 if ((pp = anon_zero(seg, addr, &ap, in segvn_faultpage()
2818 page_migrate(seg, addr, &pp, 1); in segvn_faultpage()
2860 if (AS_ISPGLCK(seg->s_as) && vpage != NULL && in segvn_faultpage()
2863 proc_t *p = seg->s_as->a_proc; in segvn_faultpage()
2898 seg, addr, rw, svd->cred); in segvn_faultpage()
2977 page_migrate(seg, addr, &opp, 1); in segvn_faultpage()
3038 hat_unload(seg->s_as->a_hat, addr, PAGESIZE, in segvn_faultpage()
3069 if (anon_resv_zone(ptob(1), seg->s_as->a_proc->p_zone)) { in segvn_faultpage()
3071 atomic_add_long(&seg->s_as->a_resvsize, ptob(1)); in segvn_faultpage()
3079 pp = anon_private(&ap, seg, addr, prot, opp, pageflags, svd->cred); in segvn_faultpage()
3103 page_migrate(seg, addr, &pp, 1); in segvn_faultpage()
3824 segvn_fault_vnodepages(struct hat *hat, struct seg *seg, caddr_t lpgaddr, in segvn_fault_vnodepages() argument
3828 struct segvn_data *svd = (struct segvn_data *)seg->s_data; in segvn_fault_vnodepages()
3831 uint_t szc = seg->s_szc; in segvn_fault_vnodepages()
3839 u_offset_t off = svd->offset + (uintptr_t)(a - seg->s_base); in segvn_fault_vnodepages()
3840 ulong_t aindx = svd->anon_index + seg_page(seg, a); in segvn_fault_vnodepages()
3842 &svd->vpage[seg_page(seg, a)] : NULL; in segvn_fault_vnodepages()
3876 ASSERT(SEGVN_LOCK_HELD(seg->s_as, &svd->lock)); in segvn_fault_vnodepages()
3877 ASSERT(seg->s_szc < NBBY * sizeof (int)); in segvn_fault_vnodepages()
3909 if (seg->s_as->a_hat != hat) { in segvn_fault_vnodepages()
3928 while (szc < seg->s_szc) { in segvn_fault_vnodepages()
3932 seg->s_szc; in segvn_fault_vnodepages()
3958 err = segvn_fault_anonpages(hat, seg, in segvn_fault_vnodepages()
3966 if (szc < seg->s_szc) { in segvn_fault_vnodepages()
3967 szc = seg->s_szc; in segvn_fault_vnodepages()
3987 ASSERT(sameprot(seg, a, maxpgsz)); in segvn_fault_vnodepages()
4006 if (page_alloc_pages(vp, seg, a, &pplist, NULL, in segvn_fault_vnodepages()
4046 &vpprot, ppa, pgsz, seg, a, arw, in segvn_fault_vnodepages()
4134 if (szc < seg->s_szc) { in segvn_fault_vnodepages()
4152 pszc = seg->s_szc; in segvn_fault_vnodepages()
4169 ASSERT(szc == seg->s_szc); in segvn_fault_vnodepages()
4174 seg, a, prot, ppa, vpage, segvn_anypgsz, in segvn_fault_vnodepages()
4264 page_migrate(seg, a, ppa, pages); in segvn_fault_vnodepages()
4303 if (pszc > szc && szc < seg->s_szc && in segvn_fault_vnodepages()
4304 (segvn_anypgsz_vnode || pszc >= seg->s_szc)) { in segvn_fault_vnodepages()
4306 uint_t pszc1 = MIN(pszc, seg->s_szc); in segvn_fault_vnodepages()
4471 page_alloc_pages(vp, seg, a, &pplist, NULL, in segvn_fault_vnodepages()
4547 ASSERT(ierr == -1 || szc < seg->s_szc); in segvn_fault_vnodepages()
4550 ASSERT(pszc > szc && pszc <= seg->s_szc); in segvn_fault_vnodepages()
4575 off = svd->offset + (uintptr_t)(a - seg->s_base); in segvn_fault_vnodepages()
4576 aindx = svd->anon_index + seg_page(seg, a); in segvn_fault_vnodepages()
4578 &svd->vpage[seg_page(seg, a)] : NULL; in segvn_fault_vnodepages()
4599 (uintptr_t)(a - seg->s_base); in segvn_fault_vnodepages()
4600 aindx = svd->anon_index + seg_page(seg, a); in segvn_fault_vnodepages()
4602 &svd->vpage[seg_page(seg, a)] : NULL; in segvn_fault_vnodepages()
4614 segvn_softunlock(seg, lpgaddr, a - lpgaddr, S_OTHER); in segvn_fault_vnodepages()
4631 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_fault_vnodepages()
4632 SEGVN_LOCK_ENTER(seg->s_as, &svd->lock, RW_WRITER); in segvn_fault_vnodepages()
4634 if (seg->s_szc != 0) { in segvn_fault_vnodepages()
4637 err = segvn_clrszc(seg); in segvn_fault_vnodepages()
4642 ASSERT(err || seg->s_szc == 0); in segvn_fault_vnodepages()
4643 SEGVN_LOCK_DOWNGRADE(seg->s_as, &svd->lock); in segvn_fault_vnodepages()
4654 segvn_fault_anonpages(struct hat *hat, struct seg *seg, caddr_t lpgaddr, in segvn_fault_anonpages() argument
4658 struct segvn_data *svd = (struct segvn_data *)seg->s_data; in segvn_fault_anonpages()
4661 uint_t szc = seg->s_szc; in segvn_fault_anonpages()
4667 ulong_t aindx = svd->anon_index + seg_page(seg, a); in segvn_fault_anonpages()
4669 &svd->vpage[seg_page(seg, a)] : NULL; in segvn_fault_anonpages()
4690 ASSERT(SEGVN_LOCK_HELD(seg->s_as, &svd->lock)); in segvn_fault_anonpages()
4730 ASSERT(sameprot(seg, a, maxpgsz)); in segvn_fault_anonpages()
4739 szc = seg->s_szc; in segvn_fault_anonpages()
4752 ierr = anon_map_getpages(amp, aindx, szc, seg, a, in segvn_fault_anonpages()
4782 page_migrate(seg, a, ppa, pages); in segvn_fault_anonpages()
4828 ASSERT(ierr == -1 || szc < seg->s_szc); in segvn_fault_anonpages()
4842 szc = (ierr == -1) ? 0 : seg->s_szc; in segvn_fault_anonpages()
4844 ASSERT(ppa_szc <= seg->s_szc); in segvn_fault_anonpages()
4875 aindx = svd->anon_index + seg_page(seg, a); in segvn_fault_anonpages()
4877 &svd->vpage[seg_page(seg, a)] : NULL; in segvn_fault_anonpages()
4898 aindx = svd->anon_index + seg_page(seg, a); in segvn_fault_anonpages()
4900 &svd->vpage[seg_page(seg, a)] : NULL; in segvn_fault_anonpages()
4914 segvn_softunlock(seg, lpgaddr, a - lpgaddr, S_OTHER); in segvn_fault_anonpages()
4943 segvn_fault(struct hat *hat, struct seg *seg, caddr_t addr, size_t len, in segvn_fault() argument
4946 struct segvn_data *svd = (struct segvn_data *)seg->s_data; in segvn_fault()
4964 ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as)); in segvn_fault()
4973 ASSERT(AS_WRITE_HELD(seg->s_as)); in segvn_fault()
4975 SEGVN_LOCK_ENTER(seg->s_as, &svd->lock, RW_READER); in segvn_fault()
4976 pgsz = (seg->s_szc == 0) ? PAGESIZE : in segvn_fault()
4977 page_get_pagesize(seg->s_szc); in segvn_fault()
4979 CALC_LPG_REGION(pgsz, seg, addr, len, lpgaddr, lpgeaddr); in segvn_fault()
4980 segvn_softunlock(seg, lpgaddr, lpgeaddr - lpgaddr, rw); in segvn_fault()
4981 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_fault()
4989 SEGVN_LOCK_ENTER(seg->s_as, &svd->lock, RW_WRITER); in segvn_fault()
4994 segvn_textrepl(seg); in segvn_fault()
4999 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_fault()
5002 SEGVN_LOCK_ENTER(seg->s_as, &svd->lock, RW_WRITER); in segvn_fault()
5006 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_fault()
5012 segvn_textunrepl(seg, 0); in segvn_fault()
5019 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_fault()
5023 SEGVN_LOCK_ENTER(seg->s_as, &svd->lock, RW_READER); in segvn_fault()
5051 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_fault()
5060 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_fault()
5061 SEGVN_LOCK_ENTER(seg->s_as, &svd->lock, RW_WRITER); in segvn_fault()
5068 hat_leave_region(seg->s_as->a_hat, svd->rcookie, in segvn_fault()
5072 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_fault()
5103 if (type == F_SOFTLOCK && svd->vp != NULL && seg->s_szc != 0) { in segvn_fault()
5110 pgsz = page_get_pagesize(seg->s_szc); in segvn_fault()
5111 CALC_LPG_REGION(pgsz, seg, addr, len, lpgaddr, in segvn_fault()
5118 ASSERT(demote || AS_WRITE_HELD(seg->s_as)); in segvn_fault()
5121 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_fault()
5122 SEGVN_LOCK_ENTER(seg->s_as, &svd->lock, RW_WRITER); in segvn_fault()
5123 if (seg->s_szc != 0) { in segvn_fault()
5126 err = segvn_clrszc(seg); in segvn_fault()
5129 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_fault()
5133 ASSERT(seg->s_szc == 0); in segvn_fault()
5134 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_fault()
5149 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_fault()
5150 SEGVN_LOCK_ENTER(seg->s_as, &svd->lock, RW_WRITER); in segvn_fault()
5153 svd->amp = anonmap_alloc(seg->s_size, 0, ANON_SLEEP); in segvn_fault()
5154 svd->amp->a_szc = seg->s_szc; in segvn_fault()
5156 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_fault()
5172 ASSERT(AS_WRITE_HELD(seg->s_as)); in segvn_fault()
5181 if (seg->s_szc != 0) { in segvn_fault()
5182 pgsz = page_get_pagesize(seg->s_szc); in segvn_fault()
5183 ASSERT(SEGVN_LOCK_HELD(seg->s_as, &svd->lock)); in segvn_fault()
5184 CALC_LPG_REGION(pgsz, seg, addr, len, lpgaddr, lpgeaddr); in segvn_fault()
5186 err = segvn_fault_anonpages(hat, seg, lpgaddr, in segvn_fault()
5189 err = segvn_fault_vnodepages(hat, seg, lpgaddr, in segvn_fault()
5192 ASSERT(seg->s_szc == 0); in segvn_fault()
5193 ASSERT(SEGVN_READ_HELD(seg->s_as, &svd->lock)); in segvn_fault()
5194 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_fault()
5198 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_fault()
5202 page = seg_page(seg, addr); in segvn_fault()
5232 hat_chgprot(seg->s_as->a_hat, addr, len, svd->prot); in segvn_fault()
5234 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_fault()
5245 off = svd->offset + (uintptr_t)(addr - seg->s_base); in segvn_fault()
5390 struct as *as = seg->s_as; in segvn_fault()
5405 (size_t)(seg->s_base + seg->s_size)) && in segvn_fault()
5421 ((seg->s_base + seg->s_size) - addr)); in segvn_fault()
5423 (seg->s_base + seg->s_size)); in segvn_fault()
5446 seg, addr, vp); in segvn_fault()
5448 &vpprot, plp, plsz, seg, addr + (vp_off - off), arw, in segvn_fault()
5451 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_fault()
5506 err = segvn_faultpage(hat, seg, a, off, vpage, plp, vpprot, in segvn_fault()
5512 segvn_softunlock(seg, addr, (a - addr), in segvn_fault()
5515 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_fault()
5524 page = seg_page(seg, addr); in segvn_fault()
5567 pp->p_offset < svd->offset + seg->s_size) { in segvn_fault()
5611 seg->s_base + diff, in segvn_fault()
5624 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_fault()
5636 segvn_faulta(struct seg *seg, caddr_t addr) in segvn_faulta() argument
5638 struct segvn_data *svd = (struct segvn_data *)seg->s_data; in segvn_faulta()
5643 ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as)); in segvn_faulta()
5645 SEGVN_LOCK_ENTER(seg->s_as, &svd->lock, RW_READER); in segvn_faulta()
5656 svd->anon_index + seg_page(seg, addr))) != NULL) { in segvn_faulta()
5659 0, seg, addr, S_READ, svd->cred); in segvn_faulta()
5662 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_faulta()
5671 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_faulta()
5677 "segvn_getpage:seg %p addr %p vp %p", seg, addr, vp); in segvn_faulta()
5679 (offset_t)(svd->offset + (uintptr_t)(addr - seg->s_base)), in segvn_faulta()
5680 PAGESIZE, NULL, NULL, 0, seg, addr, in segvn_faulta()
5683 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_faulta()
5690 segvn_setprot(struct seg *seg, caddr_t addr, size_t len, uint_t prot) in segvn_setprot() argument
5692 struct segvn_data *svd = (struct segvn_data *)seg->s_data; in segvn_setprot()
5700 ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as)); in segvn_setprot()
5705 SEGVN_LOCK_ENTER(seg->s_as, &svd->lock, RW_WRITER); in segvn_setprot()
5709 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_setprot()
5726 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_setprot()
5736 segvn_purge(seg); in segvn_setprot()
5738 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_setprot()
5746 hat_leave_region(seg->s_as->a_hat, svd->rcookie, in segvn_setprot()
5754 segvn_textunrepl(seg, 0); in segvn_setprot()
5764 if (seg->s_szc != 0) { in segvn_setprot()
5766 pgsz = page_get_pagesize(seg->s_szc); in segvn_setprot()
5770 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_setprot()
5771 ASSERT(seg->s_base != addr || seg->s_size != len); in segvn_setprot()
5777 if (AS_READ_HELD(seg->s_as)) in segvn_setprot()
5781 err = segvn_demote_range(seg, addr, len, in segvn_setprot()
5784 uint_t szcvec = map_pgszcvec(seg->s_base, in segvn_setprot()
5785 pgsz, (uintptr_t)seg->s_base, in segvn_setprot()
5787 err = segvn_demote_range(seg, addr, len, in segvn_setprot()
5821 if (addr == seg->s_base && in segvn_setprot()
5822 len == seg->s_size && in segvn_setprot()
5825 sz = seg->s_size; in segvn_setprot()
5833 segvn_vpage(seg); in segvn_setprot()
5835 SEGVN_LOCK_EXIT(seg->s_as, in segvn_setprot()
5839 svp = &svd->vpage[seg_page(seg, addr)]; in segvn_setprot()
5840 evp = &svd->vpage[seg_page(seg, in segvn_setprot()
5868 seg->s_as->a_proc->p_zone) == 0) { in segvn_setprot()
5869 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_setprot()
5877 if (svd->pageswap == 0 && sz == seg->s_size) { in segvn_setprot()
5897 svd->amp == NULL && addr == seg->s_base && in segvn_setprot()
5898 len == seg->s_size && svd->pageprot == 0) { in segvn_setprot()
5901 seg->s_as->a_proc->p_zone); in segvn_setprot()
5904 "anon proc:%p %lu %u", seg, 0, 0); in segvn_setprot()
5909 if (addr == seg->s_base && len == seg->s_size && svd->vpage == NULL) { in segvn_setprot()
5911 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_setprot()
5931 segvn_vpage(seg); in segvn_setprot()
5933 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_setprot()
5938 anon_idx = svd->anon_index + seg_page(seg, addr); in segvn_setprot()
5939 ASSERT(seg->s_szc == 0 || in segvn_setprot()
5944 offset = svd->offset + (uintptr_t)(addr - seg->s_base); in segvn_setprot()
5945 evp = &svd->vpage[seg_page(seg, addr + len)]; in segvn_setprot()
5951 for (svp = &svd->vpage[seg_page(seg, addr)]; svp < evp; svp++) { in segvn_setprot()
5953 if (seg->s_szc != 0) { in segvn_setprot()
5959 !segvn_claim_pages(seg, svp, offset, in segvn_setprot()
5993 ASSERT(seg->s_szc == 0); in segvn_setprot()
6026 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_setprot()
6029 len = (svp - &svd->vpage[seg_page(seg, addr)]) * in segvn_setprot()
6031 ASSERT(seg->s_szc == 0 || IS_P2ALIGNED(len, pgsz)); in segvn_setprot()
6033 hat_unload(seg->s_as->a_hat, addr, in segvn_setprot()
6035 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_setprot()
6039 segvn_vpage(seg); in segvn_setprot()
6041 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_setprot()
6045 evp = &svd->vpage[seg_page(seg, addr + len)]; in segvn_setprot()
6046 for (svp = &svd->vpage[seg_page(seg, addr)]; svp < evp; svp++) { in segvn_setprot()
6052 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_setprot()
6069 hat_unload(seg->s_as->a_hat, addr, len, HAT_UNLOAD); in segvn_setprot()
6078 hat_chgattr(seg->s_as->a_hat, addr, len, prot); in segvn_setprot()
6081 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_setprot()
6091 segvn_setpagesize(struct seg *seg, caddr_t addr, size_t len, uint_t szc) in segvn_setpagesize() argument
6093 struct segvn_data *svd = (struct segvn_data *)seg->s_data; in segvn_setpagesize()
6096 struct seg *nseg; in segvn_setpagesize()
6101 u_offset_t off = svd->offset + (uintptr_t)(addr - seg->s_base); in segvn_setpagesize()
6103 ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as)); in segvn_setpagesize()
6104 ASSERT(addr >= seg->s_base && eaddr <= seg->s_base + seg->s_size); in segvn_setpagesize()
6106 if (seg->s_szc == szc || segvn_lpg_disable != 0) { in segvn_setpagesize()
6119 eaddr != seg->s_base + seg->s_size)) { in segvn_setpagesize()
6126 ulong_t an_idx = svd->anon_index + seg_page(seg, addr); in segvn_setpagesize()
6134 if ((svd->flags & MAP_NORESERVE) || seg->s_as == &kas || in segvn_setpagesize()
6145 if (seg->s_szc == 0 && svd->vp != NULL && in segvn_setpagesize()
6157 if (!sameprot(seg, a, eaddr - a)) { in segvn_setpagesize()
6161 if (!sameprot(seg, a, pgsz)) { in segvn_setpagesize()
6190 segvn_purge(seg); in segvn_setpagesize()
6199 hat_leave_region(seg->s_as->a_hat, svd->rcookie, in segvn_setpagesize()
6206 segvn_textunrepl(seg, 1); in segvn_setpagesize()
6214 if (addr != seg->s_base || eaddr != (seg->s_base + seg->s_size)) { in segvn_setpagesize()
6215 if (szc < seg->s_szc) { in segvn_setpagesize()
6217 err = segvn_demote_range(seg, addr, len, SDR_RANGE, 0); in segvn_setpagesize()
6226 if (addr != seg->s_base) { in segvn_setpagesize()
6227 nseg = segvn_split_seg(seg, addr); in segvn_setpagesize()
6234 if (eaddr != (seg->s_base + seg->s_size)) { in segvn_setpagesize()
6236 (void) segvn_split_seg(seg, eaddr); in segvn_setpagesize()
6244 if ((err = segvn_clrszc(seg)) != 0) { in segvn_setpagesize()
6250 ASSERT(seg->s_szc == 0); in segvn_setpagesize()
6257 nseg = AS_SEGNEXT(seg->s_as, seg); in segvn_setpagesize()
6258 if (nseg == NULL || nseg == seg || eaddr != nseg->s_base) { in segvn_setpagesize()
6286 err = segvn_concat(seg, nseg, 1); in segvn_setpagesize()
6314 nahp, 0, btop(seg->s_size), ANON_NOSLEEP)) { in segvn_setpagesize()
6329 eoffpage += seg->s_size; in segvn_setpagesize()
6348 if ((err = anon_fill_cow_holes(seg, seg->s_base, in segvn_setpagesize()
6350 seg->s_size, szc, svd->prot, svd->vpage, in segvn_setpagesize()
6368 seg->s_szc = szc; in segvn_setpagesize()
6374 segvn_clrszc(struct seg *seg) in segvn_clrszc() argument
6376 struct segvn_data *svd = (struct segvn_data *)seg->s_data; in segvn_clrszc()
6381 caddr_t a = seg->s_base; in segvn_clrszc()
6382 caddr_t ea = a + seg->s_size; in segvn_clrszc()
6391 ASSERT(AS_WRITE_HELD(seg->s_as) || in segvn_clrszc()
6392 SEGVN_WRITE_HELD(seg->s_as, &svd->lock)); in segvn_clrszc()
6397 seg->s_szc = 0; in segvn_clrszc()
6404 hat_leave_region(seg->s_as->a_hat, svd->rcookie, in segvn_clrszc()
6409 segvn_textunrepl(seg, 1); in segvn_clrszc()
6423 hat_unload(seg->s_as->a_hat, seg->s_base, seg->s_size, in segvn_clrszc()
6428 seg->s_szc = 0; in segvn_clrszc()
6432 pgsz = page_get_pagesize(seg->s_szc); in segvn_clrszc()
6445 ASSERT(sameprot(seg, a, pgsz)); in segvn_clrszc()
6449 if (seg->s_szc != 0) { in segvn_clrszc()
6453 seg, a, prot, vpage, svd->cred)) != 0) { in segvn_clrszc()
6461 anon_pl, PAGESIZE, seg, a, S_READ, in segvn_clrszc()
6465 if ((pp = anon_private(&ap, seg, a, prot, in segvn_clrszc()
6480 seg->s_szc = 0; in segvn_clrszc()
6488 struct seg *seg, in segvn_claim_pages() argument
6494 pgcnt_t pgcnt = page_get_pagecnt(seg->s_szc); in segvn_claim_pages()
6497 struct segvn_data *svd = (struct segvn_data *)seg->s_data; in segvn_claim_pages()
6501 + seg->s_base; in segvn_claim_pages()
6512 ASSERT(seg->s_szc != 0); in segvn_claim_pages()
6515 ASSERT(sameprot(seg, addr, pgcnt << PAGESHIFT)); in segvn_claim_pages()
6564 if (ppa[0]->p_szc == seg->s_szc) { in segvn_claim_pages()
6595 static struct seg *
6596 segvn_split_seg(struct seg *seg, caddr_t addr) in segvn_split_seg() argument
6598 struct segvn_data *svd = (struct segvn_data *)seg->s_data; in segvn_split_seg()
6599 struct seg *nseg; in segvn_split_seg()
6603 ASSERT(AS_WRITE_HELD(seg->s_as)); in segvn_split_seg()
6606 ASSERT(addr >= seg->s_base); in segvn_split_seg()
6607 ASSERT(addr <= seg->s_base + seg->s_size); in segvn_split_seg()
6610 if (addr == seg->s_base || addr == seg->s_base + seg->s_size) in segvn_split_seg()
6611 return (seg); in segvn_split_seg()
6613 nsize = seg->s_base + seg->s_size - addr; in segvn_split_seg()
6614 seg->s_size = addr - seg->s_base; in segvn_split_seg()
6615 nseg = seg_alloc(seg->s_as, addr, nsize); in segvn_split_seg()
6617 nseg->s_ops = seg->s_ops; in segvn_split_seg()
6620 nseg->s_szc = seg->s_szc; in segvn_split_seg()
6623 nsvd->seg = nseg; in segvn_split_seg()
6629 (uintptr_t)(nseg->s_base - seg->s_base); in segvn_split_seg()
6653 size_t bytes = vpgtob(seg_pages(seg)); in segvn_split_seg()
6660 bcopy(ovpage + seg_pages(seg), nsvd->vpage, nbytes); in segvn_split_seg()
6669 nahp = anon_create(btop(seg->s_size), ANON_SLEEP); in segvn_split_seg()
6671 nahp, 0, btop(seg->s_size), ANON_SLEEP); in segvn_split_seg()
6676 svd->anon_index + btop(seg->s_size), in segvn_split_seg()
6680 oamp->size = seg->s_size; in segvn_split_seg()
6686 pgcnt_t pgcnt = page_get_pagecnt(seg->s_szc); in segvn_split_seg()
6688 ASSERT(seg->s_szc <= svd->amp->a_szc); in segvn_split_seg()
6689 nsvd->anon_index = svd->anon_index + seg_pages(seg); in segvn_split_seg()
6711 svd->anon_index, btop(seg->s_size))); in segvn_split_seg()
6717 svd->swresv = segvn_count_swap_by_vpages(seg); in segvn_split_seg()
6721 ASSERT(svd->swresv == seg->s_size + in segvn_split_seg()
6723 svd->swresv = seg->s_size; in segvn_split_seg()
6741 struct seg *seg, in segvn_demote_range() argument
6749 struct seg *nseg; in segvn_demote_range()
6750 struct seg *badseg1 = NULL; in segvn_demote_range()
6751 struct seg *badseg2 = NULL; in segvn_demote_range()
6753 struct segvn_data *svd = (struct segvn_data *)seg->s_data; in segvn_demote_range()
6755 uint_t szc = seg->s_szc; in segvn_demote_range()
6758 ASSERT(AS_WRITE_HELD(seg->s_as)); in segvn_demote_range()
6762 ASSERT(seg->s_base != addr || seg->s_size != len); in segvn_demote_range()
6763 ASSERT(addr >= seg->s_base && eaddr <= seg->s_base + seg->s_size); in segvn_demote_range()
6768 CALC_LPG_REGION(pgsz, seg, addr, len, lpgaddr, lpgeaddr); in segvn_demote_range()
6772 badseg1 = nseg = segvn_split_seg(seg, lpgaddr); in segvn_demote_range()
6778 badseg1 = nseg = segvn_split_seg(seg, lpgaddr); in segvn_demote_range()
6800 badseg1 = nseg = segvn_split_seg(seg, lpgeaddr - pgsz); in segvn_demote_range()
6882 segvn_checkprot(struct seg *seg, caddr_t addr, size_t len, uint_t prot) in segvn_checkprot() argument
6884 struct segvn_data *svd = (struct segvn_data *)seg->s_data; in segvn_checkprot()
6887 ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as)); in segvn_checkprot()
6889 SEGVN_LOCK_ENTER(seg->s_as, &svd->lock, RW_READER); in segvn_checkprot()
6897 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_checkprot()
6904 evp = &svd->vpage[seg_page(seg, addr + len)]; in segvn_checkprot()
6905 for (vp = &svd->vpage[seg_page(seg, addr)]; vp < evp; vp++) { in segvn_checkprot()
6907 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_checkprot()
6911 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_checkprot()
6916 segvn_getprot(struct seg *seg, caddr_t addr, size_t len, uint_t *protv) in segvn_getprot() argument
6918 struct segvn_data *svd = (struct segvn_data *)seg->s_data; in segvn_getprot()
6919 size_t pgno = seg_page(seg, addr + len) - seg_page(seg, addr) + 1; in segvn_getprot()
6921 ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as)); in segvn_getprot()
6924 SEGVN_LOCK_ENTER(seg->s_as, &svd->lock, RW_READER); in segvn_getprot()
6930 size_t pgoff = seg_page(seg, addr); in segvn_getprot()
6937 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_getprot()
6943 segvn_getoffset(struct seg *seg, caddr_t addr) in segvn_getoffset() argument
6945 struct segvn_data *svd = (struct segvn_data *)seg->s_data; in segvn_getoffset()
6947 ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as)); in segvn_getoffset()
6949 return (svd->offset + (uintptr_t)(addr - seg->s_base)); in segvn_getoffset()
6954 segvn_gettype(struct seg *seg, caddr_t addr) in segvn_gettype() argument
6956 struct segvn_data *svd = (struct segvn_data *)seg->s_data; in segvn_gettype()
6958 ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as)); in segvn_gettype()
6966 segvn_getvp(struct seg *seg, caddr_t addr, struct vnode **vpp) in segvn_getvp() argument
6968 struct segvn_data *svd = (struct segvn_data *)seg->s_data; in segvn_getvp()
6970 ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as)); in segvn_getvp()
6987 segvn_kluster(struct seg *seg, caddr_t addr, ssize_t delta) in segvn_kluster() argument
6989 struct segvn_data *svd = (struct segvn_data *)seg->s_data; in segvn_kluster()
6997 ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as)); in segvn_kluster()
6998 ASSERT(AS_WRITE_HELD(seg->s_as) || in segvn_kluster()
6999 SEGVN_LOCK_HELD(seg->s_as, &svd->lock)); in segvn_kluster()
7001 if (addr + delta < seg->s_base || in segvn_kluster()
7002 addr + delta >= (seg->s_base + seg->s_size)) in segvn_kluster()
7006 page = seg_page(seg, addr); in segvn_kluster()
7094 segvn_swapout(struct seg *seg) in segvn_swapout() argument
7096 struct segvn_data *svd = (struct segvn_data *)seg->s_data; in segvn_swapout()
7103 ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as)); in segvn_swapout()
7105 SEGVN_LOCK_ENTER(seg->s_as, &svd->lock, RW_READER); in segvn_swapout()
7112 npages = seg->s_size >> PAGESHIFT; in segvn_swapout()
7248 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_swapout()
7263 segvn_sync(struct seg *seg, caddr_t addr, size_t len, int attr, uint_t flags) in segvn_sync() argument
7265 struct segvn_data *svd = (struct segvn_data *)seg->s_data; in segvn_sync()
7282 ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as)); in segvn_sync()
7284 SEGVN_LOCK_ENTER(seg->s_as, &svd->lock, RW_READER); in segvn_sync()
7292 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_sync()
7310 segvn_purge(seg); in segvn_sync()
7312 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_sync()
7322 segvn_purge(seg); in segvn_sync()
7324 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_sync()
7330 offset = svd->offset + (uintptr_t)(addr - seg->s_base); in segvn_sync()
7344 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_sync()
7349 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_sync()
7354 vpp = &svd->vpage[seg_page(seg, addr)]; in segvn_sync()
7365 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_sync()
7370 anon_index = svd->anon_index + seg_page(seg, addr); in segvn_sync()
7417 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_sync()
7480 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_sync()
7489 segvn_incore(struct seg *seg, caddr_t addr, size_t len, char *vec) in segvn_incore() argument
7491 struct segvn_data *svd = (struct segvn_data *)seg->s_data; in segvn_incore()
7504 ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as)); in segvn_incore()
7506 SEGVN_LOCK_ENTER(seg->s_as, &svd->lock, RW_READER); in segvn_incore()
7508 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_incore()
7513 p = seg_page(seg, addr); in segvn_incore()
7514 ep = seg_page(seg, addr + len); in segvn_incore()
7542 if ((hat_getattr(seg->s_as->a_hat, addr, in segvn_incore()
7562 offset = svd->offset + (uintptr_t)(addr - seg->s_base); in segvn_incore()
7598 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_incore()
7650 segvn_lockop(struct seg *seg, caddr_t addr, size_t len, in segvn_lockop() argument
7653 struct segvn_data *svd = (struct segvn_data *)seg->s_data; in segvn_lockop()
7680 ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as)); in segvn_lockop()
7696 SEGVN_LOCK_ENTER(seg->s_as, &svd->lock, RW_WRITER); in segvn_lockop()
7707 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_lockop()
7711 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_lockop()
7721 segvn_textunrepl(seg, 0); in segvn_lockop()
7735 segvn_vpage(seg); in segvn_lockop()
7737 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_lockop()
7741 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_lockop()
7753 svd->amp = anonmap_alloc(seg->s_size, 0, ANON_SLEEP); in segvn_lockop()
7754 svd->amp->a_szc = seg->s_szc; in segvn_lockop()
7758 anon_index = svd->anon_index + seg_page(seg, addr); in segvn_lockop()
7761 offset = svd->offset + (uintptr_t)(addr - seg->s_base); in segvn_lockop()
7762 evp = &svd->vpage[seg_page(seg, addr + len)]; in segvn_lockop()
7771 for (vpp = &svd->vpage[seg_page(seg, addr)]; vpp < evp; in segvn_lockop()
7784 i_edx = svd->anon_index + seg_page(seg, addr + len); in segvn_lockop()
7815 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_lockop()
7824 for (vpp = &svd->vpage[seg_page(seg, addr)]; vpp < evp; in segvn_lockop()
7846 pp = anon_zero(seg, addr, &ap, in segvn_lockop()
7911 (uint_t *)NULL, pl, PAGESIZE, seg, addr, in segvn_lockop()
8060 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_lockop()
8084 segvn_advise(struct seg *seg, caddr_t addr, size_t len, uint_t behav) in segvn_advise() argument
8086 struct segvn_data *svd = (struct segvn_data *)seg->s_data; in segvn_advise()
8092 struct seg *next; in segvn_advise()
8094 struct seg *prev; in segvn_advise()
8097 ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as)); in segvn_advise()
8104 SEGVN_LOCK_ENTER(seg->s_as, &svd->lock, RW_WRITER); in segvn_advise()
8106 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_advise()
8110 SEGVN_LOCK_ENTER(seg->s_as, &svd->lock, RW_READER); in segvn_advise()
8122 (seg->s_szc != 0 || HAT_IS_REGION_COOKIE_VALID(svd->rcookie))) || in segvn_advise()
8125 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_advise()
8144 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_advise()
8155 segvn_purge(seg); in segvn_advise()
8163 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_advise()
8173 segvn_purge(seg); in segvn_advise()
8190 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_advise()
8201 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_advise()
8205 segvn_purge(seg); in segvn_advise()
8207 page = seg_page(seg, addr); in segvn_advise()
8223 anon_unresv_zone(bytes, seg->s_as->a_proc->p_zone); in segvn_advise()
8225 atomic_add_long(&seg->s_as->a_resvsize, -bytes); in segvn_advise()
8229 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_advise()
8245 if ((addr == seg->s_base) && (len == seg->s_size)) { in segvn_advise()
8263 if (AS_READ_HELD(seg->s_as)) { in segvn_advise()
8264 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_advise()
8284 page_mark_migrate(seg, addr, len, amp, svd->anon_index, in segvn_advise()
8301 prev = AS_SEGPREV(seg->s_as, seg); in segvn_advise()
8302 next = AS_SEGNEXT(seg->s_as, seg); in segvn_advise()
8306 (void) segvn_concat(seg, next, 1); in segvn_advise()
8316 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_advise()
8317 if (!segvn_concat(prev, seg, 1)) in segvn_advise()
8329 ASSERT(seg->s_szc == 0); in segvn_advise()
8331 hat_unload(seg->s_as->a_hat, addr, len, in segvn_advise()
8349 struct seg *new_seg; in segvn_advise()
8354 page = seg_page(seg, addr); in segvn_advise()
8356 segvn_vpage(seg); in segvn_advise()
8358 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_advise()
8377 if (seg->s_szc != 0) { in segvn_advise()
8380 pgsz = page_get_pagesize(seg->s_szc); in segvn_advise()
8391 off = svd->offset + (uintptr_t)(addr - seg->s_base); in segvn_advise()
8414 AS_READ_HELD(seg->s_as)) { in segvn_advise()
8415 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_advise()
8423 page_mark_migrate(seg, addr, len, amp, svd->anon_index, in segvn_advise()
8438 hat_leave_region(seg->s_as->a_hat, svd->rcookie, in segvn_advise()
8449 oldeaddr = seg->s_base + seg->s_size; in segvn_advise()
8450 if (addr > seg->s_base) { in segvn_advise()
8456 segvn_purge(seg); in segvn_advise()
8462 new_seg = segvn_split_seg(seg, addr); in segvn_advise()
8501 segvn_purge(seg); in segvn_advise()
8508 if (new_seg != NULL && new_seg != seg) { in segvn_advise()
8526 (void) segvn_split_seg(seg, eaddr); in segvn_advise()
8530 &svd->policy_info, seg->s_size); in segvn_advise()
8537 if (addr == seg->s_base) { in segvn_advise()
8538 prev = AS_SEGPREV(seg->s_as, in segvn_advise()
8539 seg); in segvn_advise()
8552 seg->s_as, in segvn_advise()
8555 prev, seg, 1); in segvn_advise()
8563 ASSERT(seg->s_szc == 0); in segvn_advise()
8565 hat_unload(seg->s_as->a_hat, addr, len, HAT_UNLOAD); in segvn_advise()
8584 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_advise()
8594 segvn_inherit(struct seg *seg, caddr_t addr, size_t len, uint_t behav) in segvn_inherit() argument
8596 struct segvn_data *svd = (struct segvn_data *)seg->s_data; in segvn_inherit()
8601 ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as)); in segvn_inherit()
8607 SEGVN_LOCK_ENTER(seg->s_as, &svd->lock, RW_WRITER); in segvn_inherit()
8632 if ((addr == seg->s_base) && (len == seg->s_size)) { in segvn_inherit()
8643 segvn_vpage(seg); in segvn_inherit()
8651 page = seg_page(seg, addr); in segvn_inherit()
8659 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_inherit()
8667 segvn_vpage(struct seg *seg) in segvn_vpage() argument
8669 struct segvn_data *svd = (struct segvn_data *)seg->s_data; in segvn_vpage()
8673 ASSERT(SEGVN_WRITE_HELD(seg->s_as, &svd->lock)); in segvn_vpage()
8695 ulong_t mem_needed = seg_pages(seg) * sizeof (struct vpage); in segvn_vpage()
8706 evp = &svd->vpage[seg_page(seg, seg->s_base + seg->s_size)]; in segvn_vpage()
8718 segvn_dump(struct seg *seg) in segvn_dump() argument
8730 npages = seg_pages(seg); in segvn_dump()
8731 svd = (struct segvn_data *)seg->s_data; in segvn_dump()
8734 addr = seg->s_base; in segvn_dump()
8765 dump_addpage(seg->s_as, addr, pfn); in segvn_dump()
8827 segvn_pagelock(struct seg *seg, caddr_t addr, size_t len, struct page ***ppp, in segvn_pagelock() argument
8830 struct segvn_data *svd = (struct segvn_data *)seg->s_data; in segvn_pagelock()
8868 "segvn_pagelock: start seg %p addr %p", seg, addr); in segvn_pagelock()
8870 ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as)); in segvn_pagelock()
8873 SEGVN_LOCK_ENTER(seg->s_as, &svd->lock, RW_READER); in segvn_pagelock()
8903 if (seg->s_szc != 0) { in segvn_pagelock()
8928 pgsz = page_get_pagesize(seg->s_szc); in segvn_pagelock()
8929 CALC_LPG_REGION(pgsz, seg, addr, len, lpgaddr, lpgeaddr); in segvn_pagelock()
8969 if (lpgaddr < seg->s_base) { in segvn_pagelock()
8970 lpgaddr = seg->s_base; in segvn_pagelock()
8974 ulong_t aix = svd->anon_index + seg_page(seg, addr); in segvn_pagelock()
8977 lpgaddr = seg->s_base; in segvn_pagelock()
8981 ASSERT(lpgaddr >= seg->s_base); in segvn_pagelock()
8985 struct vpage *vp = &svd->vpage[seg_page(seg, lpgaddr)]; in segvn_pagelock()
8986 struct vpage *evp = &svd->vpage[seg_page(seg, addr)]; in segvn_pagelock()
9006 seg_page(seg, lpgeaddr); in segvn_pagelock()
9016 lpgeaddr > seg->s_base + seg->s_size) { in segvn_pagelock()
9017 lpgeaddr = seg->s_base + seg->s_size; in segvn_pagelock()
9025 vp = &svd->vpage[seg_page(seg, addr + len)]; in segvn_pagelock()
9026 evp = &svd->vpage[seg_page(seg, lpgeaddr)]; in segvn_pagelock()
9049 paddr = (caddr_t)((lpgaddr - seg->s_base) + in segvn_pagelock()
9067 if (seg->s_as->a_vbits) { in segvn_pagelock()
9070 hat_setstat(seg->s_as, a, in segvn_pagelock()
9073 hat_setstat(seg->s_as, a, in segvn_pagelock()
9093 paddr = (caddr_t)((addr - seg->s_base) + in segvn_pagelock()
9096 ptag = (void *)seg; in segvn_pagelock()
9105 seg_pinactive(seg, pamp, paddr, len, in segvn_pagelock()
9132 if (AS_ISUNMAPWAIT(seg->s_as)) { in segvn_pagelock()
9134 mutex_enter(&seg->s_as->a_contents); in segvn_pagelock()
9135 if (AS_ISUNMAPWAIT(seg->s_as)) { in segvn_pagelock()
9136 AS_CLRUNMAPWAIT(seg->s_as); in segvn_pagelock()
9137 cv_broadcast(&seg->s_as->a_cv); in segvn_pagelock()
9139 mutex_exit(&seg->s_as->a_contents); in segvn_pagelock()
9154 segvn_purge(seg); in segvn_pagelock()
9157 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_pagelock()
9159 "segvn_pagelock: unlock seg %p addr %p", seg, addr); in segvn_pagelock()
9185 if (seg->s_szc) { in segvn_pagelock()
9195 ASSERT(seg->s_szc == 0 || in segvn_pagelock()
9196 sameprot(seg, a, pgsz)); in segvn_pagelock()
9197 vp = &svd->vpage[seg_page(seg, a)]; in segvn_pagelock()
9209 pplist = seg_plookup(seg, pamp, paddr, lpgeaddr - lpgaddr, rw, pflags); in segvn_pagelock()
9223 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_pagelock()
9226 "segvn_pagelock: cache hit seg %p addr %p", seg, addr); in segvn_pagelock()
9255 ASSERT(seg->s_szc == 0 || in segvn_pagelock()
9256 sameprot(seg, a, pgsz)); in segvn_pagelock()
9257 vp = &svd->vpage[seg_page(seg, a)]; in segvn_pagelock()
9285 if (seg_pinsert_check(seg, pamp, paddr, in segvn_pagelock()
9312 page = seg_page(seg, addr); in segvn_pagelock()
9317 ASSERT(amp->a_szc >= seg->s_szc); in segvn_pagelock()
9351 if (seg->s_szc) { in segvn_pagelock()
9356 vpage = &svd->vpage[seg_page(seg, a)]; in segvn_pagelock()
9364 error = segvn_faultpage(seg->s_as->a_hat, seg, a, 0, in segvn_pagelock()
9417 (void) seg_pinsert(seg, pamp, paddr, len, wlen, pl, in segvn_pagelock()
9420 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_pagelock()
9422 "segvn_pagelock: cache fill seg %p addr %p", seg, addr); in segvn_pagelock()
9436 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_pagelock()
9439 "segvn_pagelock: cache miss seg %p addr %p", seg, addr); in segvn_pagelock()
9447 segvn_purge(struct seg *seg) in segvn_purge() argument
9449 struct segvn_data *svd = (struct segvn_data *)seg->s_data; in segvn_purge()
9465 seg_ppurge(seg, NULL, 0); in segvn_purge()
9468 seg_ppurge(seg, svd->amp, 0); in segvn_purge()
9482 struct seg *seg = (struct seg *)ptag; in segvn_reclaim() local
9483 struct segvn_data *svd = (struct segvn_data *)seg->s_data; in segvn_reclaim()
9492 ASSERT(async || AS_LOCK_HELD(seg->s_as)); in segvn_reclaim()
9535 if (async || AS_ISUNMAPWAIT(seg->s_as)) { in segvn_reclaim()
9536 mutex_enter(&seg->s_as->a_contents); in segvn_reclaim()
9538 AS_SETNOUNMAPWAIT(seg->s_as); in segvn_reclaim()
9540 if (AS_ISUNMAPWAIT(seg->s_as)) { in segvn_reclaim()
9541 AS_CLRUNMAPWAIT(seg->s_as); in segvn_reclaim()
9542 cv_broadcast(&seg->s_as->a_cv); in segvn_reclaim()
9544 mutex_exit(&seg->s_as->a_contents); in segvn_reclaim()
9607 segvn_getmemid(struct seg *seg, caddr_t addr, memid_t *memidp) in segvn_getmemid() argument
9609 struct segvn_data *svd = (struct segvn_data *)seg->s_data; in segvn_getmemid()
9616 memidp->val[0] = (uintptr_t)seg->s_as; in segvn_getmemid()
9625 (uintptr_t)(addr - seg->s_base); in segvn_getmemid()
9629 SEGVN_LOCK_ENTER(seg->s_as, &svd->lock, RW_READER); in segvn_getmemid()
9632 seg_page(seg, addr); in segvn_getmemid()
9634 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_getmemid()
9644 pp = anon_zero(seg, addr, &ap, svd->cred); in segvn_getmemid()
9669 sameprot(struct seg *seg, caddr_t a, size_t len) in sameprot() argument
9671 struct segvn_data *svd = (struct segvn_data *)seg->s_data; in sameprot()
9681 vpage = &svd->vpage[seg_page(seg, a)]; in sameprot()
9697 segvn_getpolicy(struct seg *seg, caddr_t addr) in segvn_getpolicy() argument
9706 ASSERT(seg != NULL); in segvn_getpolicy()
9708 svn_data = (struct segvn_data *)seg->s_data; in segvn_getpolicy()
9725 anon_index = svn_data->anon_index + seg_page(seg, addr); in segvn_getpolicy()
9727 vn_off = svn_data->offset + (uintptr_t)(addr - seg->s_base); in segvn_getpolicy()
9736 segvn_capable(struct seg *seg, segcapability_t capability) in segvn_capable() argument
9753 segvn_textrepl(struct seg *seg) in segvn_textrepl() argument
9755 struct segvn_data *svd = (struct segvn_data *)seg->s_data; in segvn_textrepl()
9758 size_t size = seg->s_size; in segvn_textrepl()
9760 uint_t szc = seg->s_szc; in segvn_textrepl()
9764 proc_t *p = seg->s_as->a_proc; in segvn_textrepl()
9770 ASSERT(AS_LOCK_HELD(seg->s_as)); in segvn_textrepl()
9771 ASSERT(SEGVN_WRITE_HELD(seg->s_as, &svd->lock)); in segvn_textrepl()
9780 ASSERT(seg->s_as != &kas); in segvn_textrepl()
10037 segvn_textunrepl(struct seg *seg, int unload_unmap) in segvn_textunrepl() argument
10039 struct segvn_data *svd = (struct segvn_data *)seg->s_data; in segvn_textunrepl()
10042 size_t size = seg->s_size; in segvn_textunrepl()
10044 uint_t szc = seg->s_szc; in segvn_textunrepl()
10051 ASSERT(AS_LOCK_HELD(seg->s_as)); in segvn_textunrepl()
10052 ASSERT(AS_WRITE_HELD(seg->s_as) || in segvn_textunrepl()
10053 SEGVN_WRITE_HELD(seg->s_as, &svd->lock)); in segvn_textunrepl()
10123 hat_unload_callback(seg->s_as->a_hat, seg->s_base, size, in segvn_textunrepl()
10221 segvn_trupdate_seg(svd->seg, svd, svntrp, in segvn_trupdate()
10230 segvn_trupdate_seg(struct seg *seg, in segvn_trupdate_seg() argument
10244 ASSERT(svd->offset + seg->s_size == svntrp->tr_eoff); in segvn_trupdate_seg()
10245 ASSERT(seg != NULL); in segvn_trupdate_seg()
10246 ASSERT(svd->seg == seg); in segvn_trupdate_seg()
10247 ASSERT(seg->s_data == (void *)svd); in segvn_trupdate_seg()
10248 ASSERT(seg->s_szc == svntrp->tr_szc); in segvn_trupdate_seg()
10259 as = seg->s_as; in segvn_trupdate_seg()
10284 if (!SEGVN_LOCK_TRYENTER(seg->s_as, &svd->lock, RW_WRITER)) { in segvn_trupdate_seg()
10292 size = seg->s_size; in segvn_trupdate_seg()
10296 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_trupdate_seg()
10303 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_trupdate_seg()
10311 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_trupdate_seg()
10319 amp->a_szc = seg->s_szc; in segvn_trupdate_seg()
10331 hat_unload_callback(as->a_hat, seg->s_base, size, 0, NULL); in segvn_trupdate_seg()
10343 SEGVN_LOCK_EXIT(seg->s_as, &svd->lock); in segvn_trupdate_seg()
10350 ASSERT(svd->seg == seg); in segvn_trupdate_seg()