From: Dave Hansen <dave.hansen@intel.com>
To: Elena Reshetova <elena.reshetova@intel.com>
Cc: jarkko@kernel.org, seanjc@google.com, kai.huang@intel.com,
mingo@kernel.org, linux-sgx@vger.kernel.org,
linux-kernel@vger.kernel.org, x86@kernel.org,
asit.k.mallick@intel.com, vincent.r.scarlata@intel.com,
chongc@google.com, erdemaktas@google.com, vannapurve@google.com,
bondarn@google.com, scott.raynor@intel.com
Subject: Re: [PATCH v10 4/6] x86/sgx: Define error codes for use by ENCLS[EUPDATESVN]
Date: Fri, 1 Aug 2025 09:57:18 -0700 [thread overview]
Message-ID: <80006246-d0c5-475d-a8c7-bdb5446d9489@intel.com> (raw)
In-Reply-To: <20250801112619.1117549-5-elena.reshetova@intel.com>
On 8/1/25 04:25, Elena Reshetova wrote:
> Add error codes for ENCLS[EUPDATESVN], then SGX CPUSVN update
> process can know the execution state of EUPDATESVN and notify
> userspace.
>
> Signed-off-by: Elena Reshetova <elena.reshetova@intel.com>
> ---
> arch/x86/include/asm/sgx.h | 37 ++++++++++++++++++++++---------------
> 1 file changed, 22 insertions(+), 15 deletions(-)
>
> diff --git a/arch/x86/include/asm/sgx.h b/arch/x86/include/asm/sgx.h
> index 6a0069761508..1abf1461fab6 100644
> --- a/arch/x86/include/asm/sgx.h
> +++ b/arch/x86/include/asm/sgx.h
> @@ -28,21 +28,22 @@
> #define SGX_CPUID_EPC_MASK GENMASK(3, 0)
>
> enum sgx_encls_function {
> - ECREATE = 0x00,
> - EADD = 0x01,
> - EINIT = 0x02,
> - EREMOVE = 0x03,
> - EDGBRD = 0x04,
> - EDGBWR = 0x05,
> - EEXTEND = 0x06,
> - ELDU = 0x08,
> - EBLOCK = 0x09,
> - EPA = 0x0A,
> - EWB = 0x0B,
> - ETRACK = 0x0C,
> - EAUG = 0x0D,
> - EMODPR = 0x0E,
> - EMODT = 0x0F,
> + ECREATE = 0x00,
> + EADD = 0x01,
> + EINIT = 0x02,
> + EREMOVE = 0x03,
> + EDGBRD = 0x04,
> + EDGBWR = 0x05,
> + EEXTEND = 0x06,
> + ELDU = 0x08,
> + EBLOCK = 0x09,
> + EPA = 0x0A,
> + EWB = 0x0B,
> + ETRACK = 0x0C,
> + EAUG = 0x0D,
> + EMODPR = 0x0E,
> + EMODT = 0x0F,
> + EUPDATESVN = 0x18,
> };
This update is not consistent with the changelog nor the patch subject.
> /**
> @@ -73,6 +74,10 @@ enum sgx_encls_function {
> * public key does not match IA32_SGXLEPUBKEYHASH.
> * %SGX_PAGE_NOT_MODIFIABLE: The EPC page cannot be modified because it
> * is in the PENDING or MODIFIED state.
> + * %SGX_INSUFFICIENT_ENTROPY: Insufficient entropy in RNG.
> + * %SGX_NO_UPDATE: EUPDATESVN was successful, but CPUSVN was not
> + * updated because current SVN was not newer than
> + * CPUSVN.
This comment bothers me. This is an *ERROR* code. It means that
EUPDATESVN was *NOT* successful. It failed. It didn't do an update.
Now, it's not a _bad_ error code. It's kinda like read() returning 0.
It's a "no harm no foul" kind of thing. But it's *NOT* success.
Ideally, we find a way to relay this in a very succinct way.
next prev parent reply other threads:[~2025-08-01 16:57 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-01 11:25 [PATCH v10 0/6] Enable automatic SVN updates for SGX enclaves Elena Reshetova
2025-08-01 11:25 ` [PATCH v10 1/6] x86/sgx: Convert sgx_(vepc_)open to __sgx_(vepc_)open Elena Reshetova
2025-08-01 16:42 ` Dave Hansen
2025-08-04 7:16 ` Reshetova, Elena
2025-08-01 11:25 ` [PATCH v10 2/6] x86/sgx: Introduce functions to count the sgx_(vepc_)open() Elena Reshetova
2025-08-01 16:45 ` Dave Hansen
2025-08-04 7:18 ` Reshetova, Elena
2025-08-01 11:25 ` [PATCH v10 3/6] x86/cpufeatures: Add X86_FEATURE_SGX_EUPDATESVN feature flag Elena Reshetova
2025-08-01 16:46 ` Dave Hansen
2025-08-01 11:25 ` [PATCH v10 4/6] x86/sgx: Define error codes for use by ENCLS[EUPDATESVN] Elena Reshetova
2025-08-01 16:57 ` Dave Hansen [this message]
2025-08-04 7:21 ` Reshetova, Elena
2025-08-04 14:19 ` Dave Hansen
2025-08-05 10:11 ` Reshetova, Elena
2025-08-01 11:25 ` [PATCH v10 5/6] x86/sgx: Implement ENCLS[EUPDATESVN] Elena Reshetova
2025-08-01 17:12 ` Dave Hansen
2025-08-04 7:39 ` Reshetova, Elena
2025-08-01 11:25 ` [PATCH v10 6/6] x86/sgx: Enable automatic SVN updates for SGX enclaves Elena Reshetova
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=80006246-d0c5-475d-a8c7-bdb5446d9489@intel.com \
--to=dave.hansen@intel.com \
--cc=asit.k.mallick@intel.com \
--cc=bondarn@google.com \
--cc=chongc@google.com \
--cc=elena.reshetova@intel.com \
--cc=erdemaktas@google.com \
--cc=jarkko@kernel.org \
--cc=kai.huang@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sgx@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=scott.raynor@intel.com \
--cc=seanjc@google.com \
--cc=vannapurve@google.com \
--cc=vincent.r.scarlata@intel.com \
--cc=x86@kernel.org \
/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
all inboxes | Powered by JetHome®