]> git.baikalelectronics.ru Git - kernel.git/commit
x86/sgx: Add missing xa_destroy() when virtual EPC is destroyed
authorKai Huang <kai.huang@intel.com>
Tue, 15 Jun 2021 10:16:39 +0000 (22:16 +1200)
committerBorislav Petkov <bp@suse.de>
Tue, 15 Jun 2021 16:03:45 +0000 (18:03 +0200)
commit4632de2e9d68828b0e8e7813aaafd89ef065121e
tree64da667e5326aa89e5a8b382cdcd484cc9ce8d4e
parenteee9e5a439742e17a36dd08a320aed678b8a34ad
x86/sgx: Add missing xa_destroy() when virtual EPC is destroyed

xa_destroy() needs to be called to destroy a virtual EPC's page array
before calling kfree() to free the virtual EPC. Currently it is not
called so add the missing xa_destroy().

Fixes: 3cd57cfc231a ("x86/sgx: Introduce virtual EPC for use by KVM guests")
Signed-off-by: Kai Huang <kai.huang@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: Dave Hansen <dave.hansen@intel.com>
Tested-by: Yang Zhong <yang.zhong@intel.com>
Link: https://lkml.kernel.org/r/20210615101639.291929-1-kai.huang@intel.com
arch/x86/kernel/cpu/sgx/virt.c