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

2020-08-19 Thread Andy Lutomirski
On Tue, Aug 18, 2020 at 8:15 AM Jarkko Sakkinen wrote: > > On Mon, Aug 10, 2020 at 04:08:46PM -0700, Andy Lutomirski wrote: > > On Thu, Aug 6, 2020 at 7:55 AM Nathaniel McCallum > > wrote: > > > > > > In a past revision of this patch, I had requested a void *misc > > > parameter that could be

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

2020-08-19 Thread Jarkko Sakkinen
On Wed, Aug 19, 2020 at 09:33:45AM -0400, Nathaniel McCallum wrote: > On Tue, Aug 18, 2020 at 12:44 PM Jarkko Sakkinen > wrote: > > > > On Tue, Aug 18, 2020 at 11:15:32AM -0400, Nathaniel McCallum wrote: > > > That seems like overkill to me. I'm just asking for one additional mov > > >

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

2020-08-19 Thread Jethro Beekman
On 2020-08-19 15:33, Nathaniel McCallum wrote: > On Tue, Aug 18, 2020 at 12:44 PM Jarkko Sakkinen > wrote: >> >> On Tue, Aug 18, 2020 at 11:15:32AM -0400, Nathaniel McCallum wrote: >>> That seems like overkill to me. I'm just asking for one additional mov >>> instruction. :) >> >> I started to

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

2020-08-19 Thread Nathaniel McCallum
On Tue, Aug 18, 2020 at 12:44 PM Jarkko Sakkinen wrote: > > On Tue, Aug 18, 2020 at 11:15:32AM -0400, Nathaniel McCallum wrote: > > That seems like overkill to me. I'm just asking for one additional mov > > instruction. :) > > I started to consider eBPF since the complexity and constraints of the

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

2020-08-18 Thread Jarkko Sakkinen
On Tue, Aug 18, 2020 at 11:15:32AM -0400, Nathaniel McCallum wrote: > That seems like overkill to me. I'm just asking for one additional mov > instruction. :) I started to consider eBPF since the complexity and constraints of the callback look like an overkill and without doubt will be a burden

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

2020-08-18 Thread Nathaniel McCallum
That seems like overkill to me. I'm just asking for one additional mov instruction. :) On Tue, Aug 18, 2020 at 11:06 AM Jarkko Sakkinen wrote: > > On Tue, Aug 18, 2020 at 05:52:41PM +0300, Jarkko Sakkinen wrote: > > On Mon, Aug 10, 2020 at 03:23:17PM -0700, Sean Christopherson wrote: > > > >

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

2020-08-18 Thread Jarkko Sakkinen
On Mon, Aug 10, 2020 at 04:08:46PM -0700, Andy Lutomirski wrote: > On Thu, Aug 6, 2020 at 7:55 AM Nathaniel McCallum > wrote: > > > > In a past revision of this patch, I had requested a void *misc > > parameter that could be passed through vdso_sgx_enter_enclave_t into > >

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

2020-08-18 Thread Jarkko Sakkinen
On Tue, Aug 18, 2020 at 05:52:41PM +0300, Jarkko Sakkinen wrote: > On Mon, Aug 10, 2020 at 03:23:17PM -0700, Sean Christopherson wrote: > > > This can be done implicitly by wrapping the struct > > > sgx_enclave_exception in another structure and then using techniques > > > like container_of() to

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

2020-08-18 Thread Jarkko Sakkinen
On Mon, Aug 10, 2020 at 03:23:17PM -0700, Sean Christopherson wrote: > > This can be done implicitly by wrapping the struct > > sgx_enclave_exception in another structure and then using techniques > > like container_of() to find another field. However, this is made more > > difficult by the fact

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

2020-08-18 Thread Jarkko Sakkinen
On Thu, Aug 06, 2020 at 10:55:43AM -0400, Nathaniel McCallum wrote: > In a past revision of this patch, I had requested a void *misc > parameter that could be passed through vdso_sgx_enter_enclave_t into > sgx_enclave_exit_handler_t. This request encountered some push back > and I dropped the

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

2020-08-17 Thread Andy Lutomirski
> On Aug 17, 2020, at 6:12 AM, Nathaniel McCallum wrote: > > On Mon, Aug 10, 2020 at 7:09 PM Andy Lutomirski wrote: >> >>> On Thu, Aug 6, 2020 at 7:55 AM Nathaniel McCallum >>> wrote: >>> >>> In a past revision of this patch, I had requested a void *misc >>> parameter that could be

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

