Lines Matching full:encl
11 #include "encl.h"
19 struct sgx_encl *encl; in sgx_open() local
22 encl = kzalloc(sizeof(*encl), GFP_KERNEL); in sgx_open()
23 if (!encl) in sgx_open()
26 kref_init(&encl->refcount); in sgx_open()
27 xa_init(&encl->page_array); in sgx_open()
28 mutex_init(&encl->lock); in sgx_open()
29 INIT_LIST_HEAD(&encl->va_pages); in sgx_open()
30 INIT_LIST_HEAD(&encl->mm_list); in sgx_open()
31 spin_lock_init(&encl->mm_lock); in sgx_open()
33 ret = init_srcu_struct(&encl->srcu); in sgx_open()
35 kfree(encl); in sgx_open()
39 file->private_data = encl; in sgx_open()
46 struct sgx_encl *encl = file->private_data; in sgx_release() local
56 spin_lock(&encl->mm_lock); in sgx_release()
58 if (list_empty(&encl->mm_list)) { in sgx_release()
61 encl_mm = list_first_entry(&encl->mm_list, in sgx_release()
66 spin_unlock(&encl->mm_lock); in sgx_release()
72 synchronize_srcu(&encl->srcu); in sgx_release()
76 /* 'encl_mm' is gone, put encl_mm->encl reference: */ in sgx_release()
77 kref_put(&encl->refcount, sgx_encl_release); in sgx_release()
80 kref_put(&encl->refcount, sgx_encl_release); in sgx_release()
86 struct sgx_encl *encl = file->private_data; in sgx_mmap() local
89 ret = sgx_encl_may_map(encl, vma->vm_start, vma->vm_end, vma->vm_flags); in sgx_mmap()
93 ret = sgx_encl_mm_add(encl, vma->vm_mm); in sgx_mmap()
99 vma->vm_private_data = encl; in sgx_mmap()