Re: [PATCH for v24 1/3] x86/sgx: Use GFP_KERNEL for allocations

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

 



On Mon, Nov 04, 2019 at 10:01:39PM +0200, Jarkko Sakkinen wrote:
> The reasoning is the same as in
> 
> http://git.infradead.org/users/jjs/linux-tpmdd.git/commit/abd55954f91a3aacc1d260d2411cf776ec4d5fd2
> 
> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@xxxxxxxxxxxxxxx>
> ---
>  arch/x86/kernel/cpu/sgx/ioctl.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/kernel/cpu/sgx/ioctl.c b/arch/x86/kernel/cpu/sgx/ioctl.c
> index 5b28a9c0cb68..d53aee5a64c1 100644
> --- a/arch/x86/kernel/cpu/sgx/ioctl.c
> +++ b/arch/x86/kernel/cpu/sgx/ioctl.c
> @@ -259,7 +259,7 @@ static long sgx_ioc_enclave_create(struct sgx_encl *encl, void __user *arg)
>  	if (copy_from_user(&ecreate, arg, sizeof(ecreate)))
>  		return -EFAULT;
>  
> -	secs_page = alloc_page(GFP_HIGHUSER);
> +	secs_page = alloc_page(GFP_KERNEL);
>  	if (!secs_page)
>  		return -ENOMEM;
>  
> @@ -674,7 +674,7 @@ static long sgx_ioc_enclave_init(struct sgx_encl *encl, void __user *arg)
>  	if (copy_from_user(&einit, arg, sizeof(einit)))
>  		return -EFAULT;
>  
> -	initp_page = alloc_page(GFP_HIGHUSER);
> +	initp_page = alloc_page(GFP_KERNEL);

Would it make sense to use GFP_KERNEL_ACCOUNT?  The accounting would be
weird for the case where userspace is using a builder process, but even in
that case it's not flat out wrong to account per-enclave memory allocations.

>  	if (!initp_page)
>  		return -ENOMEM;
>  
> -- 
> 2.20.1
> 



[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux