[Pal/Linux-SGX] Clear RFLAGS before calling _DkExceptionHandler

This is follow up of https://github.com/oscarlab/graphene/pull/643
RFLAGS.DF must be cleared when calling a C function.
This commit is contained in:
Isaku Yamahata
2019-05-07 22:39:50 +02:00
committed by Michał Kowalczyk
parent 2bc2c04194
commit 5992881c46
+3
View File
@@ -230,6 +230,9 @@ enclave_entry:
andq $STACK_ALIGN, %rsi
movq %rsi, SGX_GPR_RSP(%rbx)
# clear rflags to conform the ABI which requires RFLAGS.DF = 0
movq $0, SGX_GPR_RFLAGS(%rbx)
# new RIP is the exception handler
leaq _DkExceptionHandler(%rip), %rdi
movq %rdi, SGX_GPR_RIP(%rbx)