Re: [PATCH v19,RESEND 24/27] x86/vdso: Add __vdso_sgx_enter_enclave() to wrap SGX enclave transitions
From: Jarkko Sakkinen
Date: Fri Mar 29 2019 - 05:48:25 EST
On Thu, Mar 28, 2019 at 11:19:25PM +0000, Xing, Cedric wrote:
> > It's certainly making progress. I like the fact that the callback is
> > now unconditional (if non-NULL) rather than being used just in case of
> > certain exit types. But, if we go down this route, let's name and
> > document it appropriately -- just call the function "callback" and
> > document it as a function that is called just before
> > __vdso_sgx_enter_enclave returns, to be used if support for legacy
> > enclaves that push data onto the untrusted stack is needed. We should
> > further document that it's safe to longjmp out of it.
> >
> > Also, the tests in tools/testing/selftests/x86/unwind_vdso.c should be
> > augmented to test this code.
> >
> > Finally, why does the vDSO code bother checking whether the leaf is
> > valid?
>
> I can document it. I'll look into unwind_vdso.c to see what kind of
> selftests will make sense here. And I'll send out a RFC patch with
> everything included. Or would you prefer to have my changes integrated
> into Jarkko's patch v20?
>
> Different ENCLU leaf has different parameters. This vDSO API knows how
> to load up parameters only for EENTER and ERESUME so it errs on all
> other positive values. 0 and negative values are interpreted as return
> codes.
Not gonna make it to v20. I'm aiming to send it early next week and have
already closed the content.
What this and also Sean's solution would need is the update to
Documentation/x86/sgx.rst explaining how it works in detail.
/Jarkko