All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/vdso: Conditionally export __vdso_sgx_enter_enclave
@ 2022-11-09  0:03 Nathan Chancellor
  2022-11-10 20:46 ` Nick Desaulniers
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Nathan Chancellor @ 2022-11-09  0:03 UTC (permalink / raw)
  To: Andy Lutomirski, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, x86
  Cc: linux-kernel, llvm, patches, Nathan Chancellor

Recently, ld.lld moved from '--undefined-version' to
'--no-undefined-version' as the default, which breaks building the vDSO
when CONFIG_X86_SGX is not set:

  ld.lld: error: version script assignment of 'LINUX_2.6' to symbol '__vdso_sgx_enter_enclave' failed: symbol not defined

__vdso_sgx_enter_enclave is only included in the vDSO when
CONFIG_X86_SGX is set. Only export it if it will be present in the final
object, which clears up the error.

Link: https://github.com/ClangBuiltLinux/linux/issues/1756
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---

It would be nice if this could be picked up for an -rc release but I
won't argue otherwise.

Alternatively, we could add '--undefined-version' to the vDSO ldflags
but this does not seem unreasonable to me.

 arch/x86/entry/vdso/vdso.lds.S | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/entry/vdso/vdso.lds.S b/arch/x86/entry/vdso/vdso.lds.S
index 4bf48462fca7..e8c60ae7a7c8 100644
--- a/arch/x86/entry/vdso/vdso.lds.S
+++ b/arch/x86/entry/vdso/vdso.lds.S
@@ -27,7 +27,9 @@ VERSION {
 		__vdso_time;
 		clock_getres;
 		__vdso_clock_getres;
+#ifdef CONFIG_X86_SGX
 		__vdso_sgx_enter_enclave;
+#endif
 	local: *;
 	};
 }

base-commit: f0c4d9fc9cc9462659728d168387191387e903cc
-- 
2.38.1


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

* Re: [PATCH] x86/vdso: Conditionally export __vdso_sgx_enter_enclave
  2022-11-09  0:03 [PATCH] x86/vdso: Conditionally export __vdso_sgx_enter_enclave Nathan Chancellor
@ 2022-11-10 20:46 ` Nick Desaulniers
  2022-12-09 13:46 ` Nathan Chancellor
  2022-12-09 14:02 ` [tip: x86/urgent] x86/vdso: Conditionally export __vdso_sgx_enter_enclave() tip-bot2 for Nathan Chancellor
  2 siblings, 0 replies; 6+ messages in thread
From: Nick Desaulniers @ 2022-11-10 20:46 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Andy Lutomirski, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, x86, linux-kernel, llvm, patches,
	Sean Christopherson

On Tue, Nov 8, 2022 at 4:04 PM Nathan Chancellor <nathan@kernel.org> wrote:
>
> Recently, ld.lld moved from '--undefined-version' to
> '--no-undefined-version' as the default, which breaks building the vDSO
> when CONFIG_X86_SGX is not set:
>
>   ld.lld: error: version script assignment of 'LINUX_2.6' to symbol '__vdso_sgx_enter_enclave' failed: symbol not defined
>
> __vdso_sgx_enter_enclave is only included in the vDSO when
> CONFIG_X86_SGX is set. Only export it if it will be present in the final
> object, which clears up the error.
>
> Link: https://github.com/ClangBuiltLinux/linux/issues/1756
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
>
> It would be nice if this could be picked up for an -rc release but I
> won't argue otherwise.

Sounds like the lld change got reverted, so this is less urgent now,
but the change still LGTM regardless. Thanks for the patch!

Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Fixes: 8466436952017 ("x86/vdso: Implement a vDSO for Intel SGX enclave call")


>
> Alternatively, we could add '--undefined-version' to the vDSO ldflags
> but this does not seem unreasonable to me.
>
>  arch/x86/entry/vdso/vdso.lds.S | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/arch/x86/entry/vdso/vdso.lds.S b/arch/x86/entry/vdso/vdso.lds.S
> index 4bf48462fca7..e8c60ae7a7c8 100644
> --- a/arch/x86/entry/vdso/vdso.lds.S
> +++ b/arch/x86/entry/vdso/vdso.lds.S
> @@ -27,7 +27,9 @@ VERSION {
>                 __vdso_time;
>                 clock_getres;
>                 __vdso_clock_getres;
> +#ifdef CONFIG_X86_SGX
>                 __vdso_sgx_enter_enclave;
> +#endif
>         local: *;
>         };
>  }
>
> base-commit: f0c4d9fc9cc9462659728d168387191387e903cc
> --
> 2.38.1
>
>


