From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: linux-sgx@vger.kernel.org
Cc: Sean Christopherson <sean.j.christopherson@intel.com>
Subject: Re: [PATCH] x86/vdso: Use named constant for ENCLU leaves
Date: Thu, 19 Mar 2020 23:20:32 +0200 [thread overview]
Message-ID: <20200319212032.GA169489@linux.intel.com> (raw)
In-Reply-To: <20200319205116.124166-1-jarkko.sakkinen@linux.intel.com>
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@intel.com>
> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> ---
> 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
prev parent reply other threads:[~2020-03-19 21:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-19 20:51 [PATCH] x86/vdso: Use named constant for ENCLU leaves Jarkko Sakkinen
2020-03-19 21:20 ` Jarkko Sakkinen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200319212032.GA169489@linux.intel.com \
--to=jarkko.sakkinen@linux.intel.com \
--cc=linux-sgx@vger.kernel.org \
--cc=sean.j.christopherson@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).