diff options
author | Sean Christopherson <sean.j.christopherson@intel.com> | 2021-03-19 20:23:06 +1300 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2021-04-06 09:43:42 +0200 |
commit | a67136b458e5e63822b19c35794451122fe2bf3e (patch) | |
tree | a8c6cd83a88169cb238fd46bd2aa9ca5505c4b19 /arch/x86/kernel/cpu/sgx/ioctl.c | |
parent | 32ddda8e445df3de477db14d386fb3518042224a (diff) | |
download | linux-stable-a67136b458e5e63822b19c35794451122fe2bf3e.tar.gz linux-stable-a67136b458e5e63822b19c35794451122fe2bf3e.tar.bz2 linux-stable-a67136b458e5e63822b19c35794451122fe2bf3e.zip |
x86/sgx: Add encls_faulted() helper
Add a helper to extract the fault indicator from an encoded ENCLS return
value. SGX virtualization will also need to detect ENCLS faults.
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Kai Huang <kai.huang@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: Jarkko Sakkinen <jarkko@kernel.org>
Acked-by: Dave Hansen <dave.hansen@intel.com>
Link: https://lkml.kernel.org/r/c1f955898110de2f669da536fc6cf62e003dff88.1616136308.git.kai.huang@intel.com
Diffstat (limited to 'arch/x86/kernel/cpu/sgx/ioctl.c')
-rw-r--r-- | arch/x86/kernel/cpu/sgx/ioctl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kernel/cpu/sgx/ioctl.c b/arch/x86/kernel/cpu/sgx/ioctl.c index 354e309fcdb7..11e3f9635c24 100644 --- a/arch/x86/kernel/cpu/sgx/ioctl.c +++ b/arch/x86/kernel/cpu/sgx/ioctl.c @@ -568,7 +568,7 @@ static int sgx_encl_init(struct sgx_encl *encl, struct sgx_sigstruct *sigstruct, } } - if (ret & ENCLS_FAULT_FLAG) { + if (encls_faulted(ret)) { if (encls_failed(ret)) ENCLS_WARN(ret, "EINIT"); |