Skip to content

Commit 7b50283

Browse files
ereshetovahansendc
authored andcommitted
x86/sgx: Define error codes for use by ENCLS[EUPDATESVN]
Add error codes for ENCLS[EUPDATESVN], then SGX CPUSVN update process can know the execution state of EUPDATESVN and notify userspace. EUPDATESVN will be called when no active SGX users is guaranteed. Only add the error codes that can legally happen. E.g., it could also fail due to "SGX not ready" when there's SGX users but it wouldn't happen in this implementation. Signed-off-by: Elena Reshetova <elena.reshetova@intel.com> Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com> Reviewed-by: Kai Huang <kai.huang@intel.com> Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org> Tested-by: Nataliia Bondarevska <bondarn@google.com>
1 parent 6ffdb49 commit 7b50283

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

  • arch/x86/include/asm

arch/x86/include/asm/sgx.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ enum sgx_encls_function {
7373
* public key does not match IA32_SGXLEPUBKEYHASH.
7474
* %SGX_PAGE_NOT_MODIFIABLE: The EPC page cannot be modified because it
7575
* is in the PENDING or MODIFIED state.
76+
* %SGX_INSUFFICIENT_ENTROPY: Insufficient entropy in RNG.
77+
* %SGX_NO_UPDATE: EUPDATESVN could not update the CPUSVN because the
78+
* current SVN was not newer than CPUSVN. This is the most
79+
* common error code returned by EUPDATESVN.
7680
* %SGX_UNMASKED_EVENT: An unmasked event, e.g. INTR, was received
7781
*/
7882
enum sgx_return_code {
@@ -81,6 +85,8 @@ enum sgx_return_code {
8185
SGX_CHILD_PRESENT = 13,
8286
SGX_INVALID_EINITTOKEN = 16,
8387
SGX_PAGE_NOT_MODIFIABLE = 20,
88+
SGX_INSUFFICIENT_ENTROPY = 29,
89+
SGX_NO_UPDATE = 31,
8490
SGX_UNMASKED_EVENT = 128,
8591
};
8692

0 commit comments

Comments
 (0)