Przeglądaj źródła

[Pal/Linux-SGX] Improve comments below enclave_entry

The comment about the register content is only true for EENTER. Also
usually* this code is reached only by EENTER. ERESUME restores the saved
state from the SSA.

*: It is reached if an async exit happens just after EENTER.

Also remove redundant comments directly below.
Simon Gaiser 6 lat temu
rodzic
commit
fcc1c3ee58
1 zmienionych plików z 3 dodań i 6 usunięć
  1. 3 6
      Pal/src/host/Linux-SGX/enclave_entry.S

+ 3 - 6
Pal/src/host/Linux-SGX/enclave_entry.S

@@ -14,19 +14,16 @@
 	.type enclave_entry, @function
 
 enclave_entry:
-	# On EENTER/ERESUME, RAX is the current SSA, RBX is the address of TCS,
-	# RCX is the address of AEP. Other registers are not trusted.
+	# On EENTER, RAX is the current SSA index (aka CSSA),
+	# RBX is the address of TCS, RCX is the address of AEP.
+	# Other registers are not trusted.
 
 	# x86-64 sysv abi requires %rFLAGS.DF = 0 on entry to function call.
 	cld
 
-	# current SSA is in RAX (Trusted)
 	cmpq $0, %rax
 	jne .Lhandle_resume
 
-	# TCS is in RBX (Trusted)
-
-	# AEP address in RCX (Trusted)
 	movq %rcx, %gs:SGX_AEP
 
 	# The following code is hardened to defend attacks from untrusted host.