Re: [PATCH 2/2] x86/sgx: Determine SECS at compile time in sgx_encl_eldu()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2019-08-21 at 17:55 -0700, Sean Christopherson wrote:
> On Thu, Aug 22, 2019 at 02:29:02AM +0300, Jarkko Sakkinen wrote:
> > Using address resolution of any kind is obviously an overkill for
> > anything that we know at compile time. Those sites should not hard
> > bind how we store SECS.
> > 
> > This commit adds @secs_child to sgx_encl_eldu() and sgx_encl_ewb()
> > and replaces sgx_encl_get_index() with a macro SGX_ENCL_PAGE_INDEX()
> 
> Why use a macro instead of an inline function?

Just for consistency and nothing else.

It falls into same category as the two other macros in encl.h:
unconditionally give attributes of the page with some calculation
appied (the earlier function had a real flow).

We could consider separately converting all of the three as inline
functions though (not in the context of this patch).

> Rather than pass a bool, we can pass 'struct sgx_epc_page *parent_secs'.
> That'd avoid having to name a bool, and would clean up this type of code.
> In general, I dislike boolean parameters where the caller uses true/false
> as I can never remember the context of true/false.

Sure, but why not just @secs? It is always a parent.

/Jarkko




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux