lkml.org 
[lkml]   [2018]   [Dec]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH v4 5/5] x86/vdso: Add __vdso_sgx_enter_enclave() to wrap SGX enclave transitions
On Fri, Dec 14, 2018 at 07:12:04AM -0800, Sean Christopherson wrote:
> On Fri, Dec 14, 2018 at 09:55:49AM +0000, Jethro Beekman wrote:
> > On 2018-12-14 03:01, Sean Christopherson wrote:
> > >+2: pop %rbx
> > >+ pop %r12
> > >+ pop %r13
> > >+ pop %r14
> > >+ pop %r15
> > >+ pop %rbp
> > >+ ret
> >
> > x86-64 ABI requires that you call CLD here (enclave may set it).
>
> Ugh. Technically MXCSR and the x87 CW also need to be preserved.
>
> What if rather than treating the enclave as hostile we require it to be
> compliant with the x86-64 ABI like any other function? That would solve
> the EFLAGS.DF, MXCSR and x87 issues without adding unnecessary overhead.
> And we wouldn't have to save/restore R12-R15. It'd mean we couldn't use
> the stack's red zone to hold @regs and @e, but that's poor form anyways.

Grr, except the processor crushes R12-R15, FCW and MXCSR on asynchronous
exits. But not EFLAGS.DF, that's real helpful.

\
 
 \ /
  Last update: 2018-12-14 16:39    [W:0.122 / U:0.288 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site