Lines Matching refs:va_page
22 struct sgx_va_page *va_page = NULL; in sgx_encl_grow() local
29 va_page = kzalloc(sizeof(*va_page), GFP_KERNEL); in sgx_encl_grow()
30 if (!va_page) in sgx_encl_grow()
33 va_page->epc_page = sgx_alloc_va_page(); in sgx_encl_grow()
34 if (IS_ERR(va_page->epc_page)) { in sgx_encl_grow()
35 err = ERR_CAST(va_page->epc_page); in sgx_encl_grow()
36 kfree(va_page); in sgx_encl_grow()
43 return va_page; in sgx_encl_grow()
46 static void sgx_encl_shrink(struct sgx_encl *encl, struct sgx_va_page *va_page) in sgx_encl_shrink() argument
50 if (va_page) { in sgx_encl_shrink()
51 sgx_encl_free_epc_page(va_page->epc_page); in sgx_encl_shrink()
52 list_del(&va_page->list); in sgx_encl_shrink()
53 kfree(va_page); in sgx_encl_shrink()
60 struct sgx_va_page *va_page; in sgx_encl_create() local
67 va_page = sgx_encl_grow(encl); in sgx_encl_create()
68 if (IS_ERR(va_page)) in sgx_encl_create()
69 return PTR_ERR(va_page); in sgx_encl_create()
70 else if (va_page) in sgx_encl_create()
71 list_add(&va_page->list, &encl->va_pages); in sgx_encl_create()
129 sgx_encl_shrink(encl, va_page); in sgx_encl_create()
296 struct sgx_va_page *va_page; in sgx_encl_add_page() local
309 va_page = sgx_encl_grow(encl); in sgx_encl_add_page()
310 if (IS_ERR(va_page)) { in sgx_encl_add_page()
311 ret = PTR_ERR(va_page); in sgx_encl_add_page()
322 if (va_page) in sgx_encl_add_page()
323 list_add(&va_page->list, &encl->va_pages); in sgx_encl_add_page()
364 sgx_encl_shrink(encl, va_page); in sgx_encl_add_page()