Skip to contentSkip to conversation

x86/sgx: Return error from driver init if launch control isn't supported

PATCH New Sean Christopherson 1 participant 1 message Jul 12, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/sgx: Return error from driver init if launch control isn't supported

Return an error when the driver fails to load, otherwise the core SGX code will unnecessarily consume resources, e.g. tracking EPC and running its kthread.

---
 arch/x86/kernel/cpu/sgx/driver/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/cpu/sgx/driver/main.c +1 -1
index 2d1943c13879..f4a2ef26fcbf 100644
@@ -195,7 +195,7 @@ int sgx_drv_init(void)
 
 	if (!boot_cpu_has(X86_FEATURE_SGX_LC)) {
 		pr_info("sgx: The public key MSRs are not writable\n");
-		return 0;
+		return -ENODEV;
 	}
 
 	ret = bus_register(&sgx_bus_type);
Signature · 1 line
2.22.0