Skip to content
Merged
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
4 changes: 3 additions & 1 deletion src/attestation_types/ti.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,12 @@ impl TargetInfo {
let mut report = core::mem::MaybeUninit::<report::Report>::uninit();

asm!(
"xchg {RBX}, rbx",
"enclu",
"mov rbx, {RBX}",

RBX = inout(reg) self => _,
in("rax") EREPORT,
in("rbx") self,
in("rcx") data.0.as_ptr(),
in("rdx") report.as_mut_ptr(),
);
Expand Down
3 changes: 2 additions & 1 deletion src/enclave/enclave.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ impl Thread {
let rax: i32;
unsafe {
asm!(
"push rbx", // save rbx
"push rbp", // save rbp
"mov rbp, rsp", // save rsp
"and rsp, ~0xf", // align to 16+0
Expand All @@ -203,6 +204,7 @@ impl Thread {

"mov rsp, rbp", // restore rsp
"pop rbp", // restore rbp
"pop rbx", // restore rbx

inout("rdi") usize::from(registers.rdi) => _,
inout("rsi") usize::from(registers.rsi) => _,
Expand All @@ -212,7 +214,6 @@ impl Thread {
inout("r9") usize::from(registers.r9) => _,
inout("r10") &mut run => _,
inout("r11") self.fnc => _,
lateout("rbx") _,
lateout("r12") _,
lateout("r13") _,
lateout("r14") _,
Expand Down