mbox series

[for_v22,0/6] x86/sgx: Remove EADD worker and page copy

Message ID 20190808221340.29460-1-sean.j.christopherson@intel.com (mailing list archive)
Headers show
Series x86/sgx: Remove EADD worker and page copy | expand

Message

Sean Christopherson Aug. 8, 2019, 10:13 p.m. UTC
As suggested by Andy, remove the work queue in favor of handling the
entire EADD flow in the context of the ioctl().  After the worker is
gone, pass the source page/address directly to EADD instead of first
copying the data into kernel memory.

This applies on top the bug fix series I sent yesterday,
https://patchwork.kernel.org/cover/11082995/.

Sean Christopherson (6):
  x86/sgx: Validate generic SECINFO immediately after copying from user
  x86/sgx: Set SGX_ENCL_PAGE_TCS when allocating encl_page
  x86/sgx: Move encl_page insertion into tree out of alloc flow
  x86/sgx: Allocate encl_page prior to taking encl->lock
  x86/sgx: Remove the EADD page worker
  x86/sgx: Pass userspace source address directly to EADD

 arch/x86/kernel/cpu/sgx/driver/ioctl.c | 402 +++++++------------------
 arch/x86/kernel/cpu/sgx/driver/main.c  |   4 -
 arch/x86/kernel/cpu/sgx/encl.h         |   2 -
 3 files changed, 103 insertions(+), 305 deletions(-)

Comments

Jarkko Sakkinen Aug. 9, 2019, 4:21 p.m. UTC | #1
On Thu, 2019-08-08 at 15:13 -0700, Sean Christopherson wrote:
> As suggested by Andy, remove the work queue in favor of handling the
> entire EADD flow in the context of the ioctl().  After the worker is
> gone, pass the source page/address directly to EADD instead of first
> copying the data into kernel memory.
> 
> This applies on top the bug fix series I sent yesterday,
> https://patchwork.kernel.org/cover/11082995/.
> 
> Sean Christopherson (6):
>   x86/sgx: Validate generic SECINFO immediately after copying from user
>   x86/sgx: Set SGX_ENCL_PAGE_TCS when allocating encl_page
>   x86/sgx: Move encl_page insertion into tree out of alloc flow
>   x86/sgx: Allocate encl_page prior to taking encl->lock
>   x86/sgx: Remove the EADD page worker
>   x86/sgx: Pass userspace source address directly to EADD
> 
>  arch/x86/kernel/cpu/sgx/driver/ioctl.c | 402 +++++++------------------
>  arch/x86/kernel/cpu/sgx/driver/main.c  |   4 -
>  arch/x86/kernel/cpu/sgx/encl.h         |   2 -
>  3 files changed, 103 insertions(+), 305 deletions(-)

Can you resend a rebased one, once I've squashed the fixes?

/Jarkko
Sean Christopherson Aug. 9, 2019, 4:22 p.m. UTC | #2
On Fri, Aug 09, 2019 at 07:21:18PM +0300, Jarkko Sakkinen wrote:
> On Thu, 2019-08-08 at 15:13 -0700, Sean Christopherson wrote:
> > As suggested by Andy, remove the work queue in favor of handling the
> > entire EADD flow in the context of the ioctl().  After the worker is
> > gone, pass the source page/address directly to EADD instead of first
> > copying the data into kernel memory.
> > 
> > This applies on top the bug fix series I sent yesterday,
> > https://patchwork.kernel.org/cover/11082995/.
> > 
> > Sean Christopherson (6):
> >   x86/sgx: Validate generic SECINFO immediately after copying from user
> >   x86/sgx: Set SGX_ENCL_PAGE_TCS when allocating encl_page
> >   x86/sgx: Move encl_page insertion into tree out of alloc flow
> >   x86/sgx: Allocate encl_page prior to taking encl->lock
> >   x86/sgx: Remove the EADD page worker
> >   x86/sgx: Pass userspace source address directly to EADD
> > 
> >  arch/x86/kernel/cpu/sgx/driver/ioctl.c | 402 +++++++------------------
> >  arch/x86/kernel/cpu/sgx/driver/main.c  |   4 -
> >  arch/x86/kernel/cpu/sgx/encl.h         |   2 -
> >  3 files changed, 103 insertions(+), 305 deletions(-)
> 
> Can you resend a rebased one, once I've squashed the fixes?

Yep, not a problem.