Re: [PATCH v28 21/22] x86/vdso: Implement a vDSO for Intel SGX enclave call

From: Xing, Cedric
Date: Tue Mar 17 2020 - 17:40:40 EST


Hi Nathaniel,

I reread your email today and thought I might have misunderstood your email earlier. What changes are you asking for exactly? Is that just passing @leaf in %ecx rather than in %eax? If so, I wouldn't have any problem. I agree with you that the resulted API would then be callable from C, even though it wouldn't be able to return back to C due to tampered %rbx. But I think the vDSO API can preserve %rbx too, given it is used by both EENTER and EEXIT (so is unavailable for parameter passing anyway). Alternatively, the C caller can setjmp() to be longjmp()'d back from within the exit handler.

-Cedric