linux-sgx.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sean Christopherson <sean.j.christopherson@intel.com>
To: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Cc: linux-sgx@vger.kernel.org
Subject: [PATCH for_v31 4/6] x86/sgx: Replace "grab" with "alloc" in VA page helper
Date: Fri, 29 May 2020 10:54:05 -0700	[thread overview]
Message-ID: <20200529175407.2109-5-sean.j.christopherson@intel.com> (raw)
In-Reply-To: <20200529175407.2109-1-sean.j.christopherson@intel.com>

Rename sgx_grab_va_page() to sgx_alloc_va_page() to align with
sgx_alloc_epc_page() as well as sgx_free_epc_page(); the latter is used
directly when freeing the VA page, i.e. the names should be consistent.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
---
 arch/x86/kernel/cpu/sgx/encl.c  | 6 +++---
 arch/x86/kernel/cpu/sgx/encl.h  | 2 +-
 arch/x86/kernel/cpu/sgx/ioctl.c | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/x86/kernel/cpu/sgx/encl.c b/arch/x86/kernel/cpu/sgx/encl.c
index e9d72f05a1f12..df4ae76dd83f6 100644
--- a/arch/x86/kernel/cpu/sgx/encl.c
+++ b/arch/x86/kernel/cpu/sgx/encl.c
@@ -686,15 +686,15 @@ struct sgx_encl_page *sgx_encl_reserve_page(struct sgx_encl *encl,
 }
 
 /**
- * sgx_grab_va_page() - Grab a Version Array (VA) page
+ * sgx_alloc_va_page() - Allocate a Version Array (VA) page
  *
- * Grab a free EPC page instance and convert it to a Version Array (VA) page.
+ * Allocate a free EPC page and convert it to a Version Array (VA) page.
  *
  * Return:
  *   a VA page,
  *   -errno otherwise
  */
-struct sgx_epc_page *sgx_grab_va_page(void)
+struct sgx_epc_page *sgx_alloc_va_page(void)
 {
 	struct sgx_epc_page *epc_page;
 	int ret;
diff --git a/arch/x86/kernel/cpu/sgx/encl.h b/arch/x86/kernel/cpu/sgx/encl.h
index 625ad44a83215..f0f72e5912445 100644
--- a/arch/x86/kernel/cpu/sgx/encl.h
+++ b/arch/x86/kernel/cpu/sgx/encl.h
@@ -120,7 +120,7 @@ int sgx_encl_test_and_clear_young(struct mm_struct *mm,
 struct sgx_encl_page *sgx_encl_reserve_page(struct sgx_encl *encl,
 					    unsigned long addr);
 
-struct sgx_epc_page *sgx_grab_va_page(void);
+struct sgx_epc_page *sgx_alloc_va_page(void);
 unsigned int sgx_alloc_va_slot(struct sgx_va_page *va_page);
 void sgx_free_va_slot(struct sgx_va_page *va_page, unsigned int offset);
 bool sgx_va_page_full(struct sgx_va_page *va_page);
diff --git a/arch/x86/kernel/cpu/sgx/ioctl.c b/arch/x86/kernel/cpu/sgx/ioctl.c
index f7232a5343262..4f70cb8144ffd 100644
--- a/arch/x86/kernel/cpu/sgx/ioctl.c
+++ b/arch/x86/kernel/cpu/sgx/ioctl.c
@@ -32,7 +32,7 @@ static struct sgx_va_page *sgx_encl_grow(struct sgx_encl *encl)
 		if (!va_page)
 			return ERR_PTR(-ENOMEM);
 
-		va_page->epc_page = sgx_grab_va_page();
+		va_page->epc_page = sgx_alloc_va_page();
 		if (IS_ERR(va_page->epc_page)) {
 			err = ERR_CAST(va_page->epc_page);
 			kfree(va_page);
-- 
2.26.0


  parent reply	other threads:[~2020-05-29 17:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-29 17:54 [PATCH for_v31 0/6] x86/sgx: Misc fixes for v31 Sean Christopherson
2020-05-29 17:54 ` [PATCH for_v31 1/6] x86/sgx: Fix inadvertant early return from sgx_ioctl() Sean Christopherson
2020-05-29 17:54 ` [PATCH for_v31 2/6] x86/sgx: Remove unnecessary globals after merging reclaim.c into main.c Sean Christopherson
2020-05-30  8:43   ` Jarkko Sakkinen
2020-05-30  8:47     ` Jarkko Sakkinen
2020-05-30 10:36       ` Jarkko Sakkinen
2020-05-29 17:54 ` [PATCH for_v31 3/6] x86/sgx: Rename sgx_free_page() to sgx_free_epc_page() Sean Christopherson
2020-06-01  0:50   ` Jarkko Sakkinen
2020-05-29 17:54 ` Sean Christopherson [this message]
2020-06-01  0:53   ` [PATCH for_v31 4/6] x86/sgx: Replace "grab" with "alloc" in VA page helper Jarkko Sakkinen
2020-05-29 17:54 ` [PATCH for_v31 5/6] x86/sgx: Update stale comment in EPC page allocators Sean Christopherson
2020-06-01  0:59   ` Jarkko Sakkinen
2020-05-29 17:54 ` [PATCH for_v31 6/6] x86/sgx: Drop the message that fires when there are too many EPC sections Sean Christopherson
2020-06-01  1:01   ` Jarkko Sakkinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200529175407.2109-5-sean.j.christopherson@intel.com \
    --to=sean.j.christopherson@intel.com \
    --cc=jarkko.sakkinen@linux.intel.com \
    --cc=linux-sgx@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).