summaryrefslogtreecommitdiff
path: root/vm
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2023-08-09 23:55:34 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-08-09 23:58:07 +0200
commiteff4f7477b38b5b794ce1ede7766af1dcb6f8fde (patch)
tree870db1a361e7ad39d01d552f6ba4c7b3633ff3e2 /vm
parent486fba5505fc0c579321fd8cc125bac8058d197f (diff)
Fix missing DMA32 limit
Rumpdisk needs to allocate dma32 memory areas, so we do always need this limit. The non-Xen x86_64 case had a typo, and the 32bit PAE case didn't have the DMA32 limit. Also, we have to cope with VM_PAGE_DMA32_LIMIT being either above or below VM_PAGE_DIRECTMAP_LIMIT depending on the cases.
Diffstat (limited to 'vm')
-rw-r--r--vm/vm_user.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/vm/vm_user.c b/vm/vm_user.c
index df597267..18f79eda 100644
--- a/vm/vm_user.c
+++ b/vm/vm_user.c
@@ -607,11 +607,19 @@ kern_return_t vm_allocate_contiguous(
selector = VM_PAGE_SEL_DMA;
if (pmax > VM_PAGE_DMA_LIMIT)
#ifdef VM_PAGE_DMA32_LIMIT
+#if VM_PAGE_DMA32_LIMIT < VM_PAGE_DIRECTMAP_LIMIT
selector = VM_PAGE_SEL_DMA32;
if (pmax > VM_PAGE_DMA32_LIMIT)
#endif
+#endif
selector = VM_PAGE_SEL_DIRECTMAP;
if (pmax > VM_PAGE_DIRECTMAP_LIMIT)
+#ifdef VM_PAGE_DMA32_LIMIT
+#if VM_PAGE_DMA32_LIMIT > VM_PAGE_DIRECTMAP_LIMIT
+ selector = VM_PAGE_SEL_DMA32;
+ if (pmax > VM_PAGE_DMA32_LIMIT)
+#endif
+#endif
selector = VM_PAGE_SEL_HIGHMEM;
size = vm_page_round(size);