[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] vm_user: allow palign to be greater than PAGE_SIZE in alloca
From: |
Samuel Thibault |
Subject: |
Re: [PATCH] vm_user: allow palign to be greater than PAGE_SIZE in allocate_contiguous |
Date: |
Sat, 1 Jul 2023 16:16:34 +0200 |
User-agent: |
NeoMutt/20170609 (1.8.3) |
Hello,
Err, but that would be lying. If the requestor wants more alignment than
PAGE_SIZE, we have to respect that.
Samuel
Etienne Brateau, le sam. 01 juil. 2023 16:12:42 +0200, a ecrit:
> 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;