Stop clearing non-volatile registers in the enclave's trampoline code, there are no secrets to preserve, and not clobbering the registers makes the enclave compatible with calling the vDSO from C. Signed-off-by: Sean Christopherson <sean.j.christopherson@xxxxxxxxx> --- tools/testing/selftests/x86/sgx/encl_bootstrap.S | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tools/testing/selftests/x86/sgx/encl_bootstrap.S b/tools/testing/selftests/x86/sgx/encl_bootstrap.S index 3a1479f1cdcf..173e76fa6da6 100644 --- a/tools/testing/selftests/x86/sgx/encl_bootstrap.S +++ b/tools/testing/selftests/x86/sgx/encl_bootstrap.S @@ -40,7 +40,7 @@ encl_entry: pop %rbx # pop the enclave base address - # Clear GPRs. + /* Clear volatile GPRs, except RAX (EEXIT leaf). */ xor %rcx, %rcx xor %rdx, %rdx xor %rdi, %rdi @@ -49,10 +49,6 @@ encl_entry: xor %r9, %r9 xor %r10, %r10 xor %r11, %r11 - xor %r12, %r12 - xor %r13, %r13 - xor %r14, %r14 - xor %r15, %r15 # Reset status flags. add %rdx, %rdx # OF = SF = AF = CF = 0; ZF = PF = 1 -- 2.24.1