Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shim sev/sgx: remove the indirection of the inital function rust call #787

Merged
merged 1 commit into from Aug 5, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 1 addition & 7 deletions enarx-keep-sev-shim/src/start.S
Expand Up @@ -104,7 +104,7 @@ _trampoline:

# jump to _start_main
xor %rbp,%rbp
jmp *_start_main_l(%rip)
jmp _start_main

.L100: # some paranoid code preventing speculative execution
hlt
Expand All @@ -115,12 +115,6 @@ _trampoline:
_initial_shim_stack:
.space SIZE_OF_INITIAL_STACK

.section .data
.align 8
_start_main_l:
.quad _start_main
.global _start_main

#
# # Page Tables:
#
Expand Down
10 changes: 2 additions & 8 deletions enarx-keep-sgx-shim/src/start.S
Expand Up @@ -138,7 +138,7 @@ _start:

xor %rax, %rax # Clear %rax

call *_entry_l(%rip) # Jump to Rust
call entry # Jump to Rust

# CSSA != 0
.Levent:
Expand Down Expand Up @@ -214,7 +214,7 @@ _start:
syscall:
savep # Save preserved registers
mov %rsp, SRSP(%rdi) # Save restoration stack pointer

zerox # Clear xCPU state
xor %rcx, %rcx # Clear %rcx
zerof %rcx # Clear CPU flags
Expand All @@ -238,9 +238,3 @@ exit:
jump:
mov %rdi, %rsp
jmp *%rsi

.data
.global entry
.align 8
_entry_l:
.quad entry