Linux-Sgx Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH for_v21] x86/sgx: Annotate SGX driver init functions with __init
@ 2019-07-11 17:58 Sean Christopherson
  2019-07-12  2:51 ` Jarkko Sakkinen
  0 siblings, 1 reply; 2+ messages in thread
From: Sean Christopherson @ 2019-07-11 17:58 UTC (permalink / raw)
  To: Jarkko Sakkinen; +Cc: linux-sgx

The SGX driver can no longer be built as a loadable module, ergo its
initialization functions are only called during actual init.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
---
 arch/x86/kernel/cpu/sgx/driver/driver.h | 2 +-
 arch/x86/kernel/cpu/sgx/driver/main.c   | 9 ++++-----
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/arch/x86/kernel/cpu/sgx/driver/driver.h b/arch/x86/kernel/cpu/sgx/driver/driver.h
index c71570a9cd01..8af7c38dddd0 100644
--- a/arch/x86/kernel/cpu/sgx/driver/driver.h
+++ b/arch/x86/kernel/cpu/sgx/driver/driver.h
@@ -34,6 +34,6 @@ 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);
+int __init sgx_drv_init(void);
 
 #endif /* __ARCH_X86_INTEL_SGX_H__ */
diff --git a/arch/x86/kernel/cpu/sgx/driver/main.c b/arch/x86/kernel/cpu/sgx/driver/main.c
index c7fc32e26105..da6d849d3cb4 100644
--- a/arch/x86/kernel/cpu/sgx/driver/main.c
+++ b/arch/x86/kernel/cpu/sgx/driver/main.c
@@ -198,10 +198,9 @@ static void sgx_dev_release(struct device *dev)
 {
 }
 
-static int sgx_dev_init(const char *name, struct device *dev,
-			struct cdev *cdev,
-			const struct file_operations *fops,
-			int minor)
+static __init int sgx_dev_init(const char *name, struct device *dev,
+			       struct cdev *cdev,
+			       const struct file_operations *fops, int minor)
 {
 	int ret;
 
@@ -222,7 +221,7 @@ static int sgx_dev_init(const char *name, struct device *dev,
 	return 0;
 }
 
-int sgx_drv_init(void)
+int __init sgx_drv_init(void)
 {
 	unsigned int eax, ebx, ecx, edx;
 	u64 attr_mask, xfrm_mask;
-- 
2.22.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH for_v21] x86/sgx: Annotate SGX driver init functions with __init
  2019-07-11 17:58 [PATCH for_v21] x86/sgx: Annotate SGX driver init functions with __init Sean Christopherson
@ 2019-07-12  2:51 ` Jarkko Sakkinen
  0 siblings, 0 replies; 2+ messages in thread
From: Jarkko Sakkinen @ 2019-07-12  2:51 UTC (permalink / raw)
  To: Sean Christopherson; +Cc: linux-sgx

On Thu, Jul 11, 2019 at 10:58:36AM -0700, Sean Christopherson wrote:
> The SGX driver can no longer be built as a loadable module, ergo its
> initialization functions are only called during actual init.
> 
> Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>

Sure, just something forgot to done. Thanks.

/Jarkko

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-11 17:58 [PATCH for_v21] x86/sgx: Annotate SGX driver init functions with __init Sean Christopherson
2019-07-12  2:51 ` Jarkko Sakkinen

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