Re: RFC: userspace exception fixups

From: Jarkko Sakkinen
Date: Fri Nov 02 2018 - 18:42:19 EST


On Fri, Nov 02, 2018 at 09:52:04AM -0700, Sean Christopherson wrote:
> On Fri, Nov 02, 2018 at 04:37:10PM +0000, Jethro Beekman wrote:
> > On 2018-11-02 09:30, Sean Christopherson wrote:
> > >... The intended convention for EENTER is to have an ENCLU at the AEX target ...
> > >
> > >... to further enforce that the AEX target needs to be ENCLU.
> >
> > Some SGX runtimes may want to use a different AEX target.
>
> To what end? Userspace gets no indication as to why the AEX occurred.
> And if exceptions are getting transfered to userspace the trampoline
> would effectively be handling only INTR, NMI, #MC and EPC #PF.

I've understood that in some cases run-time implementation requires to
run a handler implemented inside the enclave i.e the sequence would be

1. #AEX
2. EENTER(in-enclave handler)
3. EEXIT(%rcx)
4. ERESUME

/Jarkko