Re: [PATCH] x86/vdso: Use named constant for ENCLU leaves

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

 



On Thu, Mar 19, 2020 at 10:51:16PM +0200, Jarkko Sakkinen wrote:
> Rather than using magic numbers and a comment, replace the magic
> numbers with named constants.
> 
> Cc: Sean Christopherson <sean.j.christopherson@xxxxxxxxx>
> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@xxxxxxxxxxxxxxx>
> ---
> Already pushed (as is RSA key generation). Just something noted when
> going through 2/8 patch.
>  arch/x86/entry/vdso/vsgx_enter_enclave.S | 5 +++--
>  arch/x86/include/asm/enclu.h             | 8 ++++++++
>  2 files changed, 11 insertions(+), 2 deletions(-)
>  create mode 100644 arch/x86/include/asm/enclu.h
> 
> diff --git a/arch/x86/entry/vdso/vsgx_enter_enclave.S b/arch/x86/entry/vdso/vsgx_enter_enclave.S
> index 22a22e0774d8..7c01a629dc7e 100644
> --- a/arch/x86/entry/vdso/vsgx_enter_enclave.S
> +++ b/arch/x86/entry/vdso/vsgx_enter_enclave.S
> @@ -3,6 +3,7 @@
>  #include <linux/linkage.h>
>  #include <asm/export.h>
>  #include <asm/errno.h>
> +#include <asm/enclu.h>
>  
>  #include "extable.h"
>  
> @@ -85,9 +86,9 @@ SYM_FUNC_START(__vdso_sgx_enter_enclave)
>  
>  .Lenter_enclave:
>  	/* EENTER <= leaf <= ERESUME */
> -	cmp	$0x2, %eax
> +	cmp	EENTER, %eax
>  	jb	.Linvalid_leaf
> -	cmp	$0x3, %eax
> +	cmp	ERESUME, %eax

These are correct in my tree ('$').

/Jarkko



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

  Powered by Linux