-- 
Thanks,
~Nick Desaulniers

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

* Re: [PATCH] x86/vdso: Conditionally export __vdso_sgx_enter_enclave
  2022-11-09  0:03 [PATCH] x86/vdso: Conditionally export __vdso_sgx_enter_enclave Nathan Chancellor
  2022-11-10 20:46 ` Nick Desaulniers
@ 2022-12-09 13:46 ` Nathan Chancellor
  2022-12-09 13:54   ` Thomas Gleixner
  2022-12-09 14:02 ` [tip: x86/urgent] x86/vdso: Conditionally export __vdso_sgx_enter_enclave() tip-bot2 for Nathan Chancellor
  2 siblings, 1 reply; 6+ messages in thread
From: Nathan Chancellor @ 2022-12-09 13:46 UTC (permalink / raw)
  To: Andy Lutomirski, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, x86
  Cc: linux-kernel, llvm, patches

Ping? The default switch was remerged a couple of days ago so builds
with tip of tree LLVM are going to be broken again:

https://github.com/llvm/llvm-project/commit/241dbd310599e3c1a0f1b0c9ced14c8b8760539e

Cheers,
Nathan

On Tue, Nov 08, 2022 at 05:03:07PM -0700, Nathan Chancellor wrote:
> Recently, ld.lld moved from '--undefined-version' to
> '--no-undefined-version' as the default, which breaks building the vDSO
> when CONFIG_X86_SGX is not set:
> 
>   ld.lld: error: version script assignment of 'LINUX_2.6' to symbol '__vdso_sgx_enter_enclave' failed: symbol not defined
> 
> __vdso_sgx_enter_enclave is only included in the vDSO when
> CONFIG_X86_SGX is set. Only export it if it will be present in the final
> object, which clears up the error.
> 
> Link: https://github.com/ClangBuiltLinux/linux/issues/1756
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
> 
> It would be nice if this could be picked up for an -rc release but I
> won't argue otherwise.
> 
> Alternatively, we could add '--undefined-version' to the vDSO ldflags
> but this does not seem unreasonable to me.
> 
>  arch/x86/entry/vdso/vdso.lds.S | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/x86/entry/vdso/vdso.lds.S b/arch/x86/entry/vdso/vdso.lds.S
> index 4bf48462fca7..e8c60ae7a7c8 100644
> --- a/arch/x86/entry/vdso/vdso.lds.S
> +++ b/arch/x86/entry/vdso/vdso.lds.S
> @@ -27,7 +27,9 @@ VERSION {
>  		__vdso_time;
>  		clock_getres;
>  		__vdso_clock_getres;
> +#ifdef CONFIG_X86_SGX
>  		__vdso_sgx_enter_enclave;
> +#endif
>  	local: *;
>  	};
>  }
> 
> base-commit: f0c4d9fc9cc9462659728d168387191387e903cc
> -- 
> 2.38.1
> 
> 

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

* Re: [PATCH] x86/vdso: Conditionally export __vdso_sgx_enter_enclave
  2022-12-09 13:46 ` Nathan Chancellor
@ 2022-12-09 13:54   ` Thomas Gleixner
  2022-12-09 15:55     ` Nathan Chancellor
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Gleixner @ 2022-12-09 13:54 UTC (permalink / raw)
  To: Nathan Chancellor, Andy Lutomirski, Ingo Molnar, Borislav Petkov,
	Dave Hansen, x86
  Cc: linux-kernel, llvm, patches

On Fri, Dec 09 2022 at 06:46, Nathan Chancellor wrote:
> Ping? The default switch was remerged a couple of days ago so builds
> with tip of tree LLVM are going to be broken again:
>
> https://github.com/llvm/llvm-project/commit/241dbd310599e3c1a0f1b0c9ced14c8b8760539e

Sorry. That fell through the cracks. I'll take care of it.


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

* [tip: x86/urgent] x86/vdso: Conditionally export __vdso_sgx_enter_enclave()
  2022-11-09  0:03 [PATCH] x86/vdso: Conditionally export __vdso_sgx_enter_enclave Nathan Chancellor
  2022-11-10 20:46 ` Nick Desaulniers
  2022-12-09 13:46 ` Nathan Chancellor
@ 2022-12-09 14:02 ` tip-bot2 for Nathan Chancellor
  2 siblings, 0 replies; 6+ messages in thread
