]> git.baikalelectronics.ru Git - kernel.git/commit
x86/sgx: Initialize virtual EPC driver even when SGX driver is disabled
authorKai Huang <kai.huang@intel.com>
Fri, 19 Mar 2021 07:23:02 +0000 (20:23 +1300)
committerBorislav Petkov <bp@suse.de>
Tue, 6 Apr 2021 07:43:41 +0000 (09:43 +0200)
commit2684ef15e194d82d2c6973faf42ab3260fda68d3
tree807ce54240c2d5124ab7c71406ea2d12df679897
parent0e9748961549849a1ac24473ddb9aa5e83ade7ef
x86/sgx: Initialize virtual EPC driver even when SGX driver is disabled

Modify sgx_init() to always try to initialize the virtual EPC driver,
even if the SGX driver is disabled.  The SGX driver might be disabled
if SGX Launch Control is in locked mode, or not supported in the
hardware at all.  This allows (non-Linux) guests that support non-LC
configurations to use SGX.

 [ bp: De-silli-fy the test. ]

Signed-off-by: Kai Huang <kai.huang@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Sean Christopherson <seanjc@google.com>
Acked-by: Jarkko Sakkinen <jarkko@kernel.org>
Acked-by: Dave Hansen <dave.hansen@intel.com>
Link: https://lkml.kernel.org/r/d35d17a02bbf8feef83a536cec8b43746d4ea557.1616136308.git.kai.huang@intel.com
arch/x86/kernel/cpu/sgx/main.c