summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2024-03-04 02:03:17 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2024-03-04 02:04:23 +0100
commitd6030cdfc49e9aa10819a5438a5ae313a4538f42 (patch)
tree9321900d7f6130306e8dc14d78c56aa1ec2daab6
parenta251b15660097c37892bf510f0c9979a4ec196f2 (diff)
vm_allocate_contiguous: Add missing page unwiring after making the area non-pageableHEADmaster
Otherwise, if the allocated memory is passed over for returning data such as in device_read, we end up with ../vm/vm_map.c:4245: vm_map_copyin_page_list: Assertion `src_entry->wired_count > 0' failed.Debugger invoked: assertion failure
-rw-r--r--vm/vm_user.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/vm/vm_user.c b/vm/vm_user.c
index 868230a3..62aedad3 100644
--- a/vm/vm_user.c
+++ b/vm/vm_user.c
@@ -692,6 +692,9 @@ kern_return_t vm_allocate_contiguous(
return kr;
}
+ for (i = 0; i < vm_page_atop(size); i++)
+ vm_page_unwire(&pages[i]);
+
*result_vaddr = vaddr;
*result_paddr = pages->phys_addr;