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

[PAL/Linux-SGX] AEX-Notify 4/5: Do not clobber RBX reg in stage-1 signal handler #2036

Open
wants to merge 1 commit into
base: dimakuv/aex-notify-part3
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions pal/src/host/linux-sgx/enclave_entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -531,8 +531,8 @@ enclave_entry:
movq %rdi, SGX_GPR_RIP(%rbx)

# copy the whole SSA[0].XSAVE region to the CPU context's XSAVE on stack;
# __restore_xregs / __save_xregs clobber RDX so need to stash it in RBX
movq %rdx, %rbx
# __restore_xregs / __save_xregs clobber RDX so need to stash it in R10
movq %rdx, %r10
movq %gs:SGX_SSA, %rdi
leaq 1f(%rip), %r11
jmp __restore_xregs
Expand All @@ -541,7 +541,7 @@ enclave_entry:
leaq 2f(%rip), %r11
jmp __save_xregs
2:
movq %rbx, %rdx
movq %r10, %rdx

.Lcssa1_exception_eexit:
# .Lcssa0_ocall_or_cssa1_exception_eexit has an ABI that uses RSI, RDI, RSP; clear the relevant
Expand Down