Skip to content

x86/sgx: Clean up and enhance add pages ioctl

Sean Christopherson linux-sgx 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 25 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7x86/sgx: Remove dead code to handle non-existent IOR ioctlarch/x86/kernel/cpu/sgx/driver/ioctl.c+1 -70 replies
2/7x86/sgx: Remove unnecessary @cmd parameter from ioctl helpersarch/x86/kernel/cpu/sgx/driver/ioctl.c+6 -150 replies
3/7x86/sgx: Let ioctl helpers do copy to/from userarch/x86/kernel/cpu/sgx/driver/ioctl.c+34 -390 replies
4/7x86/sgx: Allow userspace to add multiple pages in single ioctl()Documentation/x86/sgx/3.API.rst arch/x86/include/uapi/asm/sgx.h arch/x86/kernel/cpu/sgx/driver/ioctl.c+98 -536 replies
5/7x86/sgx: Add flag to zero added region instead of copying from sourcearch/x86/include/uapi/asm/sgx.h arch/x86/kernel/cpu/sgx/driver/ioctl.c+17 -311 replies
6/7x86/sgx: Use the actual zero page as the source when adding zero pagesarch/x86/kernel/cpu/sgx/driver/ioctl.c+32 -180 replies
7/7x86/sgx: Add a reserved field to sgx_enclave_add_region to drop 'packed'arch/x86/include/uapi/asm/sgx.h arch/x86/kernel/cpu/sgx/driver/ioctl.c+6 -16 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/7] x86/sgx: Clean up and enhance add pages ioctl

This series is intended to be included in v21 of Jarkko's SGX series and applies on Jarkko's current master:

dfc89a83b5bc ("docs: x86/sgx: Document the enclave API")

The primary goal of the series is to tweak the ioctl for adding pages to an enclave so that it is somewhat extensible, e.g. add a flags field that can be reused for access control integration and SGX2/EAUG, and add a size field so that multiple pages can be added in a single call (batching EADD has been mentioned at various times in the past).

The secondary goal is to improve the performance of building enclaves. Handling multiple pages in a single call helps somewhat, but the real win (for some enclaves) is using the kernel's zero page as the source for EADD when possible.

Sean Christopherson (7):
x86/sgx: Remove dead code to handle non-existent IOR ioctl x86/sgx: Remove unnecessary @cmd parameter from ioctl helpers x86/sgx: Let ioctl helpers do copy to/from user
x86/sgx: Allow userspace to add multiple pages in single ioctl() x86/sgx: Add flag to zero added region instead of copying from source x86/sgx: Use the actual zero page as the source when adding zero pages x86/sgx: Add a reserved field to sgx_enclave_add_region to drop
'packed'

 Documentation/x86/sgx/3.API.rst        |   2 +-
 arch/x86/include/uapi/asm/sgx.h        |  30 +--
 arch/x86/kernel/cpu/sgx/driver/ioctl.c | 252 +++++++++++++++----------
 3 files changed, 171 insertions(+), 113 deletions(-)
Signature · 1 line
2.21.0