Linux-Sgx Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH for_v21] x86/sgx: Return error from driver init if launch control isn't supported
@ 2019-07-12  4:12 Sean Christopherson
  0 siblings, 0 replies; only message in thread
From: Sean Christopherson @ 2019-07-12  4:12 UTC (permalink / raw)
  To: Jarkko Sakkinen; +Cc: linux-sgx

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.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
---
 arch/x86/kernel/cpu/sgx/driver/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/sgx/driver/main.c b/arch/x86/kernel/cpu/sgx/driver/main.c
index 2d1943c13879..f4a2ef26fcbf 100644
--- a/arch/x86/kernel/cpu/sgx/driver/main.c
+++ b/arch/x86/kernel/cpu/sgx/driver/main.c
@@ -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);
-- 
2.22.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-12  4:12 [PATCH for_v21] x86/sgx: Return error from driver init if launch control isn't supported Sean Christopherson

Linux-Sgx Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-sgx/0 linux-sgx/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-sgx linux-sgx/ https://lore.kernel.org/linux-sgx \
		linux-sgx@vger.kernel.org linux-sgx@archiver.kernel.org
	public-inbox-index linux-sgx


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-sgx


AGPL code for this site: git clone https://public-inbox.org/ public-inbox