From 34f5d5923f3dff832fbc62a61a062643d78e4c03 Mon Sep 17 00:00:00 2001 From: Raoul Strackx Date: Fri, 25 Oct 2019 15:44:07 +0200 Subject: [PATCH] cleaning up code --- src/libstd/sys/sgx/abi/entry.S | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/libstd/sys/sgx/abi/entry.S b/src/libstd/sys/sgx/abi/entry.S index 08aee89fe03de..f5d9c4338deb5 100644 --- a/src/libstd/sys/sgx/abi/entry.S +++ b/src/libstd/sys/sgx/abi/entry.S @@ -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)