Re: [PATCH] x86/sgx: Return 0 when !CONFIG_INTEL_SGX_DRIVER

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

 



On Sun, Jul 14, 2019 at 05:32:12PM +0300, Jarkko Sakkinen wrote:
> When the config option is not enabled the initialization is always
> succesful.

Why would the be initialization be considered successful?  It's dead code
and memory consumption if the driver can't load.  When KVM support gets
added, the initialization can be considered successful if the driver *or*
virtual EPC are enabled and load cleanly.

> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@xxxxxxxxxxxxxxx>
> ---
> This was the reason why I got the -ENODEV error with my BuildRoot image.
> The config option was not enabled but took some time realize as I was
> kind of getting an error code from the driver initialization. Finally
> when I used ftrace with 'sgx*' I knew what was going on.
>  arch/x86/kernel/cpu/sgx/driver/driver.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kernel/cpu/sgx/driver/driver.h b/arch/x86/kernel/cpu/sgx/driver/driver.h
> index da60839b133a..aafa64a4f481 100644
> --- a/arch/x86/kernel/cpu/sgx/driver/driver.h
> +++ b/arch/x86/kernel/cpu/sgx/driver/driver.h
> @@ -37,7 +37,7 @@ int sgx_drv_init(void);
>  #else
>  static inline int sgx_drv_init(void)
>  {
> -	return -ENODEV;
> +	return 0;
>  }
>  #endif
>  
> -- 
> 2.20.1
> 



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

  Powered by Linux