forked from tokio-rs/tokio
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SGX port tokio 1.34.0 #2
Closed
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
bd006c9
Add support for the `x86_64-fortanix-unknown-sgx` target
raoulstrackx 2ec6af8
Fix `assert_called_from_owner_thread` debug assertion on SGX platform
raoulstrackx 2d6b3f9
Add local CI support
raoulstrackx bac53b6
Point to vn971 repo
raoulstrackx 4799528
Address reviewer comments
raoulstrackx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash -ex | ||
repo_root=$(readlink -f $(dirname ${BASH_SOURCE[0]})) | ||
cd ${repo_root} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Part of the "local CI" commit. May be removed before upstreaming |
||
|
||
source ${repo_root}/ct_env.sh | ||
|
||
cargo test | ||
|
||
pushd tokio | ||
cargo test --target x86_64-fortanix-unknown-sgx --features "full-sgx" | ||
popd | ||
|
||
pushd tokio-macros | ||
cargo test --target x86_64-fortanix-unknown-sgx | ||
popd | ||
|
||
pushd tokio-stream | ||
cargo test --target x86_64-fortanix-unknown-sgx | ||
popd | ||
|
||
pushd stress-test | ||
cargo test --target x86_64-fortanix-unknown-sgx | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash -ex | ||
repo_root=$(readlink -f $(dirname ${BASH_SOURCE[0]})) | ||
cd ${repo_root} | ||
|
||
# Unfortunately, the `ftxsgx-runner-cargo` application doesn't enable us to point to a runner within the same workspace. We use a hack here by pointing to `enclave-runner` and making sure such an executable exists when running CI | ||
pushd enclave-runner | ||
cargo build | ||
popd | ||
|
||
export PATH=${repo_root}/target/debug/:${PATH} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[package] | ||
name = "enclave-runner" | ||
version = "0.1.0" | ||
edition = "2018" | ||
|
||
[dependencies] | ||
aesm-client = { version = "0.2", features = ["sgxs"] } | ||
clap = "2.0" | ||
enclave-runner = "0.5" | ||
sgxs-loaders = "0.3.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
use aesm_client::AesmClient; | ||
use clap::{App, Arg}; | ||
use enclave_runner::EnclaveBuilder; | ||
|
||
#[cfg(windows)] | ||
use sgxs_loaders::enclaveapi::Sgx as IsgxDevice; | ||
#[cfg(unix)] | ||
use sgxs_loaders::isgx::Device as IsgxDevice; | ||
|
||
fn main() { | ||
let args = App::new("runner") | ||
.arg(Arg::with_name("file").required(true)) | ||
.arg( | ||
Arg::with_name("enclave-args") | ||
.long_help( | ||
"Arguments passed to the enclave. \ | ||
Note that this is not an appropriate channel for passing \ | ||
secrets or security configurations to the enclave.", | ||
) | ||
.multiple(true), | ||
) | ||
.get_matches(); | ||
|
||
let file = args.value_of("file").unwrap(); | ||
|
||
let mut device = IsgxDevice::new() | ||
.expect("failed to open SGX device") | ||
.einittoken_provider(AesmClient::new()) | ||
.build(); | ||
|
||
let mut enclave_builder = EnclaveBuilder::new(file.as_ref()); | ||
if let Err(_) = enclave_builder.coresident_signature() { | ||
enclave_builder.dummy_signature(); | ||
} | ||
|
||
if let Some(enclave_args) = args.values_of("enclave-args") { | ||
enclave_builder.args(enclave_args); | ||
} | ||
|
||
let enclave = enclave_builder | ||
.build(&mut device) | ||
.expect("failed to load SGX enclave"); | ||
|
||
match enclave.run() { | ||
Err(e) => { | ||
eprintln!("Error while executing SGX enclave.\n{}", e); | ||
std::process::exit(-1) | ||
} | ||
Ok(()) => {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update patches before trying to upstream. Needs this and this PR