xref: /xnu-12377.41.6/tests/vm/configurator_vm_behavior_set.c (revision bbb1b6f9e71b8cdde6e5cd6f4841f207dee3d828)
1 /*
2  * Copyright (c) 2024 Apple Inc. All rights reserved.
3  *
4  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5  *
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.
14  *
15  * Please obtain a copy of the License at
16  * http://www.opensource.apple.com/apsl/ and read it before using this file.
17  *
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.
25  *
26  * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27  */
28 
29 /*
30  * vm/configurator_vm_behavior_set.c
31  *
32  * Test vm_behavior_set with many different VM states.
33  */
34 
35 #include "configurator/vm_configurator_tests.h"
36 
37 T_GLOBAL_META(
38 	T_META_NAMESPACE("xnu.vm.configurator"),
39 	T_META_RADAR_COMPONENT_NAME("xnu"),
40 	T_META_RADAR_COMPONENT_VERSION("VM"),
41 	T_META_RUN_CONCURRENTLY(true),
42 	T_META_ASROOT(true),  /* required for vm submap sysctls */
43 	T_META_ALL_VALID_ARCHS(true)
44 	);
45 
46 static void
write_one_memory(checker_list_t * checker_list,vm_entry_checker_t * checker)47 write_one_memory(
48 	checker_list_t *checker_list,
49 	vm_entry_checker_t *checker)
50 {
51 	if (checker->kind == Allocation &&
52 	    prot_contains_all(checker->protection, VM_PROT_READ | VM_PROT_WRITE)) {
53 		checker_fault_for_prot_not_cow(checker_list, checker, VM_PROT_WRITE);
54 		memset((char *)checker->address, 0xff, checker->size);
55 		if (checker->object) {
56 			checker->object->fill_pattern.mode = Fill;
57 			checker->object->fill_pattern.pattern = 0xffffffffffffffff;
58 		}
59 	}
60 }
61 
62 static void
write_memory(checker_list_t * checker_list,mach_vm_address_t start,mach_vm_size_t size)63 write_memory(
64 	checker_list_t *checker_list,
65 	mach_vm_address_t start,
66 	mach_vm_size_t size)
67 {
68 	entry_checker_range_t limit =
69 	    checker_list_find_range_including_holes(checker_list, start, size);
70 	/* TODO: this writes beyond [start, size) */
71 	FOREACH_CHECKER(checker, limit) {
72 		write_one_memory(checker_list, checker);
73 	}
74 }
75 
76 /* Test vm_behavior_set(behavior). This supports several behaviors. */
77 static test_result_t
vm_behavior_common_no_cow(checker_list_t * checker_list,mach_vm_address_t start,mach_vm_size_t size,vm_behavior_t behavior,bool has_holes)78 vm_behavior_common_no_cow(
79 	checker_list_t *checker_list,
80 	mach_vm_address_t start,
81 	mach_vm_size_t size,
82 	vm_behavior_t behavior,
83 	bool has_holes)
84 {
85 	kern_return_t kr;
86 	test_result_t test_results[1];
87 	bool clip, reject_submaps;
88 
89 	kern_return_t expected_kr = KERN_SUCCESS;
90 	if (has_holes) {
91 		expected_kr = KERN_INVALID_ADDRESS;
92 	}
93 
94 	switch (behavior) {
95 	case VM_BEHAVIOR_DEFAULT:
96 		clip = true;
97 		reject_submaps = false;
98 		break;
99 	case VM_BEHAVIOR_FREE:
100 		clip = false;
101 		reject_submaps = false;
102 		break;
103 	case VM_BEHAVIOR_CAN_REUSE:
104 		clip = false;
105 		reject_submaps = true;
106 		break;
107 	default:
108 		T_FAIL("don't know whether to clip with behavior %s",
109 		    name_for_behavior(behavior));
110 		return TestFailed;
111 	}
112 
113 	entry_checker_range_t limit;
114 	if (has_holes) {
115 		limit = checker_list_find_range_including_holes(checker_list, start, size);
116 	} else {
117 		limit = checker_list_find_range(checker_list, start, size);
118 		if (clip) {
119 			checker_clip_left(checker_list, limit.head, start);
120 		}
121 		bool rejected = false;
122 		if (reject_submaps) {
123 			FOREACH_CHECKER(checker, limit) {
124 				if (checker->kind == Submap) {
125 					expected_kr = KERN_INVALID_ADDRESS;
126 					rejected = true;
127 					break;
128 				}
129 			}
130 		}
131 		if (clip) {
132 			checker_clip_right(checker_list, limit.tail, start + size);
133 		}
134 	}
135 
136 	kr = mach_vm_behavior_set(mach_task_self(), start, size, behavior);
137 	if (kr != expected_kr) {
138 		T_FAIL("mach_vm_behavior_set(%s) failed (%s)",
139 		    name_for_behavior(behavior), name_for_kr(kr));
140 		return TestFailed;
141 	}
142 
143 	/* Some behaviors destroy the pages, which affects the fill. */
144 	if (behavior == VM_BEHAVIOR_FREE) {
145 		FOREACH_CHECKER(checker, limit) {
146 			if (checker->object && checker->object->fill_pattern.mode == Fill) {
147 				checker->object->fill_pattern.pattern = 0;
148 				checker->object->fill_pattern.mode = DontFill;
149 			}
150 		}
151 	}
152 
153 	TEMP_CSTRING(when, "after vm_behavior_set(%s)", name_for_behavior(behavior));
154 	test_results[0] = verify_vm_state(checker_list, when);
155 
156 	return worst_result(test_results, countof(test_results));
157 }
158 
159 static test_result_t
vm_behavior_no_cow_maybe_rw_maybe_holes(checker_list_t * checker_list,mach_vm_address_t start,mach_vm_size_t size,vm_behavior_t behavior,bool rw,bool has_holes)160 vm_behavior_no_cow_maybe_rw_maybe_holes(
161 	checker_list_t *checker_list,
162 	mach_vm_address_t start,
163 	mach_vm_size_t size,
164 	vm_behavior_t behavior,
165 	bool rw,
166 	bool has_holes)
167 {
168 	test_result_t result;
169 
170 	result = vm_behavior_common_no_cow(
171 		checker_list, start, size, behavior, has_holes);
172 	if (result != TestSucceeded) {
173 		return result;
174 	}
175 
176 	if (rw) {
177 		/* write to the memory and do it again */
178 		write_memory(checker_list, start, size);
179 		result = verify_vm_state(checker_list, "after write_memory");
180 		if (result != TestSucceeded) {
181 			return result;
182 		}
183 
184 		result = vm_behavior_common_no_cow(
185 			checker_list, start, size, behavior, has_holes);
186 		if (result != TestSucceeded) {
187 			return result;
188 		}
189 	}
190 
191 	return result;
192 }
193 
194 static test_result_t
vm_behavior_default_no_cow_rw_no_holes(checker_list_t * checker_list,mach_vm_address_t start,mach_vm_size_t size)195 vm_behavior_default_no_cow_rw_no_holes(
196 	checker_list_t *checker_list,
197 	mach_vm_address_t start,
198 	mach_vm_size_t size)
199 {
200 	return vm_behavior_no_cow_maybe_rw_maybe_holes(
201 		checker_list, start, size, VM_BEHAVIOR_DEFAULT,
202 		true /* rw */, false /* holes */);
203 }
204 
205 static test_result_t
vm_behavior_default_no_cow_rw_with_holes(checker_list_t * checker_list,mach_vm_address_t start,mach_vm_size_t size)206 vm_behavior_default_no_cow_rw_with_holes(
207 	checker_list_t *checker_list,
208 	mach_vm_address_t start,
209 	mach_vm_size_t size)
210 {
211 	return vm_behavior_no_cow_maybe_rw_maybe_holes(
212 		checker_list, start, size, VM_BEHAVIOR_DEFAULT,
213 		true /* rw */, true /* holes */);
214 }
215 
216 static test_result_t
vm_behavior_default_no_cow_ro_no_holes(checker_list_t * checker_list,mach_vm_address_t start,mach_vm_size_t size)217 vm_behavior_default_no_cow_ro_no_holes(
218 	checker_list_t *checker_list,
219 	mach_vm_address_t start,
220 	mach_vm_size_t size)
221 {
222 	return vm_behavior_no_cow_maybe_rw_maybe_holes(
223 		checker_list, start, size, VM_BEHAVIOR_DEFAULT,
224 		false /* rw */, false /* holes */);
225 }
226 
227 static test_result_t
vm_behavior_default_no_cow_ro_with_holes(checker_list_t * checker_list,mach_vm_address_t start,mach_vm_size_t size)228 vm_behavior_default_no_cow_ro_with_holes(
229 	checker_list_t *checker_list,
230 	mach_vm_address_t start,
231 	mach_vm_size_t size)
232 {
233 	return vm_behavior_no_cow_maybe_rw_maybe_holes(
234 		checker_list, start, size, VM_BEHAVIOR_DEFAULT,
235 		false /* rw */, true /* holes */);
236 }
237 
238 
239 static test_result_t
vm_behavior_free_no_cow_rw_no_holes(checker_list_t * checker_list,mach_vm_address_t start,mach_vm_size_t size)240 vm_behavior_free_no_cow_rw_no_holes(
241 	checker_list_t *checker_list,
242 	mach_vm_address_t start,
243 	mach_vm_size_t size)
244 {
245 	return vm_behavior_no_cow_maybe_rw_maybe_holes(
246 		checker_list, start, size, VM_BEHAVIOR_FREE,
247 		true /* rw */, false /* holes */);
248 }
249 
250 static test_result_t
vm_behavior_free_no_cow_rw_with_holes(checker_list_t * checker_list,mach_vm_address_t start,mach_vm_size_t size)251 vm_behavior_free_no_cow_rw_with_holes(
252 	checker_list_t *checker_list,
253 	mach_vm_address_t start,
254 	mach_vm_size_t size)
255 {
256 	return vm_behavior_no_cow_maybe_rw_maybe_holes(
257 		checker_list, start, size, VM_BEHAVIOR_FREE,
258 		true /* rw */, true /* holes */);
259 }
260 
261 static test_result_t
vm_behavior_free_no_cow_ro_no_holes(checker_list_t * checker_list,mach_vm_address_t start,mach_vm_size_t size)262 vm_behavior_free_no_cow_ro_no_holes(
263 	checker_list_t *checker_list,
264 	mach_vm_address_t start,
265 	mach_vm_size_t size)
266 {
267 	return vm_behavior_no_cow_maybe_rw_maybe_holes(
268 		checker_list, start, size, VM_BEHAVIOR_FREE,
269 		false /* rw */, false /* holes */);
270 }
271 
272 static test_result_t
vm_behavior_free_no_cow_ro_with_holes(checker_list_t * checker_list,mach_vm_address_t start,mach_vm_size_t size)273 vm_behavior_free_no_cow_ro_with_holes(
274 	checker_list_t *checker_list,
275 	mach_vm_address_t start,
276 	mach_vm_size_t size)
277 {
278 	return vm_behavior_no_cow_maybe_rw_maybe_holes(
279 		checker_list, start, size, VM_BEHAVIOR_FREE,
280 		false /* rw */, true /* holes */);
281 }
282 
283 
284 static test_result_t
vm_behavior_can_reuse_no_cow_rw_no_holes(checker_list_t * checker_list,mach_vm_address_t start,mach_vm_size_t size)285 vm_behavior_can_reuse_no_cow_rw_no_holes(
286 	checker_list_t *checker_list,
287 	mach_vm_address_t start,
288 	mach_vm_size_t size)
289 {
290 	return vm_behavior_no_cow_maybe_rw_maybe_holes(
291 		checker_list, start, size, VM_BEHAVIOR_CAN_REUSE,
292 		true /* rw */, false /* holes */);
293 }
294 
295 static test_result_t
vm_behavior_can_reuse_no_cow_rw_with_holes(checker_list_t * checker_list,mach_vm_address_t start,mach_vm_size_t size)296 vm_behavior_can_reuse_no_cow_rw_with_holes(
297 	checker_list_t *checker_list,
298 	mach_vm_address_t start,
299 	mach_vm_size_t size)
300 {
301 	return vm_behavior_no_cow_maybe_rw_maybe_holes(
302 		checker_list, start, size, VM_BEHAVIOR_CAN_REUSE,
303 		true /* rw */, true /* holes */);
304 }
305 
306 static test_result_t
vm_behavior_can_reuse_no_cow_ro_no_holes(checker_list_t * checker_list,mach_vm_address_t start,mach_vm_size_t size)307 vm_behavior_can_reuse_no_cow_ro_no_holes(
308 	checker_list_t *checker_list,
309 	mach_vm_address_t start,
310 	mach_vm_size_t size)
311 {
312 	return vm_behavior_no_cow_maybe_rw_maybe_holes(
313 		checker_list, start, size, VM_BEHAVIOR_CAN_REUSE,
314 		false /* rw */, false /* holes */);
315 }
316 
317 static test_result_t
vm_behavior_can_reuse_no_cow_ro_with_holes(checker_list_t * checker_list,mach_vm_address_t start,mach_vm_size_t size)318 vm_behavior_can_reuse_no_cow_ro_with_holes(
319 	checker_list_t *checker_list,
320 	mach_vm_address_t start,
321 	mach_vm_size_t size)
322 {
323 	return vm_behavior_no_cow_maybe_rw_maybe_holes(
324 		checker_list, start, size, VM_BEHAVIOR_CAN_REUSE,
325 		false /* rw */, true /* holes */);
326 }
327 
328 
329 static test_result_t
vm_behavior_zero_once(checker_list_t * checker_list,mach_vm_address_t start,mach_vm_size_t size,const char * message_suffix)330 vm_behavior_zero_once(
331 	checker_list_t *checker_list,
332 	mach_vm_address_t start,
333 	mach_vm_size_t size,
334 	const char *message_suffix)
335 {
336 	kern_return_t expected_kr = KERN_SUCCESS;
337 	kern_return_t kr;
338 	entry_checker_range_t limit =
339 	    checker_list_find_range_including_holes(checker_list, start, size);
340 
341 	/*
342 	 * vm_behavior_set(ZERO) stops at un-writeable pages
343 	 * so we can't use the common code from other behaviors
344 	 */
345 
346 	if (task_page_size_less_than_vm_page_size()) {
347 		/*
348 		 * VM_BEHAVIOR_ZERO does nothing and returns KERN_NO_ACCESS
349 		 * if the map's page size is less than the VM's page size.
350 		 */
351 		T_LOG("note: VM_BEHAVIOR_ZERO does nothing on this platform");
352 		expected_kr = KERN_NO_ACCESS;
353 		goto checker_update_done;
354 	}
355 
356 	/* Check for holes first. */
357 	FOREACH_CHECKER(checker, limit) {
358 		if (checker->kind == Hole) {
359 			expected_kr = KERN_INVALID_ADDRESS;
360 			goto checker_update_done;
361 		}
362 	}
363 
364 	/* Zero the checkers' fill patterns, stopping if we hit an unacceptable entry */
365 	FOREACH_CHECKER(checker, limit) {
366 		if (!prot_contains_all(checker->protection, VM_PROT_WRITE)) {
367 			/* stop after the first unwriteable entry */
368 			expected_kr = KERN_PROTECTION_FAILURE;
369 			goto checker_update_done;
370 		}
371 		if (checker->kind == Submap) {
372 			/* stop at submaps */
373 			expected_kr = KERN_NO_ACCESS;
374 			goto checker_update_done;
375 		}
376 
377 		/* writeable allocation: memory is now zeros */
378 		if (checker->object && checker->object->fill_pattern.mode == Fill) {
379 			checker->object->fill_pattern.pattern = 0;
380 			checker->object->fill_pattern.mode = DontFill;
381 		}
382 	}
383 
384 checker_update_done:
385 	kr = mach_vm_behavior_set(mach_task_self(), start, size, VM_BEHAVIOR_ZERO);
386 	if (kr != expected_kr) {
387 		T_EXPECT_MACH_ERROR(kr, expected_kr, "mach_vm_behavior_set(VM_BEHAVIOR_ZERO)");
388 		return TestFailed;
389 	}
390 
391 	TEMP_CSTRING(when, "after vm_behavior_set(VM_BEHAVIOR_ZERO) %s", message_suffix);
392 	return verify_vm_state(checker_list, when);
393 }
394 
395 static test_result_t
vm_behavior_zero(checker_list_t * checker_list,mach_vm_address_t start,mach_vm_size_t size)396 vm_behavior_zero(
397 	checker_list_t *checker_list,
398 	mach_vm_address_t start,
399 	mach_vm_size_t size)
400 {
401 	test_result_t result;
402 
403 	result = vm_behavior_zero_once(checker_list, start, size, "first time");
404 	if (result != TestSucceeded) {
405 		return result;
406 	}
407 
408 	/* write to the memory and do it again */
409 	bool any_written = false;
410 	entry_checker_range_t limit = checker_list_find_range_including_holes(checker_list, start, size);
411 	/* TODO: this writes beyond [start, size) */
412 	FOREACH_CHECKER(checker, limit) {
413 		if (checker->kind != Allocation) {
414 			continue;
415 		}
416 		if (prot_contains_all(checker->protection, VM_PROT_READ | VM_PROT_WRITE)) {
417 			any_written = true;
418 			write_one_memory(checker_list, checker);
419 		} else {
420 			/* stop after first unwriteable entry */
421 			break;
422 		}
423 	}
424 
425 	if (any_written) {
426 		result = verify_vm_state(checker_list, "after write_memory");
427 		if (result != TestSucceeded) {
428 			return result;
429 		}
430 
431 		result = vm_behavior_zero_once(checker_list, start, size, "second time");
432 		if (result != TestSucceeded) {
433 			return result;
434 		}
435 	}
436 
437 	return result;
438 }
439 
440 
441 T_DECL(vm_behavior_set_default,
442     "run vm_behavior_set(DEFAULT) with various vm configurations")
443 {
444 	vm_tests_t tests = {
445 		.single_entry_1 = vm_behavior_default_no_cow_rw_no_holes,
446 		.single_entry_2 = vm_behavior_default_no_cow_rw_no_holes,
447 		.single_entry_3 = vm_behavior_default_no_cow_rw_no_holes,
448 		.single_entry_4 = vm_behavior_default_no_cow_rw_no_holes,
449 
450 		.multiple_entries_1 = vm_behavior_default_no_cow_rw_no_holes,
451 		.multiple_entries_2 = vm_behavior_default_no_cow_rw_no_holes,
452 		.multiple_entries_3 = vm_behavior_default_no_cow_rw_no_holes,
453 		.multiple_entries_4 = vm_behavior_default_no_cow_rw_no_holes,
454 		.multiple_entries_5 = vm_behavior_default_no_cow_rw_no_holes,
455 		.multiple_entries_6 = vm_behavior_default_no_cow_rw_no_holes,
456 
457 		.some_holes_1 = vm_behavior_default_no_cow_rw_with_holes,
458 		.some_holes_2 = vm_behavior_default_no_cow_rw_with_holes,
459 		.some_holes_3 = vm_behavior_default_no_cow_rw_with_holes,
460 		.some_holes_4 = vm_behavior_default_no_cow_rw_with_holes,
461 		.some_holes_5 = vm_behavior_default_no_cow_rw_with_holes,
462 		.some_holes_6 = vm_behavior_default_no_cow_rw_with_holes,
463 		.some_holes_7 = vm_behavior_default_no_cow_rw_with_holes,
464 		.some_holes_8 = vm_behavior_default_no_cow_rw_with_holes,
465 		.some_holes_9 = vm_behavior_default_no_cow_rw_with_holes,
466 		.some_holes_10 = vm_behavior_default_no_cow_rw_with_holes,
467 		.some_holes_11 = vm_behavior_default_no_cow_rw_with_holes,
468 		.some_holes_12 = vm_behavior_default_no_cow_rw_with_holes,
469 
470 		.all_holes_1 = vm_behavior_default_no_cow_rw_with_holes,
471 		.all_holes_2 = vm_behavior_default_no_cow_rw_with_holes,
472 		.all_holes_3 = vm_behavior_default_no_cow_rw_with_holes,
473 		.all_holes_4 = vm_behavior_default_no_cow_rw_with_holes,
474 
475 		.null_entry        = vm_behavior_default_no_cow_rw_no_holes,
476 		.nonresident_entry = vm_behavior_default_no_cow_rw_no_holes,
477 		.resident_entry    = vm_behavior_default_no_cow_rw_no_holes,
478 
479 		.shared_entry               = test_is_unimplemented,
480 		.shared_entry_discontiguous = test_is_unimplemented,
481 		.shared_entry_partial       = test_is_unimplemented,
482 		.shared_entry_pairs         = test_is_unimplemented,
483 		.shared_entry_x1000         = test_is_unimplemented,
484 
485 		.cow_entry = test_is_unimplemented,
486 		.cow_unreferenced = test_is_unimplemented,
487 		.cow_nocow = test_is_unimplemented,
488 		.nocow_cow = test_is_unimplemented,
489 		.cow_unreadable = test_is_unimplemented,
490 		.cow_unwriteable = test_is_unimplemented,
491 
492 		.permanent_entry = vm_behavior_default_no_cow_rw_no_holes,
493 		.permanent_before_permanent = vm_behavior_default_no_cow_rw_no_holes,
494 		.permanent_before_allocation = vm_behavior_default_no_cow_rw_no_holes,
495 		.permanent_before_allocation_2 = vm_behavior_default_no_cow_rw_no_holes,
496 		.permanent_before_hole = vm_behavior_default_no_cow_rw_with_holes,
497 		.permanent_after_allocation = vm_behavior_default_no_cow_rw_no_holes,
498 		.permanent_after_hole = vm_behavior_default_no_cow_rw_with_holes,
499 
500 		.single_submap_single_entry = vm_behavior_default_no_cow_rw_no_holes,
501 		.single_submap_single_entry_first_pages = vm_behavior_default_no_cow_rw_no_holes,
502 		.single_submap_single_entry_last_pages = vm_behavior_default_no_cow_rw_no_holes,
503 		.single_submap_single_entry_middle_pages = vm_behavior_default_no_cow_rw_no_holes,
504 		.single_submap_oversize_entry_at_start = vm_behavior_default_no_cow_rw_no_holes,
505 		.single_submap_oversize_entry_at_end = vm_behavior_default_no_cow_rw_no_holes,
506 		.single_submap_oversize_entry_at_both = vm_behavior_default_no_cow_rw_no_holes,
507 
508 		.submap_before_allocation = vm_behavior_default_no_cow_rw_no_holes,
509 		.submap_after_allocation = vm_behavior_default_no_cow_rw_no_holes,
510 		.submap_before_hole = vm_behavior_default_no_cow_rw_with_holes,
511 		.submap_after_hole = vm_behavior_default_no_cow_rw_with_holes,
512 		.submap_allocation_submap_one_entry = vm_behavior_default_no_cow_rw_no_holes,
513 		.submap_allocation_submap_two_entries = vm_behavior_default_no_cow_rw_no_holes,
514 		.submap_allocation_submap_three_entries = vm_behavior_default_no_cow_rw_no_holes,
515 
516 		.submap_before_allocation_ro = vm_behavior_default_no_cow_ro_no_holes,
517 		.submap_after_allocation_ro = vm_behavior_default_no_cow_ro_no_holes,
518 		.submap_before_hole_ro = vm_behavior_default_no_cow_ro_with_holes,
519 		.submap_after_hole_ro = vm_behavior_default_no_cow_ro_with_holes,
520 		.submap_allocation_submap_one_entry_ro = vm_behavior_default_no_cow_ro_no_holes,
521 		.submap_allocation_submap_two_entries_ro = vm_behavior_default_no_cow_ro_no_holes,
522 		.submap_allocation_submap_three_entries_ro = vm_behavior_default_no_cow_ro_no_holes,
523 
524 		.protection_single_000_000 = vm_behavior_default_no_cow_ro_no_holes,
525 		.protection_single_000_r00 = vm_behavior_default_no_cow_ro_no_holes,
526 		.protection_single_r00_r00 = vm_behavior_default_no_cow_ro_no_holes,
527 		.protection_single_000_0w0 = vm_behavior_default_no_cow_ro_no_holes,
528 		.protection_single_0w0_0w0 = vm_behavior_default_no_cow_ro_no_holes,
529 		.protection_single_000_rw0 = vm_behavior_default_no_cow_ro_no_holes,
530 		.protection_single_r00_rw0 = vm_behavior_default_no_cow_ro_no_holes,
531 		.protection_single_0w0_rw0 = vm_behavior_default_no_cow_ro_no_holes,
532 		.protection_single_rw0_rw0 = vm_behavior_default_no_cow_rw_no_holes,
533 
534 		.protection_pairs_000_000 = vm_behavior_default_no_cow_ro_no_holes,
535 		.protection_pairs_000_r00 = vm_behavior_default_no_cow_ro_no_holes,
536 		.protection_pairs_000_0w0 = vm_behavior_default_no_cow_ro_no_holes,
537 		.protection_pairs_000_rw0 = vm_behavior_default_no_cow_ro_no_holes,
538 		.protection_pairs_r00_000 = vm_behavior_default_no_cow_ro_no_holes,
539 		.protection_pairs_r00_r00 = vm_behavior_default_no_cow_ro_no_holes,
540 		.protection_pairs_r00_0w0 = vm_behavior_default_no_cow_ro_no_holes,
541 		.protection_pairs_r00_rw0 = vm_behavior_default_no_cow_ro_no_holes,
542 		.protection_pairs_0w0_000 = vm_behavior_default_no_cow_ro_no_holes,
543 		.protection_pairs_0w0_r00 = vm_behavior_default_no_cow_ro_no_holes,
544 		.protection_pairs_0w0_0w0 = vm_behavior_default_no_cow_ro_no_holes,
545 		.protection_pairs_0w0_rw0 = vm_behavior_default_no_cow_ro_no_holes,
546 		.protection_pairs_rw0_000 = vm_behavior_default_no_cow_ro_no_holes,
547 		.protection_pairs_rw0_r00 = vm_behavior_default_no_cow_ro_no_holes,
548 		.protection_pairs_rw0_0w0 = vm_behavior_default_no_cow_ro_no_holes,
549 		.protection_pairs_rw0_rw0 = vm_behavior_default_no_cow_rw_no_holes,
550 	};
551 
552 	run_vm_tests("vm_behavior_set_default", __FILE__, &tests, argc, argv);
553 }
554 
555 
556 T_DECL(vm_behavior_set_free,
557     "run vm_behavior_set(FREE) with various vm configurations")
558 {
559 	vm_tests_t tests = {
560 		.single_entry_1 = vm_behavior_free_no_cow_rw_no_holes,
561 		.single_entry_2 = vm_behavior_free_no_cow_rw_no_holes,
562 		.single_entry_3 = vm_behavior_free_no_cow_rw_no_holes,
563 		.single_entry_4 = vm_behavior_free_no_cow_rw_no_holes,
564 
565 		.multiple_entries_1 = vm_behavior_free_no_cow_rw_no_holes,
566 		.multiple_entries_2 = vm_behavior_free_no_cow_rw_no_holes,
567 		.multiple_entries_3 = vm_behavior_free_no_cow_rw_no_holes,
568 		.multiple_entries_4 = vm_behavior_free_no_cow_rw_no_holes,
569 		.multiple_entries_5 = vm_behavior_free_no_cow_rw_no_holes,
570 		.multiple_entries_6 = vm_behavior_free_no_cow_rw_no_holes,
571 
572 		.some_holes_1 = vm_behavior_free_no_cow_rw_with_holes,
573 		.some_holes_2 = vm_behavior_free_no_cow_rw_with_holes,
574 		.some_holes_3 = vm_behavior_free_no_cow_rw_with_holes,
575 		.some_holes_4 = vm_behavior_free_no_cow_rw_with_holes,
576 		.some_holes_5 = vm_behavior_free_no_cow_rw_with_holes,
577 		.some_holes_6 = vm_behavior_free_no_cow_rw_with_holes,
578 		.some_holes_7 = vm_behavior_free_no_cow_rw_with_holes,
579 		.some_holes_8 = vm_behavior_free_no_cow_rw_with_holes,
580 		.some_holes_9 = vm_behavior_free_no_cow_rw_with_holes,
581 		.some_holes_10 = vm_behavior_free_no_cow_rw_with_holes,
582 		.some_holes_11 = vm_behavior_free_no_cow_rw_with_holes,
583 		.some_holes_12 = vm_behavior_free_no_cow_rw_with_holes,
584 
585 		.all_holes_1 = vm_behavior_free_no_cow_rw_with_holes,
586 		.all_holes_2 = vm_behavior_free_no_cow_rw_with_holes,
587 		.all_holes_3 = vm_behavior_free_no_cow_rw_with_holes,
588 		.all_holes_4 = vm_behavior_free_no_cow_rw_with_holes,
589 
590 		.null_entry        = vm_behavior_free_no_cow_rw_no_holes,
591 		.nonresident_entry = vm_behavior_free_no_cow_rw_no_holes,
592 		.resident_entry    = vm_behavior_free_no_cow_rw_no_holes,
593 
594 		.shared_entry               = test_is_unimplemented,
595 		.shared_entry_discontiguous = test_is_unimplemented,
596 		.shared_entry_partial       = test_is_unimplemented,
597 		.shared_entry_pairs         = test_is_unimplemented,
598 		.shared_entry_x1000         = test_is_unimplemented,
599 
600 		.cow_entry = test_is_unimplemented,
601 		.cow_unreferenced = test_is_unimplemented,
602 		.cow_nocow = test_is_unimplemented,
603 		.nocow_cow = test_is_unimplemented,
604 		.cow_unreadable = test_is_unimplemented,
605 		.cow_unwriteable = test_is_unimplemented,
606 
607 		.permanent_entry = vm_behavior_free_no_cow_rw_no_holes,
608 		.permanent_before_permanent = vm_behavior_free_no_cow_rw_no_holes,
609 		.permanent_before_allocation = vm_behavior_free_no_cow_rw_no_holes,
610 		.permanent_before_allocation_2 = vm_behavior_free_no_cow_rw_no_holes,
611 		.permanent_before_hole = vm_behavior_free_no_cow_rw_with_holes,
612 		.permanent_after_allocation = vm_behavior_free_no_cow_rw_no_holes,
613 		.permanent_after_hole = vm_behavior_free_no_cow_rw_with_holes,
614 
615 		.single_submap_single_entry = vm_behavior_free_no_cow_rw_no_holes,
616 		.single_submap_single_entry_first_pages = vm_behavior_free_no_cow_rw_no_holes,
617 		.single_submap_single_entry_last_pages = vm_behavior_free_no_cow_rw_no_holes,
618 		.single_submap_single_entry_middle_pages = vm_behavior_free_no_cow_rw_no_holes,
619 		.single_submap_oversize_entry_at_start = vm_behavior_free_no_cow_rw_no_holes,
620 		.single_submap_oversize_entry_at_end = vm_behavior_free_no_cow_rw_no_holes,
621 		.single_submap_oversize_entry_at_both = vm_behavior_free_no_cow_rw_no_holes,
622 
623 		.submap_before_allocation = vm_behavior_free_no_cow_rw_no_holes,
624 		.submap_after_allocation = vm_behavior_free_no_cow_rw_no_holes,
625 		.submap_before_hole = vm_behavior_free_no_cow_rw_with_holes,
626 		.submap_after_hole = vm_behavior_free_no_cow_rw_with_holes,
627 		.submap_allocation_submap_one_entry = vm_behavior_free_no_cow_rw_no_holes,
628 		.submap_allocation_submap_two_entries = vm_behavior_free_no_cow_rw_no_holes,
629 		.submap_allocation_submap_three_entries = vm_behavior_free_no_cow_rw_no_holes,
630 
631 		.submap_before_allocation_ro = vm_behavior_free_no_cow_ro_no_holes,
632 		.submap_after_allocation_ro = vm_behavior_free_no_cow_ro_no_holes,
633 		.submap_before_hole_ro = vm_behavior_free_no_cow_ro_with_holes,
634 		.submap_after_hole_ro = vm_behavior_free_no_cow_ro_with_holes,
635 		.submap_allocation_submap_one_entry_ro = vm_behavior_free_no_cow_ro_no_holes,
636 		.submap_allocation_submap_two_entries_ro = vm_behavior_free_no_cow_ro_no_holes,
637 		.submap_allocation_submap_three_entries_ro = vm_behavior_free_no_cow_ro_no_holes,
638 
639 		.protection_single_000_000 = vm_behavior_free_no_cow_ro_no_holes,
640 		.protection_single_000_r00 = vm_behavior_free_no_cow_ro_no_holes,
641 		.protection_single_r00_r00 = vm_behavior_free_no_cow_ro_no_holes,
642 		.protection_single_000_0w0 = vm_behavior_free_no_cow_ro_no_holes,
643 		.protection_single_0w0_0w0 = vm_behavior_free_no_cow_ro_no_holes,
644 		.protection_single_000_rw0 = vm_behavior_free_no_cow_ro_no_holes,
645 		.protection_single_r00_rw0 = vm_behavior_free_no_cow_ro_no_holes,
646 		.protection_single_0w0_rw0 = vm_behavior_free_no_cow_ro_no_holes,
647 		.protection_single_rw0_rw0 = vm_behavior_free_no_cow_rw_no_holes,
648 
649 		.protection_pairs_000_000 = vm_behavior_free_no_cow_ro_no_holes,
650 		.protection_pairs_000_r00 = vm_behavior_free_no_cow_ro_no_holes,
651 		.protection_pairs_000_0w0 = vm_behavior_free_no_cow_ro_no_holes,
652 		.protection_pairs_000_rw0 = vm_behavior_free_no_cow_ro_no_holes,
653 		.protection_pairs_r00_000 = vm_behavior_free_no_cow_ro_no_holes,
654 		.protection_pairs_r00_r00 = vm_behavior_free_no_cow_ro_no_holes,
655 		.protection_pairs_r00_0w0 = vm_behavior_free_no_cow_ro_no_holes,
656 		.protection_pairs_r00_rw0 = vm_behavior_free_no_cow_ro_no_holes,
657 		.protection_pairs_0w0_000 = vm_behavior_free_no_cow_ro_no_holes,
658 		.protection_pairs_0w0_r00 = vm_behavior_free_no_cow_ro_no_holes,
659 		.protection_pairs_0w0_0w0 = vm_behavior_free_no_cow_ro_no_holes,
660 		.protection_pairs_0w0_rw0 = vm_behavior_free_no_cow_ro_no_holes,
661 		.protection_pairs_rw0_000 = vm_behavior_free_no_cow_ro_no_holes,
662 		.protection_pairs_rw0_r00 = vm_behavior_free_no_cow_ro_no_holes,
663 		.protection_pairs_rw0_0w0 = vm_behavior_free_no_cow_ro_no_holes,
664 		.protection_pairs_rw0_rw0 = vm_behavior_free_no_cow_rw_no_holes,
665 	};
666 
667 	run_vm_tests("vm_behavior_set_free", __FILE__, &tests, argc, argv);
668 }
669 
670 
671 T_DECL(vm_behavior_set_can_reuse,
672     "run vm_behavior_set(CAN_REUSE) with various vm configurations")
673 {
674 	if (isRosetta()) {
675 		/*
676 		 * CAN_REUSE requires vm_object page alignment,
677 		 * but Rosetta is less aligned than that and
678 		 * these tests don't yet have a way to adapt.
679 		 */
680 		T_PASS("warning: TODO wrong alignment for vm_behavior_set(CAN_REUSE) "
681 		    "on Rosetta; just passing instead");
682 		return;
683 	}
684 
685 	vm_tests_t tests = {
686 		.single_entry_1 = vm_behavior_can_reuse_no_cow_rw_no_holes,
687 		.single_entry_2 = vm_behavior_can_reuse_no_cow_rw_no_holes,
688 		.single_entry_3 = vm_behavior_can_reuse_no_cow_rw_no_holes,
689 		.single_entry_4 = vm_behavior_can_reuse_no_cow_rw_no_holes,
690 
691 		.multiple_entries_1 = vm_behavior_can_reuse_no_cow_rw_no_holes,
692 		.multiple_entries_2 = vm_behavior_can_reuse_no_cow_rw_no_holes,
693 		.multiple_entries_3 = vm_behavior_can_reuse_no_cow_rw_no_holes,
694 		.multiple_entries_4 = vm_behavior_can_reuse_no_cow_rw_no_holes,
695 		.multiple_entries_5 = vm_behavior_can_reuse_no_cow_rw_no_holes,
696 		.multiple_entries_6 = vm_behavior_can_reuse_no_cow_rw_no_holes,
697 
698 		.some_holes_1 = vm_behavior_can_reuse_no_cow_rw_with_holes,
699 		.some_holes_2 = vm_behavior_can_reuse_no_cow_rw_with_holes,
700 		.some_holes_3 = vm_behavior_can_reuse_no_cow_rw_with_holes,
701 		.some_holes_4 = vm_behavior_can_reuse_no_cow_rw_with_holes,
702 		.some_holes_5 = vm_behavior_can_reuse_no_cow_rw_with_holes,
703 		.some_holes_6 = vm_behavior_can_reuse_no_cow_rw_with_holes,
704 		.some_holes_7 = vm_behavior_can_reuse_no_cow_rw_with_holes,
705 		.some_holes_8 = vm_behavior_can_reuse_no_cow_rw_with_holes,
706 		.some_holes_9 = vm_behavior_can_reuse_no_cow_rw_with_holes,
707 		.some_holes_10 = vm_behavior_can_reuse_no_cow_rw_with_holes,
708 		.some_holes_11 = vm_behavior_can_reuse_no_cow_rw_with_holes,
709 		.some_holes_12 = vm_behavior_can_reuse_no_cow_rw_with_holes,
710 
711 		.all_holes_1 = vm_behavior_can_reuse_no_cow_rw_with_holes,
712 		.all_holes_2 = vm_behavior_can_reuse_no_cow_rw_with_holes,
713 		.all_holes_3 = vm_behavior_can_reuse_no_cow_rw_with_holes,
714 		.all_holes_4 = vm_behavior_can_reuse_no_cow_rw_with_holes,
715 
716 		.null_entry        = vm_behavior_can_reuse_no_cow_rw_no_holes,
717 		.nonresident_entry = vm_behavior_can_reuse_no_cow_rw_no_holes,
718 		.resident_entry    = vm_behavior_can_reuse_no_cow_rw_no_holes,
719 
720 		.shared_entry               = test_is_unimplemented,
721 		.shared_entry_discontiguous = test_is_unimplemented,
722 		.shared_entry_partial       = test_is_unimplemented,
723 		.shared_entry_pairs         = test_is_unimplemented,
724 		.shared_entry_x1000         = test_is_unimplemented,
725 
726 		.cow_entry = test_is_unimplemented,
727 		.cow_unreferenced = test_is_unimplemented,
728 		.cow_nocow = test_is_unimplemented,
729 		.nocow_cow = test_is_unimplemented,
730 		.cow_unreadable = test_is_unimplemented,
731 		.cow_unwriteable = test_is_unimplemented,
732 
733 		.permanent_entry = vm_behavior_can_reuse_no_cow_rw_no_holes,
734 		.permanent_before_permanent = vm_behavior_can_reuse_no_cow_rw_no_holes,
735 		.permanent_before_allocation = vm_behavior_can_reuse_no_cow_rw_no_holes,
736 		.permanent_before_allocation_2 = vm_behavior_can_reuse_no_cow_rw_no_holes,
737 		.permanent_before_hole = vm_behavior_can_reuse_no_cow_rw_with_holes,
738 		.permanent_after_allocation = vm_behavior_can_reuse_no_cow_rw_no_holes,
739 		.permanent_after_hole = vm_behavior_can_reuse_no_cow_rw_with_holes,
740 
741 		.single_submap_single_entry = vm_behavior_can_reuse_no_cow_rw_no_holes,
742 		.single_submap_single_entry_first_pages = vm_behavior_can_reuse_no_cow_rw_no_holes,
743 		.single_submap_single_entry_last_pages = vm_behavior_can_reuse_no_cow_rw_no_holes,
744 		.single_submap_single_entry_middle_pages = vm_behavior_can_reuse_no_cow_rw_no_holes,
745 		.single_submap_oversize_entry_at_start = vm_behavior_can_reuse_no_cow_rw_no_holes,
746 		.single_submap_oversize_entry_at_end = vm_behavior_can_reuse_no_cow_rw_no_holes,
747 		.single_submap_oversize_entry_at_both = vm_behavior_can_reuse_no_cow_rw_no_holes,
748 
749 		.submap_before_allocation = vm_behavior_can_reuse_no_cow_rw_no_holes,
750 		.submap_after_allocation = vm_behavior_can_reuse_no_cow_rw_no_holes,
751 		.submap_before_hole = vm_behavior_can_reuse_no_cow_rw_with_holes,
752 		.submap_after_hole = vm_behavior_can_reuse_no_cow_rw_with_holes,
753 		.submap_allocation_submap_one_entry = vm_behavior_can_reuse_no_cow_rw_no_holes,
754 		.submap_allocation_submap_two_entries = vm_behavior_can_reuse_no_cow_rw_no_holes,
755 		.submap_allocation_submap_three_entries = vm_behavior_can_reuse_no_cow_rw_no_holes,
756 
757 		.submap_before_allocation_ro = vm_behavior_can_reuse_no_cow_ro_no_holes,
758 		.submap_after_allocation_ro = vm_behavior_can_reuse_no_cow_ro_no_holes,
759 		.submap_before_hole_ro = vm_behavior_can_reuse_no_cow_ro_with_holes,
760 		.submap_after_hole_ro = vm_behavior_can_reuse_no_cow_ro_with_holes,
761 		.submap_allocation_submap_one_entry_ro = vm_behavior_can_reuse_no_cow_ro_no_holes,
762 		.submap_allocation_submap_two_entries_ro = vm_behavior_can_reuse_no_cow_ro_no_holes,
763 		.submap_allocation_submap_three_entries_ro = vm_behavior_can_reuse_no_cow_ro_no_holes,
764 
765 		.protection_single_000_000 = vm_behavior_can_reuse_no_cow_ro_no_holes,
766 		.protection_single_000_r00 = vm_behavior_can_reuse_no_cow_ro_no_holes,
767 		.protection_single_r00_r00 = vm_behavior_can_reuse_no_cow_ro_no_holes,
768 		.protection_single_000_0w0 = vm_behavior_can_reuse_no_cow_ro_no_holes,
769 		.protection_single_0w0_0w0 = vm_behavior_can_reuse_no_cow_ro_no_holes,
770 		.protection_single_000_rw0 = vm_behavior_can_reuse_no_cow_ro_no_holes,
771 		.protection_single_r00_rw0 = vm_behavior_can_reuse_no_cow_ro_no_holes,
772 		.protection_single_0w0_rw0 = vm_behavior_can_reuse_no_cow_ro_no_holes,
773 		.protection_single_rw0_rw0 = vm_behavior_can_reuse_no_cow_rw_no_holes,
774 
775 		.protection_pairs_000_000 = vm_behavior_can_reuse_no_cow_ro_no_holes,
776 		.protection_pairs_000_r00 = vm_behavior_can_reuse_no_cow_ro_no_holes,
777 		.protection_pairs_000_0w0 = vm_behavior_can_reuse_no_cow_ro_no_holes,
778 		.protection_pairs_000_rw0 = vm_behavior_can_reuse_no_cow_ro_no_holes,
779 		.protection_pairs_r00_000 = vm_behavior_can_reuse_no_cow_ro_no_holes,
780 		.protection_pairs_r00_r00 = vm_behavior_can_reuse_no_cow_ro_no_holes,
781 		.protection_pairs_r00_0w0 = vm_behavior_can_reuse_no_cow_ro_no_holes,
782 		.protection_pairs_r00_rw0 = vm_behavior_can_reuse_no_cow_ro_no_holes,
783 		.protection_pairs_0w0_000 = vm_behavior_can_reuse_no_cow_ro_no_holes,
784 		.protection_pairs_0w0_r00 = vm_behavior_can_reuse_no_cow_ro_no_holes,
785 		.protection_pairs_0w0_0w0 = vm_behavior_can_reuse_no_cow_ro_no_holes,
786 		.protection_pairs_0w0_rw0 = vm_behavior_can_reuse_no_cow_ro_no_holes,
787 		.protection_pairs_rw0_000 = vm_behavior_can_reuse_no_cow_ro_no_holes,
788 		.protection_pairs_rw0_r00 = vm_behavior_can_reuse_no_cow_ro_no_holes,
789 		.protection_pairs_rw0_0w0 = vm_behavior_can_reuse_no_cow_ro_no_holes,
790 		.protection_pairs_rw0_rw0 = vm_behavior_can_reuse_no_cow_rw_no_holes,
791 	};
792 
793 	run_vm_tests("vm_behavior_set_can_reuse", __FILE__, &tests, argc, argv);
794 }
795 
796 
797 T_DECL(vm_behavior_set_zero,
798     "run vm_behavior_set(ZERO) with various vm configurations")
799 {
800 	vm_tests_t tests = {
801 		.single_entry_1 = vm_behavior_zero,
802 		.single_entry_2 = vm_behavior_zero,
803 		.single_entry_3 = vm_behavior_zero,
804 		.single_entry_4 = vm_behavior_zero,
805 
806 		.multiple_entries_1 = vm_behavior_zero,
807 		.multiple_entries_2 = vm_behavior_zero,
808 		.multiple_entries_3 = vm_behavior_zero,
809 		.multiple_entries_4 = vm_behavior_zero,
810 		.multiple_entries_5 = vm_behavior_zero,
811 		.multiple_entries_6 = vm_behavior_zero,
812 
813 		.some_holes_1 = vm_behavior_zero,
814 		.some_holes_2 = vm_behavior_zero,
815 		.some_holes_3 = vm_behavior_zero,
816 		.some_holes_4 = vm_behavior_zero,
817 		.some_holes_5 = vm_behavior_zero,
818 		.some_holes_6 = vm_behavior_zero,
819 		.some_holes_7 = vm_behavior_zero,
820 		.some_holes_8 = vm_behavior_zero,
821 		.some_holes_9 = vm_behavior_zero,
822 		.some_holes_10 = vm_behavior_zero,
823 		.some_holes_11 = vm_behavior_zero,
824 		.some_holes_12 = vm_behavior_zero,
825 
826 		.all_holes_1 = vm_behavior_zero,
827 		.all_holes_2 = vm_behavior_zero,
828 		.all_holes_3 = vm_behavior_zero,
829 		.all_holes_4 = vm_behavior_zero,
830 
831 		.null_entry        = vm_behavior_zero,
832 		.nonresident_entry = vm_behavior_zero,
833 		.resident_entry    = vm_behavior_zero,
834 
835 		.shared_entry               = test_is_unimplemented,
836 		.shared_entry_discontiguous = test_is_unimplemented,
837 		.shared_entry_partial       = test_is_unimplemented,
838 		.shared_entry_pairs         = test_is_unimplemented,
839 		.shared_entry_x1000         = test_is_unimplemented,
840 
841 		.cow_entry = test_is_unimplemented,
842 		.cow_unreferenced = test_is_unimplemented,
843 		.cow_nocow = test_is_unimplemented,
844 		.nocow_cow = test_is_unimplemented,
845 		.cow_unreadable = test_is_unimplemented,
846 		.cow_unwriteable = test_is_unimplemented,
847 
848 		.permanent_entry = vm_behavior_zero,
849 		.permanent_before_permanent = vm_behavior_zero,
850 		.permanent_before_allocation = vm_behavior_zero,
851 		.permanent_before_allocation_2 = vm_behavior_zero,
852 		.permanent_before_hole = vm_behavior_zero,
853 		.permanent_after_allocation = vm_behavior_zero,
854 		.permanent_after_hole = vm_behavior_zero,
855 
856 		.single_submap_single_entry = vm_behavior_zero,
857 		.single_submap_single_entry_first_pages = vm_behavior_zero,
858 		.single_submap_single_entry_last_pages = vm_behavior_zero,
859 		.single_submap_single_entry_middle_pages = vm_behavior_zero,
860 		.single_submap_oversize_entry_at_start = vm_behavior_zero,
861 		.single_submap_oversize_entry_at_end = vm_behavior_zero,
862 		.single_submap_oversize_entry_at_both = vm_behavior_zero,
863 
864 		.submap_before_allocation = vm_behavior_zero,
865 		.submap_after_allocation = vm_behavior_zero,
866 		.submap_before_hole = vm_behavior_zero,
867 		.submap_after_hole = vm_behavior_zero,
868 		.submap_allocation_submap_one_entry = vm_behavior_zero,
869 		.submap_allocation_submap_two_entries = vm_behavior_zero,
870 		.submap_allocation_submap_three_entries = vm_behavior_zero,
871 
872 		.submap_before_allocation_ro = vm_behavior_zero,
873 		.submap_after_allocation_ro = vm_behavior_zero,
874 		.submap_before_hole_ro = vm_behavior_zero,
875 		.submap_after_hole_ro = vm_behavior_zero,
876 		.submap_allocation_submap_one_entry_ro = vm_behavior_zero,
877 		.submap_allocation_submap_two_entries_ro = vm_behavior_zero,
878 		.submap_allocation_submap_three_entries_ro = vm_behavior_zero,
879 
880 		.protection_single_000_000 = vm_behavior_zero,
881 		.protection_single_000_r00 = vm_behavior_zero,
882 		.protection_single_r00_r00 = vm_behavior_zero,
883 		.protection_single_000_0w0 = vm_behavior_zero,
884 		.protection_single_0w0_0w0 = vm_behavior_zero,
885 		.protection_single_000_rw0 = vm_behavior_zero,
886 		.protection_single_r00_rw0 = vm_behavior_zero,
887 		.protection_single_0w0_rw0 = vm_behavior_zero,
888 		.protection_single_rw0_rw0 = vm_behavior_zero,
889 
890 		.protection_pairs_000_000 = vm_behavior_zero,
891 		.protection_pairs_000_r00 = vm_behavior_zero,
892 		.protection_pairs_000_0w0 = vm_behavior_zero,
893 		.protection_pairs_000_rw0 = vm_behavior_zero,
894 		.protection_pairs_r00_000 = vm_behavior_zero,
895 		.protection_pairs_r00_r00 = vm_behavior_zero,
896 		.protection_pairs_r00_0w0 = vm_behavior_zero,
897 		.protection_pairs_r00_rw0 = vm_behavior_zero,
898 		.protection_pairs_0w0_000 = vm_behavior_zero,
899 		.protection_pairs_0w0_r00 = vm_behavior_zero,
900 		.protection_pairs_0w0_0w0 = vm_behavior_zero,
901 		.protection_pairs_0w0_rw0 = vm_behavior_zero,
902 		.protection_pairs_rw0_000 = vm_behavior_zero,
903 		.protection_pairs_rw0_r00 = vm_behavior_zero,
904 		.protection_pairs_rw0_0w0 = vm_behavior_zero,
905 		.protection_pairs_rw0_rw0 = vm_behavior_zero,
906 	};
907 
908 	run_vm_tests("vm_behavior_set_zero", __FILE__, &tests, argc, argv);
909 }
910