Random small fixes which missed the initial SGX submission. Also, some
procedural clarifications. -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEzv7L6UO9uDPlPSfHEsHwGGHeVUoFAmAqTGwACgkQEsHwGGHe VUo34g//Ts1m1Ef0w485cN1y+ITmEdKnhJYXfbE9SP/XHRib9eU3o0JqBerNqJ0k wYW4h0sZSkgwadKzZVuwTeAT/I9+LHy2FQwB9Xewuv3V7Wb0AWCjr9AOAsost5wO P2SKskKUZVbOrIxAeHMVEW8qpSHVPTRk1AiPqK8meyTZDxOee1GhmE6zADEsPnuQ AAPGBPob2cFQrngvk2pWTc8AXcHgQWgjI0gH6YEgfLiQ7kJcedBFpHKhwsiEm2kR PNvWIK8zEv3D5LMDNiUWYIQ0jX0sQufOF9H8aEtWX0YkwvMZkmRjUWYo7l5RdzQS lVK/E2epV+qPYCHeq6GBYmpglXwWEkG0ruaKtV24EuryfXYFprqwtqjVqLLZvvbU TYnyVvQNoXNH3j8gKQYHjMuKKbvOVrObK6L4BgqmAc5dnDg4691Kqv83Vw82oPaI Lks8h7EYLgjmWWaDUxKtxlFH+ggIcLc70NcoVkCGcjOuPvdWapQZZHe6kI0DWjfc VyLZ+8EP2Bi07MC7/IEs4cCnJvEDkWhfmOvzzJFIc7LhxlwfD7PwbKQ/nsOXekez VsljXyPWoTkASiS54FLAhtnjmGWceeaAY/bN5mNQ//JR5LuKT3eTk8h2b9Jh8Svy 6HmLs07GYywCtJcePJSM5NrB0WiKKGCsHWlOuKetY6b+D0+c6kw= =TR60 -----END PGP SIGNATURE----- Merge tag 'x86_sgx_for_v5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 SGX fixes from Borislav Petkov: "Random small fixes which missed the initial SGX submission. Also, some procedural clarifications" * tag 'x86_sgx_for_v5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: MAINTAINERS: Add Dave Hansen as reviewer for INTEL SGX x86/sgx: Drop racy follow_pfn() check MAINTAINERS: Fix the tree location for INTEL SGX patches x86/sgx: Fix the return type of sgx_init()
This commit is contained in:
Коммит
4bf0b820d1
|
@ -9183,10 +9183,11 @@ F: include/linux/tboot.h
|
|||
|
||||
INTEL SGX
|
||||
M: Jarkko Sakkinen <jarkko@kernel.org>
|
||||
R: Dave Hansen <dave.hansen@linux.intel.com>
|
||||
L: linux-sgx@vger.kernel.org
|
||||
S: Supported
|
||||
Q: https://patchwork.kernel.org/project/intel-sgx/list/
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-sgx.git
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/sgx
|
||||
F: Documentation/x86/sgx.rst
|
||||
F: arch/x86/entry/vdso/vsgx.S
|
||||
F: arch/x86/include/uapi/asm/sgx.h
|
||||
|
|
|
@ -141,7 +141,6 @@ static vm_fault_t sgx_vma_fault(struct vm_fault *vmf)
|
|||
struct sgx_encl_page *entry;
|
||||
unsigned long phys_addr;
|
||||
struct sgx_encl *encl;
|
||||
unsigned long pfn;
|
||||
vm_fault_t ret;
|
||||
|
||||
encl = vma->vm_private_data;
|
||||
|
@ -168,13 +167,6 @@ static vm_fault_t sgx_vma_fault(struct vm_fault *vmf)
|
|||
|
||||
phys_addr = sgx_get_epc_phys_addr(entry->epc_page);
|
||||
|
||||
/* Check if another thread got here first to insert the PTE. */
|
||||
if (!follow_pfn(vma, addr, &pfn)) {
|
||||
mutex_unlock(&encl->lock);
|
||||
|
||||
return VM_FAULT_NOPAGE;
|
||||
}
|
||||
|
||||
ret = vmf_insert_pfn(vma, addr, PFN_DOWN(phys_addr));
|
||||
if (ret != VM_FAULT_NOPAGE) {
|
||||
mutex_unlock(&encl->lock);
|
||||
|
|
|
@ -700,25 +700,27 @@ static bool __init sgx_page_cache_init(void)
|
|||
return true;
|
||||
}
|
||||
|
||||
static void __init sgx_init(void)
|
||||
static int __init sgx_init(void)
|
||||
{
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
if (!cpu_feature_enabled(X86_FEATURE_SGX))
|
||||
return;
|
||||
return -ENODEV;
|
||||
|
||||
if (!sgx_page_cache_init())
|
||||
return;
|
||||
return -ENOMEM;
|
||||
|
||||
if (!sgx_page_reclaimer_init())
|
||||
if (!sgx_page_reclaimer_init()) {
|
||||
ret = -ENOMEM;
|
||||
goto err_page_cache;
|
||||
}
|
||||
|
||||
ret = sgx_drv_init();
|
||||
if (ret)
|
||||
goto err_kthread;
|
||||
|
||||
return;
|
||||
return 0;
|
||||
|
||||
err_kthread:
|
||||
kthread_stop(ksgxd_tsk);
|
||||
|
@ -728,6 +730,8 @@ err_page_cache:
|
|||
vfree(sgx_epc_sections[i].pages);
|
||||
memunmap(sgx_epc_sections[i].virt_addr);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
device_initcall(sgx_init);
|
||||
|
|
Загрузка…
Ссылка в новой задаче