linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/2] x86/sgx: Add the missing ifdef for sgx_set_attribute()
@ 2021-08-19 12:48 Jarkko Sakkinen
  2021-08-19 12:48 ` [PATCH v2 2/2] x86/sgx: Add SGX_MemTotal to /proc/meminfo Jarkko Sakkinen
  2021-08-19 16:07 ` [PATCH v2 1/2] x86/sgx: Add the missing ifdef for sgx_set_attribute() Sean Christopherson
  0 siblings, 2 replies; 6+ messages in thread
From: Jarkko Sakkinen @ 2021-08-19 12:48 UTC (permalink / raw)
  To: linux-sgx
  Cc: Shuah Khan, Jarkko Sakkinen, Dave Hansen, Thomas Gleixner,
	Ingo Molnar, Borislav Petkov, x86, H. Peter Anvin, Kai Huang,
	Sean Christopherson, 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>
---
 arch/x86/include/asm/sgx.h | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/x86/include/asm/sgx.h b/arch/x86/include/asm/sgx.h
index 05f3e21f01a7..38c397ef35a8 100644
--- a/arch/x86/include/asm/sgx.h
+++ b/arch/x86/include/asm/sgx.h
@@ -365,6 +365,11 @@ struct sgx_sigstruct {
  * comment!
  */
 
+#if defined(CONFIG_X86_SGX) || defined(CONFIG_X86_SGX_KVM)
+int sgx_set_attribute(unsigned long *allowed_attributes,
+		      unsigned int attribute_fd);
+#endif
+
 #ifdef CONFIG_X86_SGX_KVM
 int sgx_virt_ecreate(struct sgx_pageinfo *pageinfo, void __user *secs,
 		     int *trapnr);
@@ -372,7 +377,4 @@ 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 /* _ASM_X86_SGX_H */
-- 
2.25.1


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

end of thread, other threads:[~2021-08-25 20:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-19 12:48 [PATCH v2 1/2] x86/sgx: Add the missing ifdef for sgx_set_attribute() Jarkko Sakkinen
2021-08-19 12:48 ` [PATCH v2 2/2] x86/sgx: Add SGX_MemTotal to /proc/meminfo Jarkko Sakkinen
2021-08-19 12:52   ` Jarkko Sakkinen
2021-08-19 23:43     ` Kai Huang
2021-08-19 16:07 ` [PATCH v2 1/2] x86/sgx: Add the missing ifdef for sgx_set_attribute() Sean Christopherson
2021-08-25 20:35   ` Jarkko Sakkinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).