[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180619133837.GK5609@linux.intel.com>
Date: Tue, 19 Jun 2018 16:38:37 +0300
From: Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>
To: Sean Christopherson <sean.j.christopherson@...el.com>
Cc: Dave Hansen <dave.hansen@...el.com>, x86@...nel.org,
platform-driver-x86@...r.kernel.org, nhorman@...hat.com,
npmccallum@...hat.com, Darren Hart <dvhart@...radead.org>,
Andy Shevchenko <andy@...radead.org>,
"open list:INTEL SGX" <intel-sgx-kernel-dev@...ts.01.org>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v11 11/13] intel_sgx: ptrace() support
On Mon, Jun 11, 2018 at 08:02:09AM -0700, Sean Christopherson wrote:
> On Fri, 2018-06-08 at 11:34 -0700, Dave Hansen wrote:
> > On 06/08/2018 10:09 AM, Jarkko Sakkinen wrote:
> > >
> > > + ret = sgx_edbgrd(encl, entry, align, data);
> > > + if (ret)
> > > + break;
> > > + if (write) {
> > > + memcpy(data + offset, buf + i, cnt);
> > > + ret = sgx_edbgwr(encl, entry, align, data);
> > > + if (ret)
> > > + break;
> > > + }
> > > + else
> > > + memcpy(buf + i,data + offset, cnt);
> > > + }
> > The SGX instructions like "edbgrd" be great to put on a license plat,
> > but we can do better in the kernel. Can you give these reasonable
> > english names, please? sgx_debug_write(), maybe?
>
> IMO the function names for ENCLS leafs are appropriate. The real
> issue is the lack of documentation of the ENCLS helpers and their
> naming conventions.
>
> The sgx_<leaf> functions, e.g. sgx_edbgrd(), are essentially direct
> invocations of the specific leaf, i.e. they are dumb wrappers to
> the lower level leaf functions, e.g. __edbgrd(). The wrappers exist
> primarily to deal with the boilerplate necessary to access a page in
> the EPC. sgx_<leaf> conveys that the function contains the preamble
> and/or postamble needed to execute its leaf, but otherwise does not
> contain any logic.
>
> Functions with actual logic do have English names, e.g.
> sgx_encl_init(), sgx_encl_add_page(), sgx_encl_modify_pages() etc...
I agree with Sean on the naming and agree with Dave on his comments in
earlier patch in the series needs a better documentation.
/Jarkko
Powered by blists - more mailing lists