Update SGX SDK 2.15.1

This commit is contained in:
zongmin.gu 2021-12-02 16:07:56 +08:00 committed by Zongmin.Gu
parent a26a7627fe
commit 8fbb9b4796
7 changed files with 31 additions and 30 deletions

2
deps/rust-sgx-sdk vendored

@ -1 +1 @@
Subproject commit e61c9a5ce5e4a0161696e9c1a75807fef105c9aa Subproject commit ae7ec5901c75b41626011a9e3c87b4a9b194f598

30
src/libos/Cargo.lock generated

@ -232,7 +232,7 @@ dependencies = [
[[package]] [[package]]
name = "hashbrown_tstd" name = "hashbrown_tstd"
version = "0.9.0" version = "0.11.2"
[[package]] [[package]]
name = "ident_case" name = "ident_case"
@ -588,11 +588,11 @@ dependencies = [
[[package]] [[package]]
name = "sgx_alloc" name = "sgx_alloc"
version = "1.1.3" version = "1.1.4"
[[package]] [[package]]
name = "sgx_backtrace_sys" name = "sgx_backtrace_sys"
version = "1.1.3" version = "1.1.4"
dependencies = [ dependencies = [
"cc", "cc",
"sgx_build_helper", "sgx_build_helper",
@ -601,11 +601,11 @@ dependencies = [
[[package]] [[package]]
name = "sgx_build_helper" name = "sgx_build_helper"
version = "0.1.3" version = "1.1.4"
[[package]] [[package]]
name = "sgx_cov" name = "sgx_cov"
version = "1.1.3" version = "1.1.4"
dependencies = [ dependencies = [
"lazy_static", "lazy_static",
"profiler_builtins", "profiler_builtins",
@ -617,18 +617,18 @@ dependencies = [
[[package]] [[package]]
name = "sgx_demangle" name = "sgx_demangle"
version = "1.1.3" version = "1.1.4"
[[package]] [[package]]
name = "sgx_libc" name = "sgx_libc"
version = "1.1.3" version = "1.1.4"
dependencies = [ dependencies = [
"sgx_types", "sgx_types",
] ]
[[package]] [[package]]
name = "sgx_rand" name = "sgx_rand"
version = "1.1.3" version = "1.1.4"
dependencies = [ dependencies = [
"sgx_trts", "sgx_trts",
"sgx_tstd", "sgx_tstd",
@ -637,14 +637,14 @@ dependencies = [
[[package]] [[package]]
name = "sgx_tcrypto" name = "sgx_tcrypto"
version = "1.1.3" version = "1.1.4"
dependencies = [ dependencies = [
"sgx_types", "sgx_types",
] ]
[[package]] [[package]]
name = "sgx_tprotected_fs" name = "sgx_tprotected_fs"
version = "1.1.3" version = "1.1.4"
dependencies = [ dependencies = [
"sgx_trts", "sgx_trts",
"sgx_types", "sgx_types",
@ -652,7 +652,7 @@ dependencies = [
[[package]] [[package]]
name = "sgx_trts" name = "sgx_trts"
version = "1.1.3" version = "1.1.4"
dependencies = [ dependencies = [
"sgx_libc", "sgx_libc",
"sgx_types", "sgx_types",
@ -660,14 +660,14 @@ dependencies = [
[[package]] [[package]]
name = "sgx_tse" name = "sgx_tse"
version = "1.1.3" version = "1.1.4"
dependencies = [ dependencies = [
"sgx_types", "sgx_types",
] ]
[[package]] [[package]]
name = "sgx_tstd" name = "sgx_tstd"
version = "1.1.3" version = "1.1.4"
dependencies = [ dependencies = [
"hashbrown_tstd", "hashbrown_tstd",
"sgx_alloc", "sgx_alloc",
@ -682,11 +682,11 @@ dependencies = [
[[package]] [[package]]
name = "sgx_types" name = "sgx_types"
version = "1.1.3" version = "1.1.4"
[[package]] [[package]]
name = "sgx_unwind" name = "sgx_unwind"
version = "0.1.1" version = "1.1.4"
dependencies = [ dependencies = [
"sgx_build_helper", "sgx_build_helper",
] ]

@ -1 +1 @@
nightly-2020-10-25 nightly-2021-09-13

@ -14,7 +14,6 @@
#![feature(negative_impls)] #![feature(negative_impls)]
// for may_dangle in rw_lock // for may_dangle in rw_lock
#![feature(dropck_eyepatch)] #![feature(dropck_eyepatch)]
#![feature(option_expect_none)]
// for UntrustedSliceAlloc in slice_alloc // for UntrustedSliceAlloc in slice_alloc
#![feature(slice_ptr_get)] #![feature(slice_ptr_get)]
#![feature(maybe_uninit_extra)] #![feature(maybe_uninit_extra)]
@ -23,6 +22,7 @@
#![feature(test)] #![feature(test)]
#![feature(atomic_from_mut)] #![feature(atomic_from_mut)]
#![feature(btree_drain_filter)] #![feature(btree_drain_filter)]
#![feature(bench_black_box)]
#[macro_use] #[macro_use]
extern crate alloc; extern crate alloc;

@ -214,11 +214,12 @@ impl Thread {
) )
.unwrap(); .unwrap();
THREAD_NOTIFIERS let event_file = THREAD_NOTIFIERS.lock().unwrap().insert(self.tid(), eventfd);
.lock()
.unwrap() assert!(
.insert(self.tid(), eventfd) event_file.is_none(),
.expect_none("this thread should not have an eventfd before start"); "this thread should not have an eventfd before start"
);
#[cfg(feature = "syscall_timing")] #[cfg(feature = "syscall_timing")]
self.profiler() self.profiler()

@ -1,5 +1,5 @@
use super::*; use super::*;
use std::alloc::{AllocError, AllocRef, Layout}; use std::alloc::{AllocError, Allocator, Layout};
use std::ptr::{self, write_bytes, NonNull}; use std::ptr::{self, write_bytes, NonNull};
/// The global memory allocator for untrusted memory /// The global memory allocator for untrusted memory
@ -7,8 +7,8 @@ pub static mut UNTRUSTED_ALLOC: UntrustedAlloc = UntrustedAlloc;
pub struct UntrustedAlloc; pub struct UntrustedAlloc;
unsafe impl AllocRef for UntrustedAlloc { unsafe impl Allocator for UntrustedAlloc {
fn alloc(&self, layout: Layout) -> std::result::Result<NonNull<[u8]>, AllocError> { fn allocate(&self, layout: Layout) -> std::result::Result<NonNull<[u8]>, AllocError> {
if layout.size() == 0 { if layout.size() == 0 {
return Err(AllocError); return Err(AllocError);
} }
@ -43,7 +43,7 @@ unsafe impl AllocRef for UntrustedAlloc {
.unwrap()) .unwrap())
} }
unsafe fn dealloc(&self, ptr: NonNull<u8>, layout: Layout) { unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout) {
// Pre-condition: out-of-enclave // Pre-condition: out-of-enclave
debug_assert!(sgx_trts::trts::rsgx_raw_is_outside_enclave( debug_assert!(sgx_trts::trts::rsgx_raw_is_outside_enclave(
ptr.as_ptr(), ptr.as_ptr(),

@ -1,5 +1,5 @@
use super::*; use super::*;
use std::alloc::{AllocError, AllocRef, Layout}; use std::alloc::{AllocError, Allocator, Layout};
use std::ptr::NonNull; use std::ptr::NonNull;
use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::atomic::{AtomicUsize, Ordering};
@ -26,7 +26,7 @@ impl UntrustedSliceAlloc {
} }
let layout = Layout::from_size_align(buf_size, 1)?; let layout = Layout::from_size_align(buf_size, 1)?;
let buf_ptr = unsafe { UNTRUSTED_ALLOC.alloc(layout)?.as_mut_ptr() }; let buf_ptr = unsafe { UNTRUSTED_ALLOC.allocate(layout)?.as_mut_ptr() };
let buf_pos = AtomicUsize::new(0); let buf_pos = AtomicUsize::new(0);
Ok(Self { Ok(Self {
@ -72,7 +72,7 @@ impl Drop for UntrustedSliceAlloc {
let layout = Layout::from_size_align(self.buf_size, 1).unwrap(); let layout = Layout::from_size_align(self.buf_size, 1).unwrap();
unsafe { unsafe {
UNTRUSTED_ALLOC.dealloc(NonNull::new(self.buf_ptr).unwrap(), layout); UNTRUSTED_ALLOC.deallocate(NonNull::new(self.buf_ptr).unwrap(), layout);
} }
} }
} }