-
Notifications
You must be signed in to change notification settings - Fork 20
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
[Experimental] Add EDMM support #29
Draft
jessehui
wants to merge
96
commits into
occlum:sgx_2.17.1_for_occlum
Choose a base branch
from
jessehui:edmm_v5_ngo_latest_DEV
base: sgx_2.17.1_for_occlum
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
[Experimental] Add EDMM support #29
jessehui
wants to merge
96
commits into
occlum:sgx_2.17.1_for_occlum
from
jessehui:edmm_v5_ngo_latest_DEV
Conversation
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
Signed-off-by: Haitao Huang <[email protected]>
Add a runtime agnostic enclave memory manager implementation in sdk/emm. The EMM APIs are based on design proposed in this PR: openenclave/openenclave#3991 Enclave common loader changes are in psw/enclave_common/sgx_mm_ocalls.cpp, which are basically OCall support needed for EMM. Intel SDK runtime specific support are implemented as runtime abstraction layer: sdk/trts/ema_rt.c Current limitations, steps to build and test are documented in sdk/emm/README.md Signed-off-by: Haitao Huang <[email protected]> Signed-off-by: Xiaofeng Xu <[email protected]>
Signed-off-by: Haitao Huang <[email protected]>
The ioctl numbers for EDMM functions are shifted in upstream patches: https://patchwork.kernel.org/project/intel-sgx/cover/[email protected]/ Change those definitions accordingly in isgx_user.h Signed-off-by: Haitao Huang <[email protected]>
Signed-off-by: Haitao Huang <[email protected]>
Signed-off-by: Haitao Huang <[email protected]>
Add error checking for remove ioctl() Do emodt for multiple pages in on call Signed-off-by: Haitao Huang <[email protected]>
Signed-off-by: Haitao Huang <[email protected]>
Signed-off-by: Haitao Huang <[email protected]>
Signed-off-by: Haitao Huang <[email protected]>
This is to avoid unneeded ocall references in regular mutex implementation, which requires every enclave to import those ocalls in its EDL even if it does not need the mutex for synchronization. Signed-off-by: Haitao Huang <[email protected]>
This reverts commit 435c34b3afeca1e4590e1ba98291159d76a403a3. It does not work for DCAP driver
Signed-off-by: Haitao Huang <[email protected]>
Signed-off-by: Haitao Huang <[email protected]>
Signed-off-by: Haitao Huang <[email protected]>
Signed-off-by: Haitao Huang <[email protected]>
To minimize number of VMAs created by kernel Signed-off-by: Haitao Huang <[email protected]>
Signed-off-by: Haitao Huang <[email protected]>
Signed-off-by: Haitao Huang <[email protected]>
Signed-off-by: Haitao Huang <[email protected]>
Signed-off-by: Haitao Huang <[email protected]>
Signed-off-by: Haitao Huang <[email protected]>
Kernel(V5) allows emodpr to PROT_NONE directly Signed-off-by: Haitao Huang <[email protected]>
commit EPC of reserves before first use fix compile error for gcc 7.5 style and typo fixes Signed-off-by: Xiaofeng Xu <[email protected]> Signed-off-by: Haitao Huang <[email protected]>
This is necessary to enable builtin OCALL and commit-on-demand for emalloc reserves Signed-off-by: Haitao Huang <[email protected]>
Added a figure for overall arch Restructure the introduction section Signed-off-by: Haitao Huang <[email protected]>
…pi docs Signed-off-by: Haitao Huang <[email protected]>
Signed-off-by: Haitao Huang <[email protected]>
Adjust Enclave Common API compatible with existing style and definitions: 1) split flags in enclave_alloc to page type and alloc flags 2) return non-OS specific error code 3) add new API enclave_get_features Update EMM ocall definition: 1) Return EFAULT for all ocall failures 2) align sgx_mm_alloc with enclave_alloc to use separate parameters for page type and alloc_flags Signed-off-by: Haitao Huang <[email protected]>
Also EXEC always require READ Signed-off-by: Haitao Huang <[email protected]>
1. Fix urts_sim static library lack of symbols 2. Add new urts_sim static library needed by Occlum tools
In simulation mode, previously, ECREATE will commit all the pages which will cause ENOMEM if the size is very big. This patch fixed this by only reserving the pages (with PROT_NONE) in ECREATE but committing the pages in EADD.
This solution just works for us. Need an official solution form Intel.
signal comes from user application
The first executable segment (contains code section) should have PF_X flag.
… due to performance regression
Workloads in an enclave can be classified into two categories: statically-loaded and dynamically-loaded workloads. Statically-loaded workloads are application code that are built into the enclave; that is, they are part of the enclave since enclave initialization. Dynamically-loaded workloads, as the name suggests, are application code loaded after the enclave gets running. One typical example of dynamically-loaded workloads is user programs loaded by a SGX LibOS. The user programs could be arbitrary code. As a result, once the user program gets executed, the LibOS may never have the opportunity to take control of the CPU. Without the ability to regain the control, it is impossible for the LibOS to implement features like interruptible signal handler or preemptive in-enclave thread scheduling. To address the issue above, we implement the signal-based interrupt mechanism for dynamically-loaded workloads. With the provided APIs, the users can now interrupt the dynamically-loaded workloads executed in a SGX thread by simply sending a real-time POSIX signal (whose number is 64, the max value of signal numbers on Linux) to the SGX thread. The signal will be captured and (if the timing is good) a pre-registered interrupt handler will get executed inside the enclave.
Also add edmm api test in the install script. Simulation mode is not test heavily. When official EDMM support is released, this patch should be removed.
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.
Currently based on https://github.com/intel/linux-sgx/tree/edmm_v5 and apply patches from Occlum. This is a workable version.