forked from openenclave/openenclave
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
4276: SGX thread interrupt support on Linux r=mingweishih a=mingweishih This PR adds the OE internal support for the thread interrupt on Linux. The support allows an sophisticated application built on top of OE to implement the thread preemption mechanism. The highlight of this PR is as follows. - Now the host is forwarding the host signals to the enclave (require the enclave to opt-in) - Introduce an "interrupt request" logic in the enclave enter flow - The host needs to pass an input (value=signo) when entering the enclave (after an AEX occurred) - Upon such entry, the enclave checks whether it's an interrupt request. If it's then checking states on the td to determine whether to serve the request - Introduce the enclave "direct return" flow - Now when the enclave logic detects invalid conditions, the enclave will directly "return" to the host (EENTER -> EEXIT) instead of aborting. This allows the enclave runtime to robust handle interrupt requests that could arrive at any time. - Introduce state machine on the td, which is mainly used to indicate whether the enclave can serve an interrupt request The PR also adds an end-to-end test that demonstrates the interrupt flow (say `thread 1` wants to interrupt `thread 2`): a. `thread 1` - Make an ocall to create `thread 2` - Wait for the `thread 2` to initialize b. `thread 2` - Register an exception handler - Unmask the interrupt c. `thread 1` - Register the host signal (e.g., `SIGUSR1`) for `thread 2` - Make an ocall to send `SIGUSR1` signal to the `thread 2` d. `thread 2` - The exception handler is invoked after receiving an interrupt Signed-off-by: Ming-Wei Shih <[email protected]> Co-authored-by: Ming-Wei Shih <[email protected]>
- Loading branch information
Showing
26 changed files
with
2,033 additions
and
77 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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.