Re: [PATCH for_v29 0/8] x86/sgx: Make vDSO callable from C

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

 



On Fri, Mar 20, 2020 at 04:25:12PM -0700, Sean Christopherson wrote:
> On Fri, Mar 20, 2020 at 02:57:24AM +0200, Jarkko Sakkinen wrote:
> > On Wed, Mar 18, 2020 at 06:11:22PM -0700, Sean Christopherson wrote:
> > > Sean Christopherson (8):
> > >   x86/sgx: vdso: Remove an incorrect statement the enter enclave comment
> > >   x86/sgx: vdso: Make the %rsp fixup on return from handler relative
> > >   x86/sgx: vdso: Make __vdso_sgx_enter_enclave() callable from C code
> > >   x86/sgx: vdso: Define a typedef for __vdso_sgx_enter_enclave
> > >   selftests/x86: sgx: Zero out @result before invoking vDSO sub-test
> > >   selftests/x86: sgx: Pass EENTER to vDSO wrapper instead of hardcoding
> > >   selftests/x86: sgx: Stop clobbering non-volatile registers
> > >   selftests/x86: Add selftest to invoke __vsgx_enter_enclave() from C
> > > 
> > >  arch/x86/entry/vdso/vsgx_enter_enclave.S      | 72 ++-----------------
> > >  arch/x86/include/uapi/asm/sgx.h               | 61 ++++++++++++++++
> > >  .../selftests/x86/sgx/encl_bootstrap.S        |  6 +-
> > >  tools/testing/selftests/x86/sgx/main.c        | 17 ++++-
> > >  tools/testing/selftests/x86/sgx/sgx_call.S    |  1 -
> > >  tools/testing/selftests/x86/sgx/sgx_call.h    |  2 +-
> > >  6 files changed, 85 insertions(+), 74 deletions(-)
> > > 
> > > -- 
> > > 2.24.1
> > > 
> > 
> > Might be a grazy idea but better to go through this anyway.
> > 
> > Given the premise that we need the carry the callback anyway in all
> > cases, why won't just have the callback.
> > 
> > Why we absolutely need the code path that fills exception info given
> > that we no matter what need to have a callback route?
> > 
> > Would simplify considerably to have only clear flow.
> 
> Invoking the callback uses a retpoline, which is non-trivial overhead.
> For runtimes that need an assembly wrapper for other reasons, and aren't
> using the untrusted stack, forcing them to implement a handler would be
> painful.

The non-callback route only exists because we did not know that we have
to do the callback route. It does not make sense to add something for
any other reason than absolute necessity.

Things would simplify in the vDSO implementation considerably. Now it is
overwhelmingly complex for no good reason.

/Jarkko



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

  Powered by Linux