mirror of
https://github.com/clearlinux/graphene.git
synced 2026-10-03 15:39:36 +00:00
[SGX PAL] Change check_wrfsbase_support() to is_wrfsbase_supported().
Signed-off-by: Chia-Che Tsai <chiache@tamu.edu>
This commit is contained in:
committed by
Don Porter
parent
f54440eb1a
commit
f3f05adc2d
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user