Update the ioctl handler comments to reflect reality. Signed-off-by: Sean Christopherson <sean.j.christopherson@xxxxxxxxx> --- arch/x86/kernel/cpu/sgx/ioctl.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/arch/x86/kernel/cpu/sgx/ioctl.c b/arch/x86/kernel/cpu/sgx/ioctl.c index 75f868bad3ea..6567680b1a50 100644 --- a/arch/x86/kernel/cpu/sgx/ioctl.c +++ b/arch/x86/kernel/cpu/sgx/ioctl.c @@ -235,11 +235,11 @@ static int sgx_encl_create(struct sgx_encl *encl, struct sgx_secs *secs) /** * sgx_ioc_enclave_create - handler for %SGX_IOC_ENCLAVE_CREATE - * @filep: open file to /dev/sgx + * @encl: pointer to an enclave instance (via ioctl() file pointer) * @arg: userspace pointer to a struct sgx_enclave_create instance * - * Allocate kernel data structures for a new enclave and execute ECREATE after - * verifying the correctness of the provided SECS. + * Allocate kernel data structures for the enclave, verify the correctness of + * the provided SECS, and execute ECREATE. * * Note, enforcement of restricted and disallowed attributes is deferred until * sgx_ioc_enclave_init(), only the architectural correctness of the SECS is @@ -444,7 +444,7 @@ static int sgx_encl_add_page(struct sgx_encl *encl, /** * sgx_ioc_enclave_add_page() - The handler for %SGX_IOC_ENCLAVE_ADD_PAGE - * @filep: open file to /dev/sgx + * @encl: pointer to an enclave instance (via ioctl() file pointer) * @arg: a user pointer to a struct sgx_enclave_add_page instance * * Add (EADD) a page to an uninitialized enclave, and optionally extend @@ -591,11 +591,14 @@ static int sgx_encl_init(struct sgx_encl *encl, struct sgx_sigstruct *sigstruct, /** * sgx_ioc_enclave_init - handler for %SGX_IOC_ENCLAVE_INIT - * - * @filep: open file to /dev/sgx + * @encl: pointer to an enclave instance (via ioctl() file pointer) * @arg: userspace pointer to a struct sgx_enclave_init instance * - * Flush any outstanding enqueued EADD operations and perform EINIT. The + * Check that the required attributes for the enclave have been authorized, and + * execute EINIT to initialize an enclave and make it runnable. Success is not + * guaranteed even if all inputs are valid as EINIT is interruptible, i.e. the + * CPU may abort EINIT to service a pending interrupt. + * * Launch Enclave Public Key Hash MSRs are rewritten as necessary to match * the enclave's MRSIGNER, which is caculated from the provided sigstruct. * @@ -643,7 +646,7 @@ static long sgx_ioc_enclave_init(struct sgx_encl *encl, void __user *arg) /** * sgx_ioc_enclave_set_attribute - handler for %SGX_IOC_ENCLAVE_SET_ATTRIBUTE - * @filep: open file to /dev/sgx + * @encl: pointer to an enclave instance (via ioctl() file pointer) * @arg: userspace pointer to a struct sgx_enclave_set_attribute instance * * Mark the enclave as being allowed to access a restricted attribute bit. -- 2.22.0