2 * Copyright (c) 2009 Apple Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
29 #include <kern/backtrace.h>
30 #include <vm/vm_map_store_rb.h>
32 RB_GENERATE(rb_head
, vm_map_store
, entry
, rb_node_compare
);
34 #define VME_FOR_STORE( store) \
35 (vm_map_entry_t)(((unsigned long)store) - ((unsigned long)sizeof(struct vm_map_links)))
38 vm_map_store_init_rb( struct vm_map_header
* hdr
)
40 RB_INIT(&(hdr
->rb_head_store
));
43 int rb_node_compare(struct vm_map_store
*node
, struct vm_map_store
*parent
)
48 vme_c
= VME_FOR_STORE(node
);
49 vme_p
= VME_FOR_STORE(parent
);
50 if (vme_c
->vme_start
< vme_p
->vme_start
)
52 if (vme_c
->vme_start
>= vme_p
->vme_end
)
57 void vm_map_store_walk_rb( vm_map_t map
, vm_map_entry_t
*wrong_vme
, vm_map_entry_t
*vm_entry
)
59 struct vm_map_header hdr
= map
->hdr
;
60 struct vm_map_store
*rb_entry
= RB_ROOT(&(hdr
.rb_head_store
));
61 vm_map_entry_t cur
= *vm_entry
;
63 rb_entry
= RB_FIND( rb_head
, &(hdr
.rb_head_store
), &(cur
->store
));
65 panic("NO SUCH ENTRY %p. Gave back %p", *vm_entry
, *wrong_vme
);
67 panic("Cur: %p, L: %p, R: %p", VME_FOR_STORE(rb_entry
), VME_FOR_STORE(RB_LEFT(rb_entry
,entry
)), VME_FOR_STORE(RB_RIGHT(rb_entry
,entry
)));
71 boolean_t
vm_map_store_lookup_entry_rb( vm_map_t map
, vm_map_offset_t address
, vm_map_entry_t
*vm_entry
)
73 struct vm_map_header hdr
= map
->hdr
;
74 struct vm_map_store
*rb_entry
= RB_ROOT(&(hdr
.rb_head_store
));
75 vm_map_entry_t cur
= vm_map_to_entry(map
);
76 vm_map_entry_t prev
= VM_MAP_ENTRY_NULL
;
78 while (rb_entry
!= (struct vm_map_store
*)NULL
) {
79 cur
= VME_FOR_STORE(rb_entry
);
80 if(cur
== VM_MAP_ENTRY_NULL
)
82 if (address
>= cur
->vme_start
) {
83 if (address
< cur
->vme_end
) {
87 rb_entry
= RB_RIGHT(rb_entry
, entry
);
90 rb_entry
= RB_LEFT(rb_entry
, entry
);
93 if( prev
== VM_MAP_ENTRY_NULL
){
94 prev
= vm_map_to_entry(map
);
100 void vm_map_store_entry_link_rb( struct vm_map_header
*mapHdr
, __unused vm_map_entry_t after_where
, vm_map_entry_t entry
)
102 struct rb_head
*rbh
= &(mapHdr
->rb_head_store
);
103 struct vm_map_store
*store
= &(entry
->store
);
104 struct vm_map_store
*tmp_store
;
105 if((tmp_store
= RB_INSERT( rb_head
, rbh
, store
)) != NULL
) {
106 panic("VMSEL: INSERT FAILED: 0x%lx, 0x%lx, 0x%lx, 0x%lx", (uintptr_t)entry
->vme_start
, (uintptr_t)entry
->vme_end
,
107 (uintptr_t)(VME_FOR_STORE(tmp_store
))->vme_start
, (uintptr_t)(VME_FOR_STORE(tmp_store
))->vme_end
);
111 void vm_map_store_entry_unlink_rb( struct vm_map_header
*mapHdr
, vm_map_entry_t entry
)
113 struct rb_head
*rbh
= &(mapHdr
->rb_head_store
);
114 struct vm_map_store
*rb_entry
;
115 struct vm_map_store
*store
= &(entry
->store
);
117 rb_entry
= RB_FIND( rb_head
, rbh
, store
);
119 panic("NO ENTRY TO DELETE");
120 RB_REMOVE( rb_head
, rbh
, store
);
123 void vm_map_store_copy_insert_rb( vm_map_t map
, __unused vm_map_entry_t after_where
, vm_map_copy_t copy
)
125 struct vm_map_header
*mapHdr
= &(map
->hdr
);
126 struct rb_head
*rbh
= &(mapHdr
->rb_head_store
);
127 struct vm_map_store
*store
;
128 vm_map_entry_t entry
= vm_map_copy_first_entry(copy
);
129 int inserted
=0, nentries
= copy
->cpy_hdr
.nentries
;
131 while (entry
!= vm_map_copy_to_entry(copy
) && nentries
> 0) {
132 vm_map_entry_t prev
= entry
;
133 store
= &(entry
->store
);
134 if( RB_INSERT( rb_head
, rbh
, store
) != NULL
){
135 panic("VMSCIR1: INSERT FAILED: %d: %p, %p, %p, 0x%lx, 0x%lx, 0x%lx, 0x%lx, 0x%lx, 0x%lx",inserted
, prev
, entry
, vm_map_copy_to_entry(copy
),
136 (uintptr_t)prev
->vme_start
, (uintptr_t)prev
->vme_end
, (uintptr_t)entry
->vme_start
, (uintptr_t)entry
->vme_end
,
137 (uintptr_t)(VME_FOR_STORE(rbh
->rbh_root
))->vme_start
, (uintptr_t)(VME_FOR_STORE(rbh
->rbh_root
))->vme_end
);
139 #if MAP_ENTRY_INSERTION_DEBUG
140 backtrace(&entry
->vme_insertion_bt
[0],
141 (sizeof (entry
->vme_insertion_bt
) / sizeof (uintptr_t)));
143 entry
= entry
->vme_next
;
151 vm_map_store_copy_reset_rb( vm_map_copy_t copy
, vm_map_entry_t entry
, int nentries
)
153 struct vm_map_header
*mapHdr
= &(copy
->cpy_hdr
);
154 struct rb_head
*rbh
= &(mapHdr
->rb_head_store
);
155 struct vm_map_store
*store
;
158 while (entry
!= vm_map_copy_to_entry(copy
) && nentries
> 0) {
159 store
= &(entry
->store
);
160 RB_REMOVE( rb_head
, rbh
, store
);
161 entry
= entry
->vme_next
;
167 extern zone_t vm_map_holes_zone
; /* zone for vm map holes (vm_map_links) structures */
170 vm_map_combine_hole(vm_map_t map
, vm_map_entry_t hole_entry
);
172 vm_map_combine_hole(__unused vm_map_t map
, vm_map_entry_t hole_entry
)
175 vm_map_entry_t middle_hole_entry
, last_hole_entry
;
177 hole_entry
->vme_end
= hole_entry
->vme_next
->vme_end
;
179 middle_hole_entry
= hole_entry
->vme_next
;
180 last_hole_entry
= middle_hole_entry
->vme_next
;
182 assert(last_hole_entry
->vme_prev
== middle_hole_entry
);
183 assert(middle_hole_entry
->vme_end
!= last_hole_entry
->vme_start
);
185 last_hole_entry
->vme_prev
= hole_entry
;
186 hole_entry
->vme_next
= last_hole_entry
;
188 middle_hole_entry
->vme_prev
= NULL
;
189 middle_hole_entry
->vme_next
= NULL
;
191 zfree(vm_map_holes_zone
, middle_hole_entry
);
193 assert(hole_entry
->vme_start
< hole_entry
->vme_end
);
194 assert(last_hole_entry
->vme_start
< last_hole_entry
->vme_end
);
199 vm_map_delete_hole(vm_map_t map
, vm_map_entry_t hole_entry
);
201 vm_map_delete_hole(vm_map_t map
, vm_map_entry_t hole_entry
)
203 if (hole_entry
== (vm_map_entry_t
) map
->holes_list
) {
205 if (hole_entry
->vme_next
== (vm_map_entry_t
) map
->holes_list
) {
207 map
->holes_list
= NULL
;
208 SAVE_HINT_HOLE_WRITE(map
, NULL
);
211 vm_map_entry_t l_next
, l_prev
;
213 l_next
= (vm_map_entry_t
) map
->holes_list
->next
;
214 l_prev
= (vm_map_entry_t
) map
->holes_list
->prev
;
215 map
->holes_list
= (struct vm_map_links
*) l_next
;
217 l_next
->vme_prev
= l_prev
;
218 l_prev
->vme_next
= l_next
;
220 SAVE_HINT_HOLE_WRITE(map
, (struct vm_map_links
*) l_next
);
224 SAVE_HINT_HOLE_WRITE(map
, (struct vm_map_links
*) hole_entry
->vme_prev
);
226 hole_entry
->vme_prev
->vme_next
= hole_entry
->vme_next
;
227 hole_entry
->vme_next
->vme_prev
= hole_entry
->vme_prev
;
230 hole_entry
->vme_next
= NULL
;
231 hole_entry
->vme_prev
= NULL
;
232 zfree(vm_map_holes_zone
, hole_entry
);
242 check_map_sanity(vm_map_t map
, vm_map_entry_t old_hole_entry
)
244 vm_map_entry_t hole_entry
, next_hole_entry
;
245 vm_map_entry_t map_entry
, next_map_entry
;
247 if (map
->holes_list
== NULL
) {
252 hole_entry
= (vm_map_entry_t
) map
->holes_list
;
253 next_hole_entry
= hole_entry
->vme_next
;
255 map_entry
= vm_map_first_entry(map
);
256 next_map_entry
= map_entry
->vme_next
;
258 while(map_entry
->vme_start
> hole_entry
->vme_start
) {
259 hole_entry
= next_hole_entry
;
260 next_hole_entry
= hole_entry
->vme_next
;
262 if (hole_entry
== (vm_map_entry_t
)map
->holes_list
)
266 while (map_entry
!= vm_map_to_entry(map
)) {
268 if (map_entry
->vme_start
>= map
->max_offset
)
271 if (map_entry
->vme_end
!= map_entry
->vme_next
->vme_start
) {
273 if (map_entry
->vme_next
== vm_map_to_entry(map
))
276 if (hole_entry
->vme_start
!= map_entry
->vme_end
) {
277 panic("hole_entry not aligned %p(0x%llx), %p (0x%llx), %p", hole_entry
, (unsigned long long)hole_entry
->vme_start
, map_entry
->vme_next
, (unsigned long long)map_entry
->vme_end
, old_hole_entry
);
278 assert(hole_entry
->vme_start
== map_entry
->vme_end
);
281 if (hole_entry
->vme_end
!= map_entry
->vme_next
->vme_start
) {
282 panic("hole_entry not next aligned %p(0x%llx), %p (0x%llx), %p", hole_entry
, (unsigned long long)hole_entry
->vme_end
, map_entry
->vme_next
, (unsigned long long)map_entry
->vme_next
->vme_start
, old_hole_entry
);
283 assert(hole_entry
->vme_end
== map_entry
->vme_next
->vme_start
);
286 hole_entry
= next_hole_entry
;
287 next_hole_entry
= hole_entry
->vme_next
;
289 if (hole_entry
== (vm_map_entry_t
)map
->holes_list
)
293 map_entry
= map_entry
->vme_next
;
301 copy_hole_info(vm_map_entry_t hole_entry
, vm_map_entry_t old_hole_entry
)
303 old_hole_entry
->vme_prev
= hole_entry
->vme_prev
;
304 old_hole_entry
->vme_next
= hole_entry
->vme_next
;
305 old_hole_entry
->vme_start
= hole_entry
->vme_start
;
306 old_hole_entry
->vme_end
= hole_entry
->vme_end
;
311 update_holes_on_entry_deletion(vm_map_t map
, vm_map_entry_t old_entry
);
313 update_holes_on_entry_deletion(vm_map_t map
, vm_map_entry_t old_entry
)
316 * Dealing with the deletion of an older entry.
319 vm_map_entry_t hole_entry
, next_hole_entry
;
321 struct vm_map_entry old_hole_entry
;
323 boolean_t create_new_hole
= TRUE
;
325 hole_entry
= (vm_map_entry_t
) map
->hole_hint
;
329 if (hole_entry
->vme_end
== old_entry
->vme_start
) {
331 * Found a hole right after above our entry.
335 } else if (hole_entry
->vme_start
== old_entry
->vme_end
) {
337 if (hole_entry
!= (vm_map_entry_t
) map
->holes_list
) {
340 * Found a hole right after below our entry but
341 * make sure we don't erroneously extend backwards.
346 hole_entry
= hole_entry
->vme_prev
;
349 } else if (hole_entry
->vme_start
> old_entry
->vme_end
) {
352 * Useless hint. Start from the top.
355 hole_entry
= (vm_map_entry_t
) map
->holes_list
;
358 if (hole_entry
!= (vm_map_entry_t
) map
->holes_list
) {
359 if (hole_entry
->vme_start
> old_entry
->vme_start
) {
360 panic("Hole hint failed: Hole entry start: 0x%llx, entry start: 0x%llx, map hole start: 0x%llx, map hint start: 0x%llx\n",
361 (unsigned long long)hole_entry
->vme_start
,
362 (unsigned long long)old_entry
->vme_start
,
363 (unsigned long long)map
->holes_list
->start
,
364 (unsigned long long)map
->hole_hint
->start
);
366 if (hole_entry
->vme_end
> old_entry
->vme_start
) {
367 panic("Hole hint failed: Hole entry end: 0x%llx, entry start: 0x%llx, map hole start: 0x%llx, map hint start: 0x%llx\n",
368 (unsigned long long)hole_entry
->vme_end
,
369 (unsigned long long)old_entry
->vme_start
,
370 (unsigned long long)map
->holes_list
->start
,
371 (unsigned long long)map
->hole_hint
->start
);
377 next_hole_entry
= hole_entry
->vme_next
;
380 * Hole is right above the entry.
382 if (hole_entry
->vme_end
== old_entry
->vme_start
) {
385 copy_hole_info(hole_entry
, &old_hole_entry
);
389 * Is there another hole right below the entry?
390 * Can we combine holes?
393 if (old_entry
->vme_end
== hole_entry
->vme_next
->vme_start
) {
395 vm_map_combine_hole(map
, hole_entry
);
398 hole_entry
->vme_end
= old_entry
->vme_end
;
400 create_new_hole
= FALSE
;
402 check_map_sanity(map
, &old_hole_entry
);
408 * Hole is right below the entry.
410 if (hole_entry
->vme_start
== old_entry
->vme_end
) {
413 copy_hole_info(hole_entry
, &old_hole_entry
);
416 hole_entry
->vme_start
= old_entry
->vme_start
;
417 create_new_hole
= FALSE
;
420 check_map_sanity(map
, &old_hole_entry
);
426 * Hole is beyond our entry. Let's go back to the last hole
427 * before our entry so we have the right place to link up the
428 * new hole that will be needed.
430 if (hole_entry
->vme_start
> old_entry
->vme_end
) {
433 copy_hole_info(hole_entry
, &old_hole_entry
);
436 if (hole_entry
!= (vm_map_entry_t
) map
->holes_list
) {
437 assert(hole_entry
->vme_start
!= old_entry
->vme_start
);
438 hole_entry
= hole_entry
->vme_prev
;
443 hole_entry
= next_hole_entry
;
445 if (hole_entry
== (vm_map_entry_t
)map
->holes_list
) {
446 hole_entry
= hole_entry
->vme_prev
;
452 if (create_new_hole
) {
453 struct vm_map_links
*new_hole_entry
= NULL
;
454 vm_map_entry_t l_next
, l_prev
;
456 new_hole_entry
= zalloc(vm_map_holes_zone
);
459 * First hole in the map?
461 * A hole that is located above the current first hole in the map?
463 if (map
->holes_list
== NULL
|| (hole_entry
== (vm_map_entry_t
) map
->holes_list
&& hole_entry
->vme_start
> old_entry
->vme_start
)) {
465 if (map
->holes_list
== NULL
) {
467 map
->holes_list
= new_hole_entry
;
468 new_hole_entry
->prev
= new_hole_entry
->next
= (vm_map_entry_t
)map
->holes_list
;
471 l_next
= (vm_map_entry_t
) map
->holes_list
;
472 l_prev
= map
->holes_list
->prev
;
473 map
->holes_list
= new_hole_entry
;
474 new_hole_entry
->next
= l_next
;
475 new_hole_entry
->prev
= l_prev
;
477 l_prev
->vme_next
= l_next
->vme_prev
= (vm_map_entry_t
) new_hole_entry
;
481 l_next
= hole_entry
->vme_next
;
482 l_prev
= hole_entry
->vme_next
->vme_prev
;
484 new_hole_entry
->prev
= hole_entry
;
485 new_hole_entry
->next
= l_next
;
487 hole_entry
->vme_next
= (vm_map_entry_t
)new_hole_entry
;
488 l_next
->vme_prev
= (vm_map_entry_t
) new_hole_entry
;
491 new_hole_entry
->start
= old_entry
->vme_start
;
492 new_hole_entry
->end
= old_entry
->vme_end
;
494 hole_entry
= (vm_map_entry_t
) new_hole_entry
;
496 assert(new_hole_entry
->start
< new_hole_entry
->end
);
500 check_map_sanity(map
, &old_hole_entry
);
503 SAVE_HINT_HOLE_WRITE(map
, (struct vm_map_links
*) hole_entry
);
509 update_holes_on_entry_creation(vm_map_t map
, vm_map_entry_t new_entry
);
511 update_holes_on_entry_creation(vm_map_t map
, vm_map_entry_t new_entry
)
514 vm_map_entry_t hole_entry
, next_hole_entry
;
516 struct vm_map_entry old_hole_entry
;
517 vm_map_entry_t tmp_entry
;
518 boolean_t check_map_with_hole_sanity
= TRUE
;
522 * Case A: The entry is aligned exactly with the start and end of the hole.
523 * This will delete the hole.
525 * Case B: The entry is completely within a hole but NOT aligned with the start/end of the hole.
526 * This will split a hole.
528 * Case C: The entry overlaps with the hole. The entry could be extending upwards (C1) or downwards (C2).
529 * This will reduce the size of the hole or delete the hole completely if it is smaller than the entry.
532 hole_entry
= (vm_map_entry_t
) map
->holes_list
;
534 next_hole_entry
= hole_entry
->vme_next
;
540 * If the entry doesn't exist in the RB tree, we are likely dealing with copy maps where
541 * the entries belonging to the copy map are linked into the list of entries silently and
542 * then added to the RB-tree later on.
543 * So sanity checks are useless in that case.
545 check_map_with_hole_sanity
= vm_map_lookup_entry(map
, new_entry
->vme_start
, &tmp_entry
);
548 if (hole_entry
->vme_start
== new_entry
->vme_start
&&
549 hole_entry
->vme_end
== new_entry
->vme_end
) {
553 copy_hole_info(hole_entry
, &old_hole_entry
);
556 if (hole_entry
== (vm_map_entry_t
) map
->holes_list
) {
558 if (hole_entry
->vme_next
== (vm_map_entry_t
) map
->holes_list
) {
560 next_hole_entry
= vm_map_last_entry(map
);
561 assert(next_hole_entry
->vme_end
>= map
->max_offset
);
565 vm_map_delete_hole(map
, hole_entry
);
568 if (check_map_with_hole_sanity
)
569 check_map_sanity(map
, &old_hole_entry
);
573 } else if (hole_entry
->vme_start
< new_entry
->vme_start
&&
574 hole_entry
->vme_end
> new_entry
->vme_end
) {
577 struct vm_map_links
*new_hole_entry
= NULL
;
579 new_hole_entry
= zalloc(vm_map_holes_zone
);
582 copy_hole_info(hole_entry
, &old_hole_entry
);
585 new_hole_entry
->prev
= hole_entry
;
586 new_hole_entry
->next
= hole_entry
->vme_next
;
587 hole_entry
->vme_next
->vme_prev
= (vm_map_entry_t
)new_hole_entry
;
588 hole_entry
->vme_next
= (vm_map_entry_t
)new_hole_entry
;
590 new_hole_entry
->start
= new_entry
->vme_end
;
591 new_hole_entry
->end
= hole_entry
->vme_end
;
592 hole_entry
->vme_end
= new_entry
->vme_start
;
594 assert(hole_entry
->vme_start
< hole_entry
->vme_end
);
595 assert(new_hole_entry
->start
< new_hole_entry
->end
);
598 if (check_map_with_hole_sanity
)
599 check_map_sanity(map
, &old_hole_entry
);
602 SAVE_HINT_HOLE_WRITE(map
, (struct vm_map_links
*) hole_entry
);
605 } else if ((new_entry
->vme_start
<= hole_entry
->vme_start
) && (hole_entry
->vme_start
< new_entry
->vme_end
)) {
608 * Case C1: Entry moving upwards and a part/full hole lies within the bounds of the entry.
612 copy_hole_info(hole_entry
, &old_hole_entry
);
615 if (hole_entry
->vme_end
<= new_entry
->vme_end
) {
617 vm_map_delete_hole(map
, hole_entry
);
619 hole_entry
->vme_start
= new_entry
->vme_end
;
620 SAVE_HINT_HOLE_WRITE(map
, (struct vm_map_links
*) hole_entry
);
624 if (check_map_with_hole_sanity
)
625 check_map_sanity(map
, &old_hole_entry
);
630 } else if ((new_entry
->vme_start
< hole_entry
->vme_end
) && (hole_entry
->vme_end
<= new_entry
->vme_end
)) {
633 * Case C2: Entry moving downwards and a part/full hole lies within the bounds of the entry.
637 copy_hole_info(hole_entry
, &old_hole_entry
);
640 if (hole_entry
->vme_start
>= new_entry
->vme_start
) {
641 vm_map_delete_hole(map
, hole_entry
);
643 hole_entry
->vme_end
= new_entry
->vme_start
;
644 SAVE_HINT_HOLE_WRITE(map
, (struct vm_map_links
*) hole_entry
);
648 if (check_map_with_hole_sanity
)
649 check_map_sanity(map
, &old_hole_entry
);
655 hole_entry
= next_hole_entry
;
656 next_hole_entry
= hole_entry
->vme_next
;
658 if (hole_entry
== (vm_map_entry_t
)map
->holes_list
)
662 panic("Illegal action: h1: %p, s:0x%llx, e:0x%llx...h2:%p, s:0x%llx, e:0x%llx...h3:0x%p, s:0x%llx, e:0x%llx\n",
663 hole_entry
->vme_prev
,
664 (unsigned long long)hole_entry
->vme_prev
->vme_start
,
665 (unsigned long long)hole_entry
->vme_prev
->vme_end
,
667 (unsigned long long)hole_entry
->vme_start
,
668 (unsigned long long)hole_entry
->vme_end
,
669 hole_entry
->vme_next
,
670 (unsigned long long)hole_entry
->vme_next
->vme_start
,
671 (unsigned long long)hole_entry
->vme_next
->vme_end
);
676 update_first_free_rb(vm_map_t map
, vm_map_entry_t entry
, boolean_t new_entry_creation
)
679 if (map
->holelistenabled
) {
682 * Holes can be used to track ranges all the way up to MACH_VM_MAX_ADDRESS or more (e.g. kernel map).
684 vm_map_offset_t max_valid_offset
= (map
->max_offset
> MACH_VM_MAX_ADDRESS
) ? map
->max_offset
: MACH_VM_MAX_ADDRESS
;
687 * Clipping an entry will not result in the creation/deletion/modification of
688 * a hole. Those calls pass NULL for their target entry.
695 * Commpage is pinned beyond the map's max offset. That shouldn't affect the
696 * holes within the bounds of the map.
698 if (vm_map_trunc_page(entry
->vme_start
, VM_MAP_PAGE_MASK(map
)) >= max_valid_offset
) {
706 * - A new entry has already been added to the map
708 * - An older entry has already been deleted from the map
710 * We are updating the hole list after the fact (except in one special case involving copy maps).
714 if (new_entry_creation
) {
716 update_holes_on_entry_creation(map
, entry
);
719 update_holes_on_entry_deletion(map
, entry
);