@@ -472,6 +472,7 @@ static struct sgx_epc_page *__sgx_alloc_epc_page_from_node(int nid)
page = list_first_entry(&node->free_page_list, struct sgx_epc_page, list);
list_del_init(&page->list);
sgx_nr_free_pages--;
+ page->flags = 0;
spin_unlock(&node->lock);
@@ -626,6 +627,7 @@ void sgx_free_epc_page(struct sgx_epc_page *page)
list_add_tail(&page->list, &node->free_page_list);
sgx_nr_free_pages++;
+ page->flags = SGX_EPC_PAGE_IS_FREE;
spin_unlock(&node->lock);
}
@@ -26,6 +26,9 @@
/* Pages, which are being tracked by the page reclaimer. */
#define SGX_EPC_PAGE_RECLAIMER_TRACKED BIT(0)
+/* Pages on free list */
+#define SGX_EPC_PAGE_IS_FREE BIT(1)
+
struct sgx_epc_page {
unsigned int section;
unsigned int flags;