From: tip-bot2 for Nathan Chancellor @ 2022-12-09 14:02 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Nathan Chancellor, Thomas Gleixner, Nick Desaulniers, x86, linux-kernel

The following commit has been merged into the x86/urgent branch of tip:

Commit-ID:     45be2ad007a9c6bea70249c4cf3e4905afe4caeb
Gitweb:        https://git.kernel.org/tip/45be2ad007a9c6bea70249c4cf3e4905afe4caeb
Author:        Nathan Chancellor <nathan@kernel.org>
AuthorDate:    Tue, 08 Nov 2022 17:03:07 -07:00
Committer:     Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Fri, 09 Dec 2022 14:58:02 +01:00

x86/vdso: Conditionally export __vdso_sgx_enter_enclave()

Recently, ld.lld moved from '--undefined-version' to
'--no-undefined-version' as the default, which breaks building the vDSO
when CONFIG_X86_SGX is not set:

  ld.lld: error: version script assignment of 'LINUX_2.6' to symbol '__vdso_sgx_enter_enclave' failed: symbol not defined

__vdso_sgx_enter_enclave is only included in the vDSO when
CONFIG_X86_SGX is set. Only export it if it will be present in the final
object, which clears up the error.

Fixes: 8466436952017 ("x86/vdso: Implement a vDSO for Intel SGX enclave call")                                                                                                                                                               
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Link: https://github.com/ClangBuiltLinux/linux/issues/1756
Link: https://lore.kernel.org/r/20221109000306.1407357-1-nathan@kernel.org
---
 arch/x86/entry/vdso/vdso.lds.S | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/entry/vdso/vdso.lds.S b/arch/x86/entry/vdso/vdso.lds.S
index 4bf4846..e8c60ae 100644
--- a/arch/x86/entry/vdso/vdso.lds.S
+++ b/arch/x86/entry/vdso/vdso.lds.S
@@ -27,7 +27,9 @@ VERSION {
 		__vdso_time;
 		clock_getres;
 		__vdso_clock_getres;
+#ifdef CONFIG_X86_SGX
 		__vdso_sgx_enter_enclave;
+#endif
 	local: *;
 	};
 }

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

* Re: [PATCH] x86/vdso: Conditionally export __vdso_sgx_enter_enclave
  2022-12-09 13:54   ` Thomas Gleixner
@ 2022-12-09 15:55     ` Nathan Chancellor
  0 siblings, 0 replies; 6+ messages in thread
From: Nathan Chancellor @ 2022-12-09 15:55 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Andy Lutomirski, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
	linux-kernel, llvm, patches

On Fri, Dec 09, 2022 at 02:54:52PM +0100, Thomas Gleixner wrote:
> On Fri, Dec 09 2022 at 06:46, Nathan Chancellor wrote:
> > Ping? The default switch was remerged a couple of days ago so builds
> > with tip of tree LLVM are going to be broken again:
> >
> > https://github.com/llvm/llvm-project/commit/241dbd310599e3c1a0f1b0c9ced14c8b8760539e
> 
> Sorry. That fell through the cracks. I'll take care of it.

Thanks Thomas! I get you all are always busy so I appreciate the quick
response.

Cheers,
Nathan

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

end of thread, other threads:[~2022-12-09 15:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-09  0:03 [PATCH] x86/vdso: Conditionally export __vdso_sgx_enter_enclave Nathan Chancellor
2022-11-10 20:46 ` Nick Desaulniers
2022-12-09 13:46 ` Nathan Chancellor
2022-12-09 13:54   ` Thomas Gleixner
2022-12-09 15:55     ` Nathan Chancellor
2022-12-09 14:02 ` [tip: x86/urgent] x86/vdso: Conditionally export __vdso_sgx_enter_enclave() tip-bot2 for Nathan Chancellor

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.