All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 1/2] x86/sgx: Add the missing ifdef for sgx_set_attribute()
@ 2021-08-25 23:52 Jarkko Sakkinen
  2021-08-25 23:52 ` [PATCH v3 2/2] x86/sgx: Add SGX_MemTotal to /proc/meminfo Jarkko Sakkinen
  2021-08-26  9:58 ` [PATCH v3 1/2] x86/sgx: Add the missing ifdef for sgx_set_attribute() Borislav Petkov
  0 siblings, 2 replies; 24+ messages in thread
From: Jarkko Sakkinen @ 2021-08-25 23:52 UTC (permalink / raw)
  To: linux-sgx, Jarkko Sakkinen, Dave Hansen, Thomas Gleixner,
	Ingo Molnar, Borislav Petkov, x86, H. Peter Anvin,
	Sean Christopherson, Kai Huang
  Cc: Shuah Khan, Borislav Petkov, linux-kernel

Similarly as sgx_virt_*, decorate sgx_set_attribute() with ifdef, so that
calling it without appropraite config flags, will cause a compilation
error, and not a linking error.

Fixes: b3754e5d3da3 ("x86/sgx: Move provisioning device creation out of SGX driver")
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>

---
v3:
* Since CONFIG_X86_SGX_KVM depends on CONFIG_X86_SGX surround everything
  with CONFIG_X86_SGX config flag.
  Link: https://lore.kernel.org/linux-sgx/YR6Bs2twT4EK%2FjUK@google.com/
---
 arch/x86/include/asm/sgx.h | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/sgx.h b/arch/x86/include/asm/sgx.h
index 05f3e21f01a7..996e56590a10 100644
--- a/arch/x86/include/asm/sgx.h
+++ b/arch/x86/include/asm/sgx.h
@@ -365,6 +365,11 @@ struct sgx_sigstruct {
  * comment!
  */
 
+#ifdef CONFIG_X86_SGX
+
+int sgx_set_attribute(unsigned long *allowed_attributes,
+		      unsigned int attribute_fd);
+
 #ifdef CONFIG_X86_SGX_KVM
 int sgx_virt_ecreate(struct sgx_pageinfo *pageinfo, void __user *secs,
 		     int *trapnr);
@@ -372,7 +377,6 @@ int sgx_virt_einit(void __user *sigstruct, void __user *token,
 		   void __user *secs, u64 *lepubkeyhash, int *trapnr);
 #endif
 
-int sgx_set_attribute(unsigned long *allowed_attributes,
-		      unsigned int attribute_fd);
+#endif /* CONFIG_X86_SGX */
 
 #endif /* _ASM_X86_SGX_H */
-- 
2.25.1


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

end of thread, other threads:[~2021-09-02 22:14 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-25 23:52 [PATCH v3 1/2] x86/sgx: Add the missing ifdef for sgx_set_attribute() Jarkko Sakkinen
2021-08-25 23:52 ` [PATCH v3 2/2] x86/sgx: Add SGX_MemTotal to /proc/meminfo Jarkko Sakkinen
2021-08-26  0:39   ` Randy Dunlap
2021-08-26 16:17     ` Jarkko Sakkinen
2021-08-26 20:27       ` Dave Hansen
2021-08-26 22:27         ` Randy Dunlap
2021-09-01  1:51           ` Jarkko Sakkinen
2021-08-26  2:19   ` Kai Huang
2021-08-26 16:27     ` Jarkko Sakkinen
2021-08-27 12:03       ` Kai Huang
2021-09-01  2:02         ` Jarkko Sakkinen
2021-09-01  5:33           ` Kai Huang
2021-09-01  5:41             ` Jarkko Sakkinen
2021-09-01  5:47               ` Kai Huang
2021-09-02 12:15                 ` Jarkko Sakkinen
2021-09-02 21:56                   ` Kai Huang
2021-09-02 22:14                     ` Jarkko Sakkinen
2021-08-26  9:58 ` [PATCH v3 1/2] x86/sgx: Add the missing ifdef for sgx_set_attribute() Borislav Petkov
2021-08-26 16:08   ` Jarkko Sakkinen
2021-08-26 16:35     ` Borislav Petkov
2021-08-26 17:11       ` Jarkko Sakkinen
2021-08-26 17:24         ` Borislav Petkov
2021-08-26 17:31           ` Jarkko Sakkinen
2021-08-26 17:53             ` Borislav Petkov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.