[intel-sgx-kernel-dev,1/5] intel_sgx: turn sgx_free_encl_page() into static sgx_evict_page()
diff mbox

Message ID 20170131230308.7561-2-jarkko.sakkinen@linux.intel.com
State New
Headers show

Commit Message

Jarkko Sakkinen Jan. 31, 2017, 11:03 p.m. UTC
Renamed the internal function that evicts an EPC page after swapping
because it is easily confused to sgx_free_page(). In addition the
function is declared as static because it isn't used outside of
intel_sgx_page_cache.c.

Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
---
 drivers/platform/x86/intel_sgx_page_cache.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Patch
diff mbox

diff --git a/drivers/platform/x86/intel_sgx_page_cache.c b/drivers/platform/x86/intel_sgx_page_cache.c
index d073057..d2b8baa 100644
--- a/drivers/platform/x86/intel_sgx_page_cache.c
+++ b/drivers/platform/x86/intel_sgx_page_cache.c
@@ -290,9 +290,9 @@  static bool sgx_ewb(struct sgx_encl *encl,
 	return true;
 }
 
-void sgx_free_encl_page(struct sgx_encl_page *entry,
-		    struct sgx_encl *encl,
-		    unsigned int flags)
+static void sgx_evict_page(struct sgx_encl_page *entry,
+			   struct sgx_encl *encl,
+			   unsigned int flags)
 {
 	sgx_free_page(entry->epc_page, encl, flags);
 	entry->epc_page = NULL;
@@ -318,7 +318,7 @@  static void sgx_write_pages(struct sgx_encl *encl, struct list_head *src)
 		evma = sgx_find_vma(encl, entry->addr);
 		if (!evma) {
 			list_del(&entry->load_list);
-			sgx_free_encl_page(entry, encl, 0);
+			sgx_evict_page(entry, encl, 0);
 			continue;
 		}
 
@@ -344,7 +344,7 @@  static void sgx_write_pages(struct sgx_encl *encl, struct list_head *src)
 			encl->secs_child_cnt--;
 		}
 
-		sgx_free_encl_page(entry, encl, free_flags);
+		sgx_evict_page(entry, encl, free_flags);
 	}
 
 	if (!encl->secs_child_cnt && (encl->flags & SGX_ENCL_INITIALIZED)) {
@@ -353,7 +353,7 @@  static void sgx_write_pages(struct sgx_encl *encl, struct list_head *src)
 			free_flags = SGX_FREE_SKIP_EREMOVE;
 
 		encl->flags |= SGX_ENCL_SECS_EVICTED;
-		sgx_free_encl_page(&encl->secs_page, encl, free_flags);
+		sgx_evict_page(&encl->secs_page, encl, free_flags);
 	}
 
 	mutex_unlock(&encl->lock);