-
Notifications
You must be signed in to change notification settings - Fork 107
Support upstream driver #181
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
Merged
Merged
Conversation
This file contains hidden or 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
68feb99 to
c5c3d67
Compare
parthsane
reviewed
Oct 23, 2019
fc94da6 to
704ec3a
Compare
704ec3a to
b33b083
Compare
Closed
b33b083 to
8b712a9
Compare
8b712a9 to
b9c2935
Compare
b9c2935 to
f1afa65
Compare
f1afa65 to
77a2b02
Compare
Member
Author
|
Ready for review, tested against Linux 5.11-rc2 |
77a2b02 to
23bff3f
Compare
Contributor
|
bors r+ |
bors bot
added a commit
that referenced
this pull request
Jan 28, 2021
181: Support upstream driver r=raoulstrackx a=jethrogb See also the [Linux kernel documentation for __vdso_sgx_enter_enclave](https://github.com/torvalds/linux/blob/84292fffc2468125632a21c09533a89426ea212e/arch/x86/include/uapi/asm/sgx.h#L123-L166) Co-authored-by: Jethro Beekman <jethro@fortanix.com>
Contributor
|
Build failed: |
23bff3f to
30cb51c
Compare
30cb51c to
1f4c0a3
Compare
Member
Author
|
Non-rebase part of my latest push: diff --git a/.travis.yml b/.travis.yml
index 48980cc..83d2c28 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -29,7 +29,7 @@ matrix:
before_script:
- rustup target add x86_64-fortanix-unknown-sgx x86_64-unknown-linux-musl
script:
- - cargo test --verbose --all --exclude sgxs-loaders
+ - cargo test --verbose --all --exclude sgxs-loaders && [ "$(echo $(nm -D target/debug/sgx-detect|grep __vdso_sgx_enter_enclave))" = "w __vdso_sgx_enter_enclave" ]
- cargo test --verbose -p sgx-isa --features sgxstd --target x86_64-fortanix-unknown-sgx --no-run
- cargo test --verbose -p sgxs-tools --features pe2sgxs --bin isgx-pe2sgx
- cargo test --verbose -p dcap-ql --features link
diff --git a/enclave-runner/src/tcs.rs b/enclave-runner/src/tcs.rs
index a890867..35c8676 100644
--- a/enclave-runner/src/tcs.rs
+++ b/enclave-runner/src/tcs.rs
@@ -75,6 +75,7 @@ pub(crate) fn coenter<T: Tcs>(
// `--as-needed` to the linker. This is never executed because
// of the unconditional jump above.
.global __vdso_clock_gettime
+.type __vdso_clock_gettime, function
call __vdso_clock_gettime@PLT
1:
@@ -138,6 +139,8 @@ pub(crate) fn coenter<T: Tcs>(
asm!("
sub $0x8, %rsp // align stack
push {} // push argument: run
+.weak __vdso_sgx_enter_enclave
+.type __vdso_sgx_enter_enclave, function
call __vdso_sgx_enter_enclave@PLT
add $0x10, %rsp // restore stack pointer
",
@@ -163,7 +166,7 @@ pub(crate) fn coenter<T: Tcs>(
match sgx_result.try_into() {
Ok(Enclu::EExit) => { /* normal case */ },
Ok(Enclu::EResume) => {
- if let Some(mut debug_buf) = debug_buf {
+ if let Some(mut debug_buf) = debug_buf {
let _ = write!(&mut debug_buf[..], "Enclave triggered exception: {:?}\0", run);
} else {
eprintln!("Enclave triggered exception, treating as panic: {:?}", run); |
Contributor
|
bors r+ |
Contributor
|
Build succeeded:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
See also the Linux kernel documentation for __vdso_sgx_enter_enclave