From eff4f7477b38b5b794ce1ede7766af1dcb6f8fde Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Wed, 9 Aug 2023 23:55:34 +0200 Subject: 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. --- vm/vm_user.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'vm/vm_user.c') 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); -- cgit v1.2.3