sgx.h (5d8dfaa71d87f742c53309b95cb6a8b274119027) sgx.h (5ce8e39f55521c762f0e6d1bba9597284b1f2e69)
1/* SPDX-License-Identifier: GPL-2.0 */
2/**
3 * Copyright(c) 2016-20 Intel Corporation.
4 *
5 * Intel Software Guard Extensions (SGX) support.
6 */
7#ifndef _ASM_X86_SGX_H
8#define _ASM_X86_SGX_H

--- 32 unchanged lines hidden (view full) ---

41 EWB = 0x0B,
42 ETRACK = 0x0C,
43 EAUG = 0x0D,
44 EMODPR = 0x0E,
45 EMODT = 0x0F,
46};
47
48/**
1/* SPDX-License-Identifier: GPL-2.0 */
2/**
3 * Copyright(c) 2016-20 Intel Corporation.
4 *
5 * Intel Software Guard Extensions (SGX) support.
6 */
7#ifndef _ASM_X86_SGX_H
8#define _ASM_X86_SGX_H

--- 32 unchanged lines hidden (view full) ---

41 EWB = 0x0B,
42 ETRACK = 0x0C,
43 EAUG = 0x0D,
44 EMODPR = 0x0E,
45 EMODT = 0x0F,
46};
47
48/**
49 * SGX_ENCLS_FAULT_FLAG - flag signifying an ENCLS return code is a trapnr
50 *
51 * ENCLS has its own (positive value) error codes and also generates
52 * ENCLS specific #GP and #PF faults. And the ENCLS values get munged
53 * with system error codes as everything percolates back up the stack.
54 * Unfortunately (for us), we need to precisely identify each unique
55 * error code, e.g. the action taken if EWB fails varies based on the
56 * type of fault and on the exact SGX error code, i.e. we can't simply
57 * convert all faults to -EFAULT.
58 *
59 * To make all three error types coexist, we set bit 30 to identify an
60 * ENCLS fault. Bit 31 (technically bits N:31) is used to differentiate
61 * between positive (faults and SGX error codes) and negative (system
62 * error codes) values.
63 */
64#define SGX_ENCLS_FAULT_FLAG 0x40000000
65
66/**
49 * enum sgx_return_code - The return code type for ENCLS, ENCLU and ENCLV
50 * %SGX_NOT_TRACKED: Previous ETRACK's shootdown sequence has not
51 * been completed yet.
52 * %SGX_CHILD_PRESENT SECS has child pages present in the EPC.
53 * %SGX_INVALID_EINITTOKEN: EINITTOKEN is invalid and enclave signer's
54 * public key does not match IA32_SGXLEPUBKEYHASH.
55 * %SGX_UNMASKED_EVENT: An unmasked event, e.g. INTR, was received
56 */

--- 322 unchanged lines hidden ---
67 * enum sgx_return_code - The return code type for ENCLS, ENCLU and ENCLV
68 * %SGX_NOT_TRACKED: Previous ETRACK's shootdown sequence has not
69 * been completed yet.
70 * %SGX_CHILD_PRESENT SECS has child pages present in the EPC.
71 * %SGX_INVALID_EINITTOKEN: EINITTOKEN is invalid and enclave signer's
72 * public key does not match IA32_SGXLEPUBKEYHASH.
73 * %SGX_UNMASKED_EVENT: An unmasked event, e.g. INTR, was received
74 */

--- 322 unchanged lines hidden ---