diff --git a/Pal/src/host/Linux-SGX/sgx_framework.c b/Pal/src/host/Linux-SGX/sgx_framework.c index 10aa7320..fcae359b 100644 --- a/Pal/src/host/Linux-SGX/sgx_framework.c +++ b/Pal/src/host/Linux-SGX/sgx_framework.c @@ -107,7 +107,7 @@ static size_t get_ssaframesize (uint64_t xfrm) return ALLOC_ALIGNUP(xsave_size + sizeof(sgx_arch_gpr_t) + 1); } -int check_wrfsbase_support (void) +bool is_wrfsbase_supported (void) { uint32_t cpuinfo[4]; cpuid(7, 0, cpuinfo); @@ -116,10 +116,10 @@ int check_wrfsbase_support (void) SGX_DBG(DBG_E, "The WRFSBASE instruction is not permitted on this" " platform. Please make sure the \'graphene_sgx\' kernel module" " is loaded properly.\n"); - return 0; + return false; } - return 1; + return true; } int create_enclave(sgx_arch_secs_t * secs, diff --git a/Pal/src/host/Linux-SGX/sgx_internal.h b/Pal/src/host/Linux-SGX/sgx_internal.h index 1319c10b..4f391678 100644 --- a/Pal/src/host/Linux-SGX/sgx_internal.h +++ b/Pal/src/host/Linux-SGX/sgx_internal.h @@ -83,7 +83,7 @@ struct pal_enclave { }; int open_gsgx (void); -int check_wrfsbase_support (void); +bool is_wrfsbase_supported (void); int read_enclave_token (int token_file, sgx_arch_token_t * token); int read_enclave_sigstruct (int sigfile, sgx_arch_sigstruct_t * sig); diff --git a/Pal/src/host/Linux-SGX/sgx_main.c b/Pal/src/host/Linux-SGX/sgx_main.c index 53e1f23b..d3730153 100644 --- a/Pal/src/host/Linux-SGX/sgx_main.c +++ b/Pal/src/host/Linux-SGX/sgx_main.c @@ -684,10 +684,7 @@ static int load_enclave (struct pal_enclave * enclave, if (ret < 0) return ret; - ret = check_wrfsbase_support(); - if (ret < 0) - return ret; - if (!ret) + if (!is_wrfsbase_supported()) return -EPERM; INLINE_SYSCALL(gettimeofday, 2, &tv, NULL);