You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@teaclave.apache.org by Zehuan Li <no...@github.com.INVALID> on 2023/06/09 11:14:35 UTC
[apache/incubator-teaclave-sgx-sdk] Implement enclave memory management (PR #436)
You can view, comment on, or merge this pull request online at:
https://github.com/apache/incubator-teaclave-sgx-sdk/pull/436
-- Commit Summary --
* Implement enclave memory management
-- File Changes --
M sgx_trts/Cargo.toml (4)
M sgx_trts/src/arch.rs (16)
M sgx_trts/src/call/ocall.rs (8)
M sgx_trts/src/edmm/epc.rs (15)
M sgx_trts/src/edmm/mem.rs (12)
M sgx_trts/src/edmm/mod.rs (2)
M sgx_trts/src/edmm/perm.rs (70)
M sgx_trts/src/edmm/tcs.rs (6)
A sgx_trts/src/emm/alloc.rs (31)
A sgx_trts/src/emm/bitmap.rs (160)
A sgx_trts/src/emm/ema.rs (454)
A sgx_trts/src/emm/emalist.rs (31)
A sgx_trts/src/emm/flags.rs (82)
A sgx_trts/src/emm/interior.rs (242)
A sgx_trts/src/emm/mod.rs (24)
A sgx_trts/src/emm/user.rs (96)
M sgx_trts/src/lib.rs (3)
-- Patch Links --
https://github.com/apache/incubator-teaclave-sgx-sdk/pull/436.patch
https://github.com/apache/incubator-teaclave-sgx-sdk/pull/436.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/apache/incubator-teaclave-sgx-sdk/pull/436
You are receiving this because you are subscribed to this thread.
Message ID: <apache/incubator-teaclave-sgx-sdk/pull/436@github.com>
Re: [apache/incubator-teaclave-sgx-sdk] Implement enclave memory management (PR #436)
Posted by Zehuan Li <no...@github.com.INVALID>.
@yangfh2004 Hello, I'm pleased to know that the EDMM feature has been integrated into your project. Unfortunately, the simulation mode (SW mode) for EDMM is not on our current roadmap, primarily because Intel does not offer support for EDMM in SW mode, and I am currently at full capacity, preventing me from undertaking the implementation of this feature.
However, conceptually speaking, I believe the SW mode could be relatively straightforward to implement using system calls like mmap and munmap.
--
Reply to this email directly or view it on GitHub:
https://github.com/apache/incubator-teaclave-sgx-sdk/pull/436#issuecomment-2133031533
You are receiving this because you are subscribed to this thread.
Message ID: <ap...@github.com>
Re: [apache/incubator-teaclave-sgx-sdk] Implement enclave memory management (PR #436)
Posted by Fanghao Yang <no...@github.com.INVALID>.
> @ClawSeven Hi, I notice two issues with your PR:
>
> 1. your `emm` sample code cannot be built with `BUILD_STD=cargo`
> 2. I merged your commits in this PR into the current `v2.0.0-preview` branch to support the latest rust toolchain as this [fork branch](https://gitlab.com/dexlabs/incubator-teaclave-sgx-sdk/-/tree/v2.0.0-sgx-emm?ref_type=heads), however, I see problems with `httpreq` sample code, it will have pointer alignment issues while doing ocall "u_getaddrinfo_ocall", the pointer address of the argument and the return value is misaligned, which will cause panic in the repo. It seems that your implementation has some conflicts with the recent Rust toolchain.
> Please take a look, thank you!
The second issue has an easy fix, essentially, all problems are due to the alignment checks in dereference of raw pointers. We just need to use `read_unaligned` or `write_unaligned`
--
Reply to this email directly or view it on GitHub:
https://github.com/apache/incubator-teaclave-sgx-sdk/pull/436#issuecomment-1952851066
You are receiving this because you are subscribed to this thread.
Message ID: <ap...@github.com>
Re: [apache/incubator-teaclave-sgx-sdk] Implement enclave memory management (PR #436)
Posted by Fanghao Yang <no...@github.com.INVALID>.
> > @ClawSeven Hi, I notice two issues with your PR:
> >
> > 1. your `emm` sample code cannot be built with `BUILD_STD=cargo`
> > 2. I merged your commits in this PR into the current `v2.0.0-preview` branch to support the latest rust toolchain as this [fork branch](https://gitlab.com/dexlabs/incubator-teaclave-sgx-sdk/-/tree/v2.0.0-sgx-emm?ref_type=heads), however, I see problems with `httpreq` sample code, it will have pointer alignment issues while doing ocall "u_getaddrinfo_ocall", the pointer address of the argument and the return value is misaligned, which will cause panic in the repo. It seems that your implementation has some conflicts with the recent Rust toolchain.
> > Please take a look, thank you!
>
> Is upgrading Intel SGX SDK to 2.21 to enable EDMM?
Thanks a lot for your reply, we are using SGX2 on 3rd Gen Xeon Scalable Processor with MKTME, and we will need large dynamic heap allocations. We are now using v1.1.6 with Intel SGX SDK 2.21. We are trying to upgrade to v2.0.0 with support to the later Rust toolchain.
--
Reply to this email directly or view it on GitHub:
https://github.com/apache/incubator-teaclave-sgx-sdk/pull/436#issuecomment-1951412654
You are receiving this because you are subscribed to this thread.
Message ID: <ap...@github.com>
Re: [apache/incubator-teaclave-sgx-sdk] Implement enclave memory management (PR #436)
Posted by Fanghao Yang <no...@github.com.INVALID>.
@ClawSeven Hi, our team is using your emm branch, which works OK. But we want to request some supports to the simulation mode (SW mode) so that we can build and run our enclave without sgx drivers. Do you have a chance to add SW supports to your branch? Thanks
--
Reply to this email directly or view it on GitHub:
https://github.com/apache/incubator-teaclave-sgx-sdk/pull/436#issuecomment-2075548631
You are receiving this because you are subscribed to this thread.
Message ID: <ap...@github.com>
Re: [apache/incubator-teaclave-sgx-sdk] Implement enclave memory management (PR #436)
Posted by Zehuan Li <no...@github.com.INVALID>.
@yangfh2004 Btw, I have tested the `httpreq` with `rustc 1.78.0-nightly (397937d81 2024-02-22)`. It also worked well.
--
Reply to this email directly or view it on GitHub:
https://github.com/apache/incubator-teaclave-sgx-sdk/pull/436#issuecomment-1960986008
You are receiving this because you are subscribed to this thread.
Message ID: <ap...@github.com>
Re: [apache/incubator-teaclave-sgx-sdk] Implement enclave memory management (PR #436)
Posted by Fanghao Yang <no...@github.com.INVALID>.
@ClawSeven
Hi, I notice two issues with your PR:
1. your `emm` sample code cannot be built with `BUILD_STD=cargo`
2. I merged your commits in this PR into the current `v2.0.0-preview` branch to support the latest rust toolchain as this [fork branch](https://gitlab.com/dexlabs/incubator-teaclave-sgx-sdk/-/tree/v2.0.0-sgx-emm?ref_type=heads), however, I see problems with `httpreq` sample code, it will have pointer alignment issues while doing ocall "u_getaddrinfo_ocall", the pointer address of the argument and the return value is misaligned, which will cause panic in the repo. It seems that your implementation has some conflicts with the recent Rust toolchain.
Please take a look, thank you!
--
Reply to this email directly or view it on GitHub:
https://github.com/apache/incubator-teaclave-sgx-sdk/pull/436#issuecomment-1949443072
You are receiving this because you are subscribed to this thread.
Message ID: <ap...@github.com>
Re: [apache/incubator-teaclave-sgx-sdk] Implement enclave memory management (PR #436)
Posted by Zehuan Li <no...@github.com.INVALID>.
@yangfh2004 , Hi, thanks for your two issue.
1. Regarding the first issue, I have managed to replicate it and have confirmed that the Makefile for the EMM sample code indeed requires thread feature activation. I will address and resolve this promptly.
2. As for the second issue, I am unable to reproduce the scenario you've described. In my environment, the `httpreq` sample code works well without any panic. Could you please provide the version of your toolchain so that I can further investigate this matter?
--
Reply to this email directly or view it on GitHub:
https://github.com/apache/incubator-teaclave-sgx-sdk/pull/436#issuecomment-1960966112
You are receiving this because you are subscribed to this thread.
Message ID: <ap...@github.com>
Re: [apache/incubator-teaclave-sgx-sdk] Implement enclave memory management (PR #436)
Posted by volcano <no...@github.com.INVALID>.
> @ClawSeven Hi, I notice two issues with your PR:
>
> 1. your `emm` sample code cannot be built with `BUILD_STD=cargo`
> 2. I merged your commits in this PR into the current `v2.0.0-preview` branch to support the latest rust toolchain as this [fork branch](https://gitlab.com/dexlabs/incubator-teaclave-sgx-sdk/-/tree/v2.0.0-sgx-emm?ref_type=heads), however, I see problems with `httpreq` sample code, it will have pointer alignment issues while doing ocall "u_getaddrinfo_ocall", the pointer address of the argument and the return value is misaligned, which will cause panic in the repo. It seems that your implementation has some conflicts with the recent Rust toolchain.
> Please take a look, thank you!
Is upgrading Intel SGX SDK to 2.21 to enable EDMM?
--
Reply to this email directly or view it on GitHub:
https://github.com/apache/incubator-teaclave-sgx-sdk/pull/436#issuecomment-1950779980
You are receiving this because you are subscribed to this thread.
Message ID: <ap...@github.com>