bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] vm_user: allow palign to be greater than PAGE_SIZE in allocate_c


From: Etienne Brateau
Subject: [PATCH] vm_user: allow palign to be greater than PAGE_SIZE in allocate_contiguous
Date: Sat, 1 Jul 2023 16:12:42 +0200

Allow to allocate contiguous if palign is greater than PAGE_SIZE and
it’s still align with the begining of a page.
---
 vm/vm_user.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/vm/vm_user.c b/vm/vm_user.c
index df597267..b3c1f09f 100644
--- a/vm/vm_user.c
+++ b/vm/vm_user.c
@@ -600,6 +600,9 @@ kern_return_t vm_allocate_contiguous(
        if ((palign < PAGE_SIZE) && (PAGE_SIZE % palign == 0))
                palign = PAGE_SIZE;
 
+       if (palign % PAGE_SIZE == 0)
+               palign = PAGE_SIZE;
+
        /* FIXME */
        if (palign != PAGE_SIZE)
                return KERN_INVALID_ARGUMENT;
-- 
2.41.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]