summaryrefslogtreecommitdiff
path: root/drivers/usb/cdns3/cdns3-pci-wrap.c
diff options
context:
space:
mode:
authorElena Reshetova <elena.reshetova@intel.com>2025-10-16 16:11:04 +0300
committerDave Hansen <dave.hansen@linux.intel.com>2025-10-16 14:42:08 -0700
commit483fc19e9cb1256b6521266a3c62907f5912089a (patch)
treec4ee42a04945b6fbe126f041d3bcb95f273f0444 /drivers/usb/cdns3/cdns3-pci-wrap.c
parent3a8660878839faadb4f1a6dd72c3179c1df56787 (diff)
x86/sgx: Introduce functions to count the sgx_(vepc_)open()
Currently, when SGX is compromised and the microcode update fix is applied, the machine needs to be rebooted to invalidate old SGX crypto-assets and make SGX be in an updated safe state. It's not friendly for the cloud. To avoid having to reboot, a new ENCLS[EUPDATESVN] is introduced to update SGX environment at runtime. This process needs to be done when there's no SGX users to make sure no compromised enclaves can survive from the update and allow the system to regenerate crypto-assets. For now there's no counter to track the active SGX users of host enclave and virtual EPC. Introduce such counter mechanism so that the EUPDATESVN can be done only when there's no SGX users. Define placeholder functions sgx_inc/dec_usage_count() that are used to increment and decrement such a counter. Also, wire the call sites for these functions. Encapsulate the current sgx_(vepc_)open() to __sgx_(vepc_)open() to make the new sgx_(vepc_)open() easy to read. The definition of the counter itself and the actual implementation of sgx_inc/dec_usage_count() functions come next. Note: The EUPDATESVN, which may fail, will be done in sgx_inc_usage_count(). Make it return 'int' to make subsequent patches which implement EUPDATESVN easier to review. For now it always returns success. Suggested-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Elena Reshetova <elena.reshetova@intel.com> Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com> Reviewed-by: Kai Huang <kai.huang@intel.com> Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org> Tested-by: Nataliia Bondarevska <bondarn@google.com>
Diffstat (limited to 'drivers/usb/cdns3/cdns3-pci-wrap.c')
0 files changed, 0 insertions, 0 deletions