Lines Matching refs:encl_page

132 static int __sgx_encl_eldu(struct sgx_encl_page *encl_page,  in __sgx_encl_eldu()  argument
136 unsigned long va_offset = encl_page->desc & SGX_ENCL_PAGE_VA_OFFSET_MASK; in __sgx_encl_eldu()
137 struct sgx_encl *encl = encl_page->encl; in __sgx_encl_eldu()
147 page_index = PFN_DOWN(encl_page->desc - encl_page->encl->base); in __sgx_encl_eldu()
162 pginfo.addr = encl_page->desc & PAGE_MASK; in __sgx_encl_eldu()
173 sgx_get_epc_virt_addr(encl_page->va_page->epc_page) + va_offset); in __sgx_encl_eldu()
211 static struct sgx_epc_page *sgx_encl_eldu(struct sgx_encl_page *encl_page, in sgx_encl_eldu() argument
215 unsigned long va_offset = encl_page->desc & SGX_ENCL_PAGE_VA_OFFSET_MASK; in sgx_encl_eldu()
216 struct sgx_encl *encl = encl_page->encl; in sgx_encl_eldu()
220 epc_page = sgx_alloc_epc_page(encl_page, false); in sgx_encl_eldu()
224 ret = __sgx_encl_eldu(encl_page, epc_page, secs_page); in sgx_encl_eldu()
230 sgx_free_va_slot(encl_page->va_page, va_offset); in sgx_encl_eldu()
231 list_move(&encl_page->va_page->list, &encl->va_pages); in sgx_encl_eldu()
232 encl_page->desc &= ~SGX_ENCL_PAGE_VA_OFFSET_MASK; in sgx_encl_eldu()
233 encl_page->epc_page = epc_page; in sgx_encl_eldu()
319 struct sgx_encl_page *encl_page; in sgx_encl_eaug_page() local
336 encl_page = sgx_encl_page_alloc(encl, addr - encl->base, secinfo_flags); in sgx_encl_eaug_page()
337 if (IS_ERR(encl_page)) in sgx_encl_eaug_page()
342 epc_page = sgx_alloc_epc_page(encl_page, false); in sgx_encl_eaug_page()
359 ret = xa_insert(&encl->page_array, PFN_DOWN(encl_page->desc), in sgx_encl_eaug_page()
360 encl_page, GFP_KERNEL); in sgx_encl_eaug_page()
369 pginfo.addr = encl_page->desc & PAGE_MASK; in sgx_encl_eaug_page()
376 encl_page->encl = encl; in sgx_encl_eaug_page()
377 encl_page->epc_page = epc_page; in sgx_encl_eaug_page()
378 encl_page->type = SGX_PAGE_TYPE_REG; in sgx_encl_eaug_page()
381 sgx_mark_page_reclaimable(encl_page->epc_page); in sgx_encl_eaug_page()
397 xa_erase(&encl->page_array, PFN_DOWN(encl_page->desc)); in sgx_encl_eaug_page()
405 kfree(encl_page); in sgx_encl_eaug_page()
1140 struct sgx_encl_page *encl_page; in sgx_encl_page_alloc() local
1143 encl_page = kzalloc(sizeof(*encl_page), GFP_KERNEL); in sgx_encl_page_alloc()
1144 if (!encl_page) in sgx_encl_page_alloc()
1147 encl_page->desc = encl->base + offset; in sgx_encl_page_alloc()
1148 encl_page->encl = encl; in sgx_encl_page_alloc()
1163 encl_page->vm_max_prot_bits = calc_vm_prot_bits(prot, 0); in sgx_encl_page_alloc()
1165 return encl_page; in sgx_encl_page_alloc()