incubator-teaclave-sgx-sdk
incubator-teaclave-sgx-sdk copied to clipboard
Implement enclave memory management
@ClawSeven Hi, I notice two issues with your PR:
- your
emm
sample code cannot be built withBUILD_STD=cargo
- 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, however, I see problems withhttpreq
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!
@ClawSeven Hi, I notice two issues with your PR:
- your
emm
sample code cannot be built withBUILD_STD=cargo
- 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, however, I see problems withhttpreq
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?
@ClawSeven Hi, I notice two issues with your PR:
- your
emm
sample code cannot be built withBUILD_STD=cargo
- 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, however, I see problems withhttpreq
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.
@ClawSeven Hi, I notice two issues with your PR:
- your
emm
sample code cannot be built withBUILD_STD=cargo
- 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, however, I see problems withhttpreq
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
I also fixed the first issue. Rust_STD_Features
in the Makefile needs to include thread
.
@yangfh2004 , Hi, thanks for your two issue.
-
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.
-
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?
@yangfh2004 Btw, I have tested the httpreq
with rustc 1.78.0-nightly (397937d81 2024-02-22)
. It also worked well.
@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
@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.