Skip to content

x86/vdso: x86/sgx: Rework SGX vDSO API

Sean Christopherson linux-sgx 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 5 repliesIn review

Changes in v1 from the cover letter

- Drop the EXIT_ON_INTERRUPT patch. [Andy]
- Fix the macro names in the assembly code. [Jarkko]
- Move the leaf back into the exception sub-struct. The leaf is fully redundant with SGX_SYNCHRONOUS_EXIT.
- Add selftest support. [Jarkko]

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6x86/vdso: x86/sgx: Explicitly force 8-byte CMP for detecting user handlerarch/x86/entry/vdso/vsgx_enter_enclave.S+1 -10 replies
2/6x86/vdso: x86/sgx: Rework __vdso_sgx_enter_enclave() APIarch/x86/entry/vdso/vsgx_enter_enclave.S arch/x86/include/uapi/asm/sgx.h+103 -551 reply
3/6x86/vdso: x86/sgx: Introduce dedicated SGX exit reasons for vDSOarch/x86/entry/vdso/vsgx_enter_enclave.S arch/x86/include/uapi/asm/sgx.h+8 -21 reply
4/6selftests/sgx: Update the SGX selftest to match the reworked vDSO APItools/testing/selftests/sgx/call.S tools/testing/selftests/sgx/main.c tools/testing/selftests/sgx/main.h+9 -141 reply
5/6selftests/sgx: Sanity check the return value of the vDSO calltools/testing/selftests/sgx/main.c+25 -101 reply
6/6selftests/sgx: Add a smoke test to ensure the user handler is invokedtools/testing/selftests/sgx/main.c+19 -01 reply

Reviews trailers per patch

5 of 6 patches have a Reviewed-by or Acked-by.

PatchJarkko SakkinenJethro Beekman
1/6A-b A-b
2/6A-b
3/6Ack-by
4/6A-b
5/6A-b
6/6A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH for_v37 0/6] x86/vdso: x86/sgx: Rework SGX vDSO API

Rework __vdso_sgx_enter_enclave() to move all input/output params, except for pass-through GPRs, into a single struct. With the new struct, add a pass-through param requested by Nathaniel[1], fix a long-standing nit from Andy[2], and add a flags field to allow for future extensions.

1. Add an opaque param to pass data from the runtime to its handler.
https://lkml.kernel.org/r/CAOASepOFh-vOrNZEVDFrDSuHs+9GEzzpXUTG-fZMuyjWAkpRWw@mail.gmail.com

2. Use a dedicated exit reason instead of using -EFAULT for "exception" (and effectively -EINTR for interrupts, too).
https://lkml.kernel.org/r/[email protected]

RFC->V1:
- Drop the EXIT_ON_INTERRUPT patch. [Andy]
- Fix the macro names in the assembly code. [Jarkko]
- Move the leaf back into the exception sub-struct. The leaf is fully redundant with SGX_SYNCHRONOUS_EXIT.
- Add selftest support. [Jarkko]

Jarkko, I didn't address you comment about moving the vDSO kernel docs comments to the .rst file because I have an question on that and didn't want to hold this up. But Intel's mail servers appear to be on the fritz, so it might be a moot point...

Sean Christopherson (6):
x86/vdso: x86/sgx: Explicitly force 8-byte CMP for detecting user
handler
x86/vdso: x86/sgx: Rework __vdso_sgx_enter_enclave() API x86/vdso: x86/sgx: Introduce dedicated SGX exit reasons for vDSO selftests/sgx: Update the SGX selftest to match the reworked vDSO API selftests/sgx: Sanity check the return value of the vDSO call selftests/sgx: Add a smoke test to ensure the user handler is invoked

 arch/x86/entry/vdso/vsgx_enter_enclave.S | 76 +++++++++++++-------
 arch/x86/include/uapi/asm/sgx.h          | 88 ++++++++++++++++--------
 tools/testing/selftests/sgx/call.S       | 10 +--
 tools/testing/selftests/sgx/main.c       | 61 ++++++++++++----
 tools/testing/selftests/sgx/main.h       |  2 +-
 5 files changed, 160 insertions(+), 77 deletions(-)
Signature · 1 line
2.28.0