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: 540745ddbc70 ("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

authored by Kai Huang and committed by Borislav Petkov 4692bc77 efa16550

Changed files
+1
arch
x86
kernel
cpu
sgx
+1
arch/x86/kernel/cpu/sgx/virt.c
··· 212 212 list_splice_tail(&secs_pages, &zombie_secs_pages); 213 213 mutex_unlock(&zombie_secs_pages_lock); 214 214 215 + xa_destroy(&vepc->page_array); 215 216 kfree(vepc); 216 217 217 218 return 0;