Skip to content

Commit 34f5d59

Browse files
committed
cleaning up code
1 parent d257c20 commit 34f5d59

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/libstd/sys/sgx/abi/entry.S

+4-9
Original file line numberDiff line numberDiff line change
@@ -119,16 +119,11 @@ sgx_entry:
119119
mov %rbx,%gs:tcsls_tcs_addr
120120
stmxcsr %gs:tcsls_user_mxcsr
121121
fnstcw %gs:tcsls_user_fcw
122-
/* reset user state */
123-
cld /* x86-64 ABI requires DF to be unset at function entry/exit */
124122

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

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

0 commit comments

Comments
 (0)