Skip to contentSkip to conversation

x86/sgx: Provide stub for sgx_drv_init when driver is disabled

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: Provide stub for sgx_drv_init when driver is disabled

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

---
 arch/x86/kernel/cpu/sgx/driver/driver.h | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/x86/kernel/cpu/sgx/driver/driver.h +8 -0
index c71570a9cd01..211d5112623e 100644
@@ -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);
+
+#ifdef CONFIG_INTEL_SGX_DRIVER
 int sgx_drv_init(void);
+#else
+static inline int sgx_drv_init(void)
+{
+	return -ENODEV;
+}
+#endif
 
 #endif /* __ARCH_X86_INTEL_SGX_H__ */
Signature · 1 line
2.22.0