mbox series

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

Message ID 20190813011252.4121-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. 13, 2019, 1:12 a.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.

v2:
  - Rebase to master, commit 36e0186296a7.
  - Incorporate patch to require EADD be aligned, and add a selftest
    update to obey the new alignment requirement.

Sean Christopherson (8):
  selftests/x86/sgx: Align enclave binary on 4k boundary
  x86/sgx: Require EADD source to be page aligned
  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       | 405 +++++--------------
 arch/x86/kernel/cpu/sgx/driver/main.c        |   4 -
 arch/x86/kernel/cpu/sgx/encl.h               |   2 -
 tools/testing/selftests/x86/sgx/encl_piggy.S |   1 +
 4 files changed, 106 insertions(+), 306 deletions(-)

Comments

Jarkko Sakkinen Aug. 15, 2019, 10 p.m. UTC | #1
On Mon, Aug 12, 2019 at 06:12:44PM -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.
> 
> v2:
>   - Rebase to master, commit 36e0186296a7.
>   - Incorporate patch to require EADD be aligned, and add a selftest
>     update to obey the new alignment requirement.

Looks great!

I'll squash these and some selftest changes and send the next version
of the patch set. Thank you.

/Jarkko