Skip to content
This repository has been archived by the owner on Oct 26, 2021. It is now read-only.

WIP feat: use primordial git HEAD (future 0.2 release) #310

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ koine = { git = "https://github.com/enarx/koine", optional = true }
x86_64 = { version = "0.11", default-features = false, features = ["stable"], optional = true }
kvm-bindings = { version = "0.3", optional = true }
kvm-ioctls = { version = "0.6", optional = true }
primordial = "0.1"
primordial = { git = "https://github.com/enarx/primordial" }
structopt = "0.3"
iocuddle = "0.1"
ciborium = "0.1"
Expand Down
2 changes: 1 addition & 1 deletion internal/sallyport/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ keywords = [

[dependencies]
libc = { version = "0.2", features = [] }
primordial = "0.1"
primordial = { git = "https://github.com/enarx/primordial" }

[features]
default = ["std"]
Expand Down
2 changes: 1 addition & 1 deletion internal/sgx-heap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ publish = false

[dependencies]
libc = { version = "0.2", default-features = false }
primordial = "0.1"
primordial = { git = "https://github.com/enarx/primordial" }
lset = "0.1"
5 changes: 2 additions & 3 deletions internal/shim-sev/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/shim-sev/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ goblin = { version = "0.3", default-features = false, features = [ "elf64" ] }
crt0stack = { version = "0.1", default-features = false }
spinning = { version = "0.1", default-features = false }
libc = { version = "0.2", default-features = false }
primordial = "0.1"
primordial = { git = "https://github.com/enarx/primordial" }
nbytes = "0.1"
lset = "0.1"
array-const-fn-init = "0.1"
Expand Down
17 changes: 11 additions & 6 deletions internal/shim-sgx/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/shim-sgx/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ sgx = { git = "https://github.com/enarx/sgx", rev = "5292e53", features = [ "asm
goblin = { version = "0.3", default-features = false, features = [ "elf64" ] }
crt0stack = { version = "0.1", default-features = false }
libc = { version = "0.2", default-features = false }
primordial = "0.1"
primordial = { git = "https://github.com/enarx/primordial" }
nbytes = "0.1"
lset = "0.1"
xsave = "0.1.1"
Expand Down
18 changes: 9 additions & 9 deletions internal/shim-sgx/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,21 @@ pub extern "C" fn event(
match unsafe { h.aex.gpr.rip.into_slice(2usize) } {
OP_SYSCALL => {
let ret = h.syscall(
h.aex.gpr.rdi.into(),
h.aex.gpr.rsi.into(),
h.aex.gpr.rdx.into(),
h.aex.gpr.r10.into(),
h.aex.gpr.r8.into(),
h.aex.gpr.r9.into(),
h.aex.gpr.rax.into(),
usize::from(h.aex.gpr.rdi).into(),
usize::from(h.aex.gpr.rsi).into(),
usize::from(h.aex.gpr.rdx).into(),
usize::from(h.aex.gpr.r10).into(),
usize::from(h.aex.gpr.r8).into(),
usize::from(h.aex.gpr.r9).into(),
usize::from(h.aex.gpr.rax).into(),
);

aex.gpr.rip = (usize::from(aex.gpr.rip) + 2).into();
match ret {
Err(e) => aex.gpr.rax = (-e).into(),
Ok([rax, rdx]) => {
aex.gpr.rax = rax.into();
aex.gpr.rdx = rdx.into();
aex.gpr.rax = usize::from(rax).into();
aex.gpr.rdx = usize::from(rdx).into();
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions internal/shim-sgx/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl<'a> Handler<'a> {
);
}

self.block.msg.req = request!(SYS_ENARX_CPUID => self.aex.gpr.rax, self.aex.gpr.rcx);
self.block.msg.req = request!(SYS_ENARX_CPUID => usize::from(self.aex.gpr.rax), usize::from(self.aex.gpr.rcx));

unsafe {
// prevent earlier writes from being moved beyond this point
Expand All @@ -91,10 +91,10 @@ impl<'a> Handler<'a> {
// prevent later reads from being moved before this point
core::sync::atomic::compiler_fence(core::sync::atomic::Ordering::Acquire);

self.aex.gpr.rax = self.block.msg.req.arg[0].into();
self.aex.gpr.rbx = self.block.msg.req.arg[1].into();
self.aex.gpr.rcx = self.block.msg.req.arg[2].into();
self.aex.gpr.rdx = self.block.msg.req.arg[3].into();
self.aex.gpr.rax = usize::from(self.block.msg.req.arg[0]).into();
self.aex.gpr.rbx = usize::from(self.block.msg.req.arg[1]).into();
self.aex.gpr.rcx = usize::from(self.block.msg.req.arg[2]).into();
self.aex.gpr.rdx = usize::from(self.block.msg.req.arg[3]).into();
}

if TRACE {
Expand Down
2 changes: 1 addition & 1 deletion internal/syscall/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ publish = false
sallyport = { path = "../sallyport", default-features = false }
untrusted = { path = "../untrusted"}
libc = { version = "0.2", features = [] }
primordial = "0.1"
primordial = { git = "https://github.com/enarx/primordial" }
Loading