@@ -31,15 +31,11 @@ sgx_call_vdso:
.cfi_rel_offset %rbx, 0
push $0
.cfi_adjust_cfa_offset 8
- push 0x48(%rsp)
- .cfi_adjust_cfa_offset 8
- push 0x48(%rsp)
- .cfi_adjust_cfa_offset 8
- push 0x48(%rsp)
+ push 0x38(%rsp)
.cfi_adjust_cfa_offset 8
call *eenter(%rip)
- add $0x20, %rsp
- .cfi_adjust_cfa_offset -0x20
+ add $0x10, %rsp
+ .cfi_adjust_cfa_offset -0x10
pop %rbx
.cfi_adjust_cfa_offset -8
pop %r12
@@ -125,7 +125,7 @@ static Elf64_Sym *vdso_symtab_get(struct vdso_symtab *symtab, const char *name)
int main(int argc, char *argv[], char *envp[])
{
- struct sgx_enclave_exception exception;
+ struct sgx_enclave_run run;
struct vdso_symtab symtab;
Elf64_Sym *eenter_sym;
uint64_t result = 0;
@@ -156,7 +156,8 @@ int main(int argc, char *argv[], char *envp[])
}
}
- memset(&exception, 0, sizeof(exception));
+ memset(&run, 0, sizeof(run));
+ run.tcs = encl.encl_base;
addr = vdso_get_base_addr(envp);
if (!addr)
@@ -171,8 +172,7 @@ int main(int argc, char *argv[], char *envp[])
eenter = addr + eenter_sym->st_value;
- sgx_call_vdso((void *)&MAGIC, &result, 0, EENTER, NULL, NULL,
- (void *)encl.encl_base, &exception, NULL);
+ sgx_call_vdso((void *)&MAGIC, &result, 0, EENTER, NULL, NULL, &run);
if (result != MAGIC) {
printf("FAIL: sgx_call_vdso(), expected: 0x%lx, got: 0x%lx\n",
MAGIC, result);
@@ -181,8 +181,7 @@ int main(int argc, char *argv[], char *envp[])
/* Invoke the vDSO directly. */
result = 0;
- eenter((unsigned long)&MAGIC, (unsigned long)&result, 0, EENTER, 0, 0,
- (void *)encl.encl_base, &exception, NULL);
+ eenter((unsigned long)&MAGIC, (unsigned long)&result, 0, EENTER, 0, 0, &run);
if (result != MAGIC) {
printf("FAIL: eenter(), expected: 0x%lx, got: 0x%lx\n",
MAGIC, result);
@@ -33,6 +33,6 @@ bool encl_measure(struct encl *encl);
bool encl_build(struct encl *encl);
int sgx_call_vdso(void *rdi, void *rsi, long rdx, u32 leaf, void *r8, void *r9,
- void *tcs, struct sgx_enclave_exception *ei, void *cb);
+ struct sgx_enclave_run *run);
#endif /* MAIN_H */
Update the call to __vdso_sgx_enter_enclave() to use the sgx_enclave_run struct instead of cramming parameters into the function call itself. Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com> --- tools/testing/selftests/sgx/call.S | 10 +++------- tools/testing/selftests/sgx/main.c | 11 +++++------ tools/testing/selftests/sgx/main.h | 2 +- 3 files changed, 9 insertions(+), 14 deletions(-)