Home
last modified time | relevance | path

Searched refs:encl (Results 1 – 10 of 10) sorted by relevance

/linux/tools/testing/selftests/sgx/
A Dload.c22 void encl_delete(struct encl *encl) in encl_delete() argument
25 munmap((void *)encl->encl_base, encl->encl_size); in encl_delete()
28 munmap(encl->bin, encl->bin_size); in encl_delete()
36 memset(encl, 0, sizeof(*encl)); in encl_delete()
75 static bool encl_ioc_create(struct encl *encl) in encl_ioc_create() argument
139 memset(encl, 0, sizeof(*encl)); in encl_load()
188 encl->segment_tbl = calloc(encl->nr_segments, in encl_load()
237 encl->src = encl->bin + src_offset; in encl_load()
241 for (encl->encl_size = 4096; encl->encl_size < encl->src_size; ) in encl_load()
253 static bool encl_map_area(struct encl *encl) in encl_map_area() argument
[all …]
A Dmain.h16 struct encl { struct
33 void encl_delete(struct encl *ctx); argument
34 bool encl_load(const char *path, struct encl *encl);
35 bool encl_measure(struct encl *encl);
36 bool encl_build(struct encl *encl);
A Dmain.c111 struct encl encl; in FIXTURE() local
125 if (!encl_load("test_encl.elf", &self->encl)) { in FIXTURE_SETUP()
126 encl_delete(&self->encl); in FIXTURE_SETUP()
130 for (i = 0; i < self->encl.nr_segments; i++) { in FIXTURE_SETUP()
131 seg = &self->encl.segment_tbl[i]; in FIXTURE_SETUP()
136 if (!encl_measure(&self->encl)) in FIXTURE_SETUP()
139 if (!encl_build(&self->encl)) in FIXTURE_SETUP()
145 for (i = 0; i < self->encl.nr_segments; i++) { in FIXTURE_SETUP()
170 self->run.tcs = self->encl.encl_base; in FIXTURE_SETUP()
186 encl_delete(&self->encl); in FIXTURE_SETUP()
[all …]
A Dsigstruct.c289 static bool mrenclave_segment(EVP_MD_CTX *ctx, struct encl *encl, in mrenclave_segment() argument
299 if (!mrenclave_eextend(ctx, offset, encl->src + offset)) in mrenclave_segment()
306 bool encl_measure(struct encl *encl) in encl_measure() argument
310 struct sgx_sigstruct *sigstruct = &encl->sigstruct; in encl_measure()
344 if (!mrenclave_ecreate(ctx, encl->src_size)) in encl_measure()
347 for (i = 0; i < encl->nr_segments; i++) { in encl_measure()
348 struct encl_segment *seg = &encl->segment_tbl[i]; in encl_measure()
350 if (!mrenclave_segment(ctx, encl, seg)) in encl_measure()
/linux/arch/x86/kernel/cpu/sgx/
A Dencl.c24 struct sgx_encl *encl = encl_page->encl; in __sgx_encl_eldu() local
71 struct sgx_encl *encl = encl_page->encl; in sgx_encl_eldu() local
143 struct sgx_encl *encl; in sgx_vma_fault() local
153 if (unlikely(!encl)) in sgx_vma_fault()
192 if (unlikely(!encl)) in sgx_vma_open()
335 if (!encl) in sgx_vma_access()
417 if (!encl->secs_child_cnt && encl->secs.epc_page) { in sgx_encl_release()
430 if (encl->backing) in sgx_encl_release()
441 kfree(encl); in sgx_encl_release()
534 encl_mm->encl = encl; in sgx_encl_mm_add()
[all …]
A Dioctl.c42 encl->page_cnt++; in sgx_encl_grow()
48 encl->page_cnt--; in sgx_encl_shrink()
84 encl->backing = backing; in sgx_encl_create()
109 encl->secs.encl = encl; in sgx_encl_create()
110 encl->base = secs->base; in sgx_encl_create()
111 encl->size = secs->size; in sgx_encl_create()
125 fput(encl->backing); in sgx_encl_create()
126 encl->backing = NULL; in sgx_encl_create()
183 encl_page->encl = encl; in sgx_encl_page_alloc()
345 encl_page->encl = encl; in sgx_encl_add_page()
[all …]
A Ddriver.c19 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()
30 INIT_LIST_HEAD(&encl->mm_list); in sgx_open()
35 kfree(encl); in sgx_open()
39 file->private_data = encl; in sgx_open()
56 spin_lock(&encl->mm_lock); in sgx_release()
[all …]
A Dmain.c85 struct sgx_encl *encl = page->encl; in sgx_reclaimer_age() local
118 struct sgx_encl *encl = page->encl; in sgx_reclaimer_block() local
150 mutex_lock(&encl->lock); in sgx_reclaimer_block()
156 mutex_unlock(&encl->lock); in sgx_reclaimer_block()
228 struct sgx_encl *encl = encl_page->encl; in sgx_encl_ewb() local
281 struct sgx_encl *encl = encl_page->encl; in sgx_reclaimer_write() local
285 mutex_lock(&encl->lock); in sgx_reclaimer_write()
289 encl->secs_child_cnt--; in sgx_reclaimer_write()
291 if (!encl->secs_child_cnt && test_bit(SGX_ENCL_INITIALIZED, &encl->flags)) { in sgx_reclaimer_write()
292 ret = sgx_encl_get_backing(encl, PFN_DOWN(encl->size), in sgx_reclaimer_write()
[all …]
A Dencl.h32 struct sgx_encl *encl; member
44 struct sgx_encl *encl; member
103 int sgx_encl_may_map(struct sgx_encl *encl, unsigned long start,
107 int sgx_encl_mm_add(struct sgx_encl *encl, struct mm_struct *mm);
108 int sgx_encl_get_backing(struct sgx_encl *encl, unsigned long page_index,
A DMakefile3 encl.o \

Completed in 20 milliseconds