Skip to content

Commit

Permalink
cleaning up code
Browse files Browse the repository at this point in the history
  • Loading branch information
raoulstrackx committed Oct 25, 2019
1 parent d257c20 commit 34f5d59
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/libstd/sys/sgx/abi/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -119,16 +119,11 @@ sgx_entry:
mov %rbx,%gs:tcsls_tcs_addr
stmxcsr %gs:tcsls_user_mxcsr
fnstcw %gs:tcsls_user_fcw
/* reset user state */
cld /* x86-64 ABI requires DF to be unset at function entry/exit */

/* making sure AC flag is not set in rflags */
/* avoid using the 'clac' instruction to be compatible with older compilers */
pushfq
popq %rcx
and $0xFFFFFFFFFFFBFFFF, %rcx
push %rcx
popfq
/* reset user state */
/* - DF flag: x86-64 ABI requires DF to be unset at function entry/exit */
/* - AC flag: AEX on misaligned memory accesses leaks side channel info */
andq $~0x40400, (%rsp)

/* check for debug buffer pointer */
testb $0xff,DEBUG(%rip)
Expand Down

0 comments on commit 34f5d59

Please sign in to comment.