From e91d610b3f8e45f1aabd660fa8935db4004cba8e Mon Sep 17 00:00:00 2001 From: Dmitrii Kuvaiskii Date: Tue, 30 Jun 2020 21:23:28 +0000 Subject: [PATCH] [LibOS,Pal] Print debug messages on CPUID and SYSCALL emulation --- LibOS/shim/src/bookkeep/shim_signal.c | 1 + Pal/src/host/Linux-SGX/db_exception.c | 1 + 2 files changed, 2 insertions(+) diff --git a/LibOS/shim/src/bookkeep/shim_signal.c b/LibOS/shim/src/bookkeep/shim_signal.c index 169ee752..074c1ea5 100644 --- a/LibOS/shim/src/bookkeep/shim_signal.c +++ b/LibOS/shim/src/bookkeep/shim_signal.c @@ -620,6 +620,7 @@ static void illegal_upcall (PAL_PTR event, PAL_NUM arg, PAL_CONTEXT * context) context->rcx = (long)rip + 2; context->r11 = context->efl; context->rip = (long)&syscall_wrapper; + debug("SYSCALL emulated during app execution at 0x%08lx\n", (unsigned long)rip); } else { debug("Illegal instruction during app execution at 0x%08lx; delivering to app\n", (unsigned long)rip); diff --git a/Pal/src/host/Linux-SGX/db_exception.c b/Pal/src/host/Linux-SGX/db_exception.c index d87bcf35..518727aa 100644 --- a/Pal/src/host/Linux-SGX/db_exception.c +++ b/Pal/src/host/Linux-SGX/db_exception.c @@ -135,6 +135,7 @@ static bool handle_ud(sgx_cpu_context_t* uc) { /* cpuid */ unsigned int values[4]; if (!_DkCpuIdRetrieve(uc->rax & 0xffffffff, uc->rcx & 0xffffffff, values)) { + SGX_DBG(DBG_I, "CPUID emulated during app execution at RIP 0x%016lx\n", uc->rip); uc->rip += 2; uc->rax = values[0]; uc->rbx = values[1];