Linux-Sgx Archive on
 help / color / Atom feed
* [PATCH for_v21] x86/sgx: Provide stub for sgx_drv_init when driver is disabled
@ 2019-07-12  4:06 Sean Christopherson
  0 siblings, 0 replies; only message in thread
From: Sean Christopherson @ 2019-07-12  4:06 UTC (permalink / raw)
  To: Jarkko Sakkinen; +Cc: linux-sgx

The core SGX code expects sgx_drv_init() to always be available, provide
a stub to handle CONFIG_INTEL_SGX_DRIVER=n.

Signed-off-by: Sean Christopherson <>
 arch/x86/kernel/cpu/sgx/driver/driver.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/x86/kernel/cpu/sgx/driver/driver.h b/arch/x86/kernel/cpu/sgx/driver/driver.h
index c71570a9cd01..211d5112623e 100644
--- a/arch/x86/kernel/cpu/sgx/driver/driver.h
+++ b/arch/x86/kernel/cpu/sgx/driver/driver.h
@@ -34,6 +34,14 @@ extern u32 sgx_xsave_size_tbl[64];
 extern const struct file_operations sgx_provision_fops;
 long sgx_ioctl(struct file *filep, unsigned int cmd, unsigned long arg);
 int sgx_drv_init(void);
+static inline int sgx_drv_init(void)
+	return -ENODEV;
 #endif /* __ARCH_X86_INTEL_SGX_H__ */

^ 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:06 [PATCH for_v21] x86/sgx: Provide stub for sgx_drv_init when driver is disabled Sean Christopherson

Linux-Sgx Archive on

Archives are clonable:
	git clone --mirror 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/ \
	public-inbox-index linux-sgx

Newsgroup available over NNTP:

AGPL code for this site: git clone public-inbox