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: Re: [PATCH for v24 3/3] x86/sgx: Remove a subordinate clause
Date: Mon, 4 Nov 2019 13:21:22 -0800	[thread overview]
Message-ID: <20191104212122.GC5960@linux.intel.com> (raw)
In-Reply-To: <20191104200141.5385-3-jarkko.sakkinen@linux.intel.com>

On Mon, Nov 04, 2019 at 10:01:41PM +0200, Jarkko Sakkinen wrote:
> The subordinate clause of last sentence of the sgx_ioc_enclave_pages()
> does not provide any insight not already provided. Thus, remove it.

Isn't the whole point of the documentation to help the user understand
*how* to use the API, not simply state exactly what the code does?

> Also, using "i.e." (and "e.g.") in the documentation should be
> considered a bad practice because it leaves it open ended.

How does stating the practical effect of the semantics leave the docs open
ended?  The man pages for open[1], close[2], read[3], dlopen[4], etc...
all provide examples (usually with "for example" verbiage) to call out
common scenarios to help the reader understand the details, and close()
also uses "i.e." to clarify.

[1] http://man7.org/linux/man-pages/man2/open.2.html
[2] http://man7.org/linux/man-pages/man2/close.2.html
[3] http://man7.org/linux/man-pages/man2/read.2.html
[4] http://man7.org/linux/man-pages/man3/dlopen.3.html
 
> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> ---
>  arch/x86/kernel/cpu/sgx/ioctl.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/x86/kernel/cpu/sgx/ioctl.c b/arch/x86/kernel/cpu/sgx/ioctl.c
> index 289af607f634..87b2fb62825a 100644
> --- a/arch/x86/kernel/cpu/sgx/ioctl.c
> +++ b/arch/x86/kernel/cpu/sgx/ioctl.c
> @@ -468,11 +468,9 @@ static int sgx_encl_add_page(struct sgx_encl *encl,
>   * @encl:       pointer to an enclave instance (via ioctl() file pointer)
>   * @arg:	a user pointer to a struct sgx_enclave_add_pages instance
>   *
> - * Add (EADD) one or more pages to an uninitialized enclave, and optionally
> - * extend (EEXTEND) the measurement with the contents of the page. The range of

Why are you dropping the reference to the ENCLS functions?  Yes, it's
stating the obvious for those of us that have been buried in SGX for the
last few years, but for newbies reading the docs I think there is value in
explicitly connecting the actions to the ENCLS function.

> - * pages must be virtually contiguous. The SECINFO and measurement mask are
> - * applied to all pages, i.e. pages with different properties must be added in
> - * separate calls.
> + * Add one or more pages to an uninitialized enclave, and optionally extend the
> + * measurement with the contents of the page. The address range of pages must
> + * be contiguous. The SECINFO and measurement mask are applied to all pages.

I like making it "address range", but I'd prefer to keep the "virtually"
qualifier.  Again, probably stating the obvious for many readers, but I
don't think it's ever harmful and I like the clarification it provides
without having to stop and consider the context.

>   *
>   * A SECINFO for a TCS is required to always contain zero permissions because
>   * CPU silently zeros them. Allowing anything else would cause a mismatch in
> -- 
> 2.20.1
> 

  reply	other threads:[~2019-11-04 21:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-04 20:01 [PATCH for v24 1/3] x86/sgx: Use GFP_KERNEL for allocations Jarkko Sakkinen
2019-11-04 20:01 ` [PATCH for v24 2/3] x86/sgx: Destroy enclave if EADD fails Jarkko Sakkinen
2019-11-04 20:54   ` Sean Christopherson
2019-11-04 22:31     ` Jarkko Sakkinen
2019-11-04 20:01 ` [PATCH for v24 3/3] x86/sgx: Remove a subordinate clause Jarkko Sakkinen
2019-11-04 21:21   ` Sean Christopherson [this message]
2019-11-04 22:36     ` Jarkko Sakkinen
2019-11-04 22:37       ` Jarkko Sakkinen
2019-11-04 20:46 ` [PATCH for v24 1/3] x86/sgx: Use GFP_KERNEL for allocations Sean Christopherson
2019-11-04 22:26   ` Jarkko Sakkinen
2019-11-05  2:17     ` Sean Christopherson
2019-11-06 21:54       ` Jarkko Sakkinen
2019-11-06 21:59         ` Jarkko Sakkinen
2019-11-06 22:02           ` 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=20191104212122.GC5960@linux.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).