Skip to content

Commit

Permalink
Async usercall interface for SGX enclaves
Browse files Browse the repository at this point in the history
Credits for this commit go to:
Mohsen: fortanix#404
YxC: fortanix#441

This commit is an attempt to have the async-usercalls finally merged
into the main codebase (master branch).
  • Loading branch information
Vasili Novikov committed Aug 29, 2023
1 parent 66e7a21 commit f917b37
Show file tree
Hide file tree
Showing 26 changed files with 2,276 additions and 89 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ matrix:
- clang-11
- musl-tools
rust:
- stable
- nightly-2023-05-07
env:
- RUST_BACKTRACE=1
- CFLAGS_x86_64_fortanix_unknown_sgx="-isystem/usr/include/x86_64-linux-gnu -mlvi-hardening -mllvm -x86-experimental-lvi-inline-asm-hardening"
Expand All @@ -44,7 +44,8 @@ matrix:
- rustup toolchain add nightly
- rustup target add x86_64-fortanix-unknown-sgx --toolchain nightly
script:
- cargo test --verbose --locked --all --exclude sgxs-loaders && [ "$(echo $(nm -D target/debug/sgx-detect|grep __vdso_sgx_enter_enclave))" = "w __vdso_sgx_enter_enclave" ]
- cargo test --verbose --locked --all --exclude sgxs-loaders --exclude async-usercalls && [ "$(echo $(nm -D target/debug/sgx-detect|grep __vdso_sgx_enter_enclave))" = "w __vdso_sgx_enter_enclave" ]
- cargo test --verbose --locked -p async-usercalls --target x86_64-fortanix-unknown-sgx --no-run
- cargo test --verbose --locked -p dcap-ql --features link
- cargo test --verbose --locked -p dcap-ql --features verify
- cargo test --verbose --locked -p ias --features mbedtls
Expand Down
117 changes: 87 additions & 30 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ members = [
"fortanix-vme/tests/iron",
"fortanix-vme/vme-pkix",
"intel-sgx/aesm-client",
"intel-sgx/async-usercalls",
"intel-sgx/dcap-provider",
"intel-sgx/dcap-ql-sys",
"intel-sgx/dcap-ql",
Expand Down
3 changes: 3 additions & 0 deletions doc/generate-api-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ for LIB in $LIBS_SORTED; do
if FEATURES="$(cargo read-manifest|jq -r '.metadata.docs.rs.features | join(",")' 2> /dev/null)"; then
ARGS="--features $FEATURES"
fi
if grep -q 'feature(sgx_platform)' ./src/lib.rs; then
ARGS+=" --target x86_64-fortanix-unknown-sgx"
fi
cargo doc --no-deps --lib $ARGS
popd
fi
Expand Down
29 changes: 29 additions & 0 deletions intel-sgx/async-usercalls/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[package]
name = "async-usercalls"
version = "0.5.0"
authors = ["Fortanix, Inc."]
license = "MPL-2.0"
edition = "2018"
description = """
An interface for asynchronous usercalls in SGX enclaves.
This is an SGX-only crate, you should compile it with the `x86_64-fortanix-unknown-sgx` target.
"""
repository = "https://github.com/fortanix/rust-sgx"
documentation = "https://edp.fortanix.com/docs/api/async_usercalls/"
homepage = "https://edp.fortanix.com/"
keywords = ["sgx", "async", "usercall"]
categories = ["asynchronous"]

[dependencies]
# Project dependencies
ipc-queue = { version = "0.2", path = "../../ipc-queue" }
fortanix-sgx-abi = { version = "0.5.0", path = "../fortanix-sgx-abi" }

# External dependencies
lazy_static = "1.4.0" # MIT/Apache-2.0
crossbeam-channel = "0.5" # MIT/Apache-2.0
fnv = "1.0" # MIT/Apache-2.0

# For cargo test --target x86_64-fortanix-unknown-sgx
[package.metadata.fortanix-sgx]
threads = 128
Loading

0 comments on commit f917b37

Please sign in to comment.