summaryrefslogtreecommitdiff
path: root/vm
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2024-02-04 22:33:22 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2024-02-04 22:33:37 +0100
commita59e2ed64ba07d19657b25cbedd25586a912c8ed (patch)
tree12dfdd920a54bbbd931d586c63cf82500ac9217b /vm
parent88cbab7aaefdcd2b630d3f970a0c65a50ad419da (diff)
vm_pages_phys: Avoid faults while we keep vm locks
In principle we are actually writing to the allocated area outside of the vm lock, but better be safe in case somebody changes things.
Diffstat (limited to 'vm')
-rw-r--r--vm/vm_user.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/vm/vm_user.c b/vm/vm_user.c
index 1a0ec802..868230a3 100644
--- a/vm/vm_user.c
+++ b/vm/vm_user.c
@@ -728,8 +728,9 @@ kern_return_t vm_pages_phys(
if (*countp < count) {
vm_offset_t allocated;
- kr = kmem_alloc_pageable(ipc_kernel_map, &allocated,
- count * sizeof(pagesp[0]));
+ /* Avoid faults while we keep vm locks */
+ kr = kmem_alloc(ipc_kernel_map, &allocated,
+ count * sizeof(pagesp[0]));
if (kr != KERN_SUCCESS)
return KERN_RESOURCE_SHORTAGE;
pagesp = (rpc_phys_addr_array_t) allocated;