11/* SPDX-License-Identifier: GPL-2.0 */
2- /**
2+ /*
33 * Copyright(c) 2016-20 Intel Corporation.
44 *
55 * Intel Software Guard Extensions (SGX) support.
2828#define SGX_CPUID_EPC_MASK GENMASK(3, 0)
2929
3030enum sgx_encls_function {
31- ECREATE = 0x00 ,
32- EADD = 0x01 ,
33- EINIT = 0x02 ,
34- EREMOVE = 0x03 ,
35- EDGBRD = 0x04 ,
36- EDGBWR = 0x05 ,
37- EEXTEND = 0x06 ,
38- ELDU = 0x08 ,
39- EBLOCK = 0x09 ,
40- EPA = 0x0A ,
41- EWB = 0x0B ,
42- ETRACK = 0x0C ,
43- EAUG = 0x0D ,
44- EMODPR = 0x0E ,
45- EMODT = 0x0F ,
31+ ECREATE = 0x00 ,
32+ EADD = 0x01 ,
33+ EINIT = 0x02 ,
34+ EREMOVE = 0x03 ,
35+ EDGBRD = 0x04 ,
36+ EDGBWR = 0x05 ,
37+ EEXTEND = 0x06 ,
38+ ELDU = 0x08 ,
39+ EBLOCK = 0x09 ,
40+ EPA = 0x0A ,
41+ EWB = 0x0B ,
42+ ETRACK = 0x0C ,
43+ EAUG = 0x0D ,
44+ EMODPR = 0x0E ,
45+ EMODT = 0x0F ,
46+ EUPDATESVN = 0x18 ,
4647};
4748
4849/**
@@ -65,22 +66,28 @@ enum sgx_encls_function {
6566
6667/**
6768 * enum sgx_return_code - The return code type for ENCLS, ENCLU and ENCLV
68- * % SGX_EPC_PAGE_CONFLICT: Page is being written by other ENCLS function.
69- * % SGX_NOT_TRACKED: Previous ETRACK's shootdown sequence has not
69+ * @ SGX_EPC_PAGE_CONFLICT: Page is being written by other ENCLS function.
70+ * @ SGX_NOT_TRACKED: Previous ETRACK's shootdown sequence has not
7071 * been completed yet.
71- * % SGX_CHILD_PRESENT SECS has child pages present in the EPC.
72- * % SGX_INVALID_EINITTOKEN: EINITTOKEN is invalid and enclave signer's
72+ * @ SGX_CHILD_PRESENT: SECS has child pages present in the EPC.
73+ * @ SGX_INVALID_EINITTOKEN: EINITTOKEN is invalid and enclave signer's
7374 * public key does not match IA32_SGXLEPUBKEYHASH.
74- * % SGX_PAGE_NOT_MODIFIABLE: The EPC page cannot be modified because it
75+ * @ SGX_PAGE_NOT_MODIFIABLE: The EPC page cannot be modified because it
7576 * is in the PENDING or MODIFIED state.
76- * %SGX_UNMASKED_EVENT: An unmasked event, e.g. INTR, was received
77+ * @SGX_INSUFFICIENT_ENTROPY: Insufficient entropy in RNG.
78+ * @SGX_NO_UPDATE: EUPDATESVN could not update the CPUSVN because the
79+ * current SVN was not newer than CPUSVN. This is the most
80+ * common error code returned by EUPDATESVN.
81+ * @SGX_UNMASKED_EVENT: An unmasked event, e.g. INTR, was received
7782 */
7883enum sgx_return_code {
7984 SGX_EPC_PAGE_CONFLICT = 7 ,
8085 SGX_NOT_TRACKED = 11 ,
8186 SGX_CHILD_PRESENT = 13 ,
8287 SGX_INVALID_EINITTOKEN = 16 ,
8388 SGX_PAGE_NOT_MODIFIABLE = 20 ,
89+ SGX_INSUFFICIENT_ENTROPY = 29 ,
90+ SGX_NO_UPDATE = 31 ,
8491 SGX_UNMASKED_EVENT = 128 ,
8592};
8693
@@ -89,7 +96,7 @@ enum sgx_return_code {
8996
9097/**
9198 * enum sgx_miscselect - additional information to an SSA frame
92- * % SGX_MISC_EXINFO: Report #PF or #GP to the SSA frame.
99+ * @ SGX_MISC_EXINFO: Report #PF or #GP to the SSA frame.
93100 *
94101 * Save State Area (SSA) is a stack inside the enclave used to store processor
95102 * state when an exception or interrupt occurs. This enum defines additional
@@ -105,17 +112,17 @@ enum sgx_miscselect {
105112#define SGX_SSA_MISC_EXINFO_SIZE 16
106113
107114/**
108- * enum sgx_attributes - the attributes field in &struct sgx_secs
109- * % SGX_ATTR_INIT: Enclave can be entered (is initialized).
110- * % SGX_ATTR_DEBUG: Allow ENCLS(EDBGRD) and ENCLS(EDBGWR).
111- * % SGX_ATTR_MODE64BIT: Tell that this a 64-bit enclave.
112- * % SGX_ATTR_PROVISIONKEY: Allow to use provisioning keys for remote
115+ * enum sgx_attribute - the attributes field in &struct sgx_secs
116+ * @ SGX_ATTR_INIT: Enclave can be entered (is initialized).
117+ * @ SGX_ATTR_DEBUG: Allow ENCLS(EDBGRD) and ENCLS(EDBGWR).
118+ * @ SGX_ATTR_MODE64BIT: Tell that this a 64-bit enclave.
119+ * @ SGX_ATTR_PROVISIONKEY: Allow to use provisioning keys for remote
113120 * attestation.
114- * % SGX_ATTR_KSS: Allow to use key separation and sharing (KSS).
115- * % SGX_ATTR_EINITTOKENKEY: Allow to use token signing key that is used to
121+ * @ SGX_ATTR_KSS: Allow to use key separation and sharing (KSS).
122+ * @ SGX_ATTR_EINITTOKENKEY: Allow to use token signing key that is used to
116123 * sign cryptographic tokens that can be passed to
117124 * EINIT as an authorization to run an enclave.
118- * % SGX_ATTR_ASYNC_EXIT_NOTIFY: Allow enclaves to be notified after an
125+ * @ SGX_ATTR_ASYNC_EXIT_NOTIFY: Allow enclaves to be notified after an
119126 * asynchronous exit has occurred.
120127 */
121128enum sgx_attribute {
@@ -188,7 +195,7 @@ struct sgx_secs {
188195
189196/**
190197 * enum sgx_tcs_flags - execution flags for TCS
191- * % SGX_TCS_DBGOPTIN: If enabled allows single-stepping and breakpoints
198+ * @ SGX_TCS_DBGOPTIN: If enabled allows single-stepping and breakpoints
192199 * inside an enclave. It is cleared by EADD but can
193200 * be set later with EDBGWR.
194201 */
@@ -253,11 +260,11 @@ struct sgx_pageinfo {
253260
254261/**
255262 * enum sgx_page_type - bits in the SECINFO flags defining the page type
256- * % SGX_PAGE_TYPE_SECS: a SECS page
257- * % SGX_PAGE_TYPE_TCS: a TCS page
258- * % SGX_PAGE_TYPE_REG: a regular page
259- * % SGX_PAGE_TYPE_VA: a VA page
260- * % SGX_PAGE_TYPE_TRIM: a page in trimmed state
263+ * @ SGX_PAGE_TYPE_SECS: a SECS page
264+ * @ SGX_PAGE_TYPE_TCS: a TCS page
265+ * @ SGX_PAGE_TYPE_REG: a regular page
266+ * @ SGX_PAGE_TYPE_VA: a VA page
267+ * @ SGX_PAGE_TYPE_TRIM: a page in trimmed state
261268 *
262269 * Make sure when making changes to this enum that its values can still fit
263270 * in the bitfield within &struct sgx_encl_page
@@ -275,14 +282,14 @@ enum sgx_page_type {
275282
276283/**
277284 * enum sgx_secinfo_flags - the flags field in &struct sgx_secinfo
278- * % SGX_SECINFO_R: allow read
279- * % SGX_SECINFO_W: allow write
280- * % SGX_SECINFO_X: allow execution
281- * % SGX_SECINFO_SECS: a SECS page
282- * % SGX_SECINFO_TCS: a TCS page
283- * % SGX_SECINFO_REG: a regular page
284- * % SGX_SECINFO_VA: a VA page
285- * % SGX_SECINFO_TRIM: a page in trimmed state
285+ * @ SGX_SECINFO_R: allow read
286+ * @ SGX_SECINFO_W: allow write
287+ * @ SGX_SECINFO_X: allow execution
288+ * @ SGX_SECINFO_SECS: a SECS page
289+ * @ SGX_SECINFO_TCS: a TCS page
290+ * @ SGX_SECINFO_REG: a regular page
291+ * @ SGX_SECINFO_VA: a VA page
292+ * @ SGX_SECINFO_TRIM: a page in trimmed state
286293 */
287294enum sgx_secinfo_flags {
288295 SGX_SECINFO_R = BIT (0 ),
0 commit comments