2020-08-17 Thread Nathaniel McCallum
On Mon, Aug 10, 2020 at 7:09 PM Andy Lutomirski wrote: > > On Thu, Aug 6, 2020 at 7:55 AM Nathaniel McCallum > wrote: > > > > In a past revision of this patch, I had requested a void *misc > > parameter that could be passed through vdso_sgx_enter_enclave_t into > > sgx_enclave_exit_handler_t.

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

2020-08-13 Thread Sean Christopherson
On Tue, Aug 11, 2020 at 08:16:54AM -0700, Andy Lutomirski wrote: > > > On Aug 10, 2020, at 5:52 PM, Andy Lutomirski wrote: > > > >  > >>> On Aug 10, 2020, at 4:48 PM, Sean Christopherson > >>> wrote: > >>> > >>> On Mon, Aug 10, 2020 at 04:08:46PM -0700, Andy Lutomirski wrote: > >>> What am

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

2020-08-11 Thread Andy Lutomirski
> On Aug 10, 2020, at 5:52 PM, Andy Lutomirski wrote: > >  >>> On Aug 10, 2020, at 4:48 PM, Sean Christopherson >>> wrote: >>> >>> On Mon, Aug 10, 2020 at 04:08:46PM -0700, Andy Lutomirski wrote: >>> What am I missing? I still don't really understand why we are >>> supporting this

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

2020-08-11 Thread Sean Christopherson
On Tue, Aug 11, 2020 at 09:16:28AM +0200, Jethro Beekman wrote: > On 2020-08-11 00:23, Sean Christopherson wrote: > > Another thought would be to wrap sgx_enclave_exception in a struct to give > > room for supporting additional exit information (if such a thing ever pops > > up) and to allow the

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

2020-08-11 Thread Jethro Beekman
On 2020-08-11 00:23, Sean Christopherson wrote: > Another thought would be to wrap sgx_enclave_exception in a struct to give > room for supporting additional exit information (if such a thing ever pops > up) and to allow the caller to opt in to select behavior, e.g. Jethro's > request to invoke

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

2020-08-10 Thread Andy Lutomirski
> On Aug 10, 2020, at 4:48 PM, Sean Christopherson > wrote: > > On Mon, Aug 10, 2020 at 04:08:46PM -0700, Andy Lutomirski wrote: >> What am I missing? I still don't really understand why we are >> supporting this mechanism at all. Just the asm code to invoke the >> callback seems to be

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

2020-08-10 Thread Sean Christopherson
On Mon, Aug 10, 2020 at 04:08:46PM -0700, Andy Lutomirski wrote: > What am I missing? I still don't really understand why we are > supporting this mechanism at all. Just the asm code to invoke the > callback seems to be about half of the entire function. Because the Intel SDK (and other SDKs?)

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

2020-08-10 Thread Andy Lutomirski
On Thu, Aug 6, 2020 at 7:55 AM Nathaniel McCallum wrote: > > In a past revision of this patch, I had requested a void *misc > parameter that could be passed through vdso_sgx_enter_enclave_t into > sgx_enclave_exit_handler_t. This request encountered some push back > and I dropped the issue.

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

2020-08-10 Thread Sean Christopherson
On Thu, Aug 06, 2020 at 10:55:43AM -0400, Nathaniel McCallum wrote: > In a past revision of this patch, I had requested a void *misc > parameter that could be passed through vdso_sgx_enter_enclave_t into > sgx_enclave_exit_handler_t. This request encountered some push back > and I dropped the

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

2020-08-06 Thread Nathaniel McCallum
In a past revision of this patch, I had requested a void *misc parameter that could be passed through vdso_sgx_enter_enclave_t into sgx_enclave_exit_handler_t. This request encountered some push back and I dropped the issue. However, I'd like to revisit it or something similar. One way to create

[PATCH v36 21/24] x86/vdso: Implement a vDSO for Intel SGX enclave call

2020-07-16 Thread Jarkko Sakkinen
From: Sean Christopherson An SGX runtime must be aware of the exceptions, which happen inside an enclave. Introduce a vDSO call that wraps EENTER/ERESUME cycle and returns the CPU exception back to the caller exactly when it happens. Kernel fixups the exception information to RDI, RSI and RDX.