All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nick Desaulniers <ndesaulniers@google.com>
To: Nathan Chancellor <nathan@kernel.org>
Cc: Andy Lutomirski <luto@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,  Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org,  linux-kernel@vger.kernel.org,
	llvm@lists.linux.dev, patches@lists.linux.dev,
	 Sean Christopherson <seanjc@google.com>
Subject: Re: [PATCH] x86/vdso: Conditionally export __vdso_sgx_enter_enclave
Date: Thu, 10 Nov 2022 12:46:16 -0800	[thread overview]
Message-ID: <CAKwvOdkxLXLna0cfkA8ay54vU0NwMj2AFR8CZg3pgpvqOKeXjw@mail.gmail.com> (raw)
In-Reply-To: <20221109000306.1407357-1-nathan@kernel.org>

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

  reply	other threads:[~2022-11-10 20:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-09  0:03 [PATCH] x86/vdso: Conditionally export __vdso_sgx_enter_enclave Nathan Chancellor
2022-11-10 20:46 ` Nick Desaulniers [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKwvOdkxLXLna0cfkA8ay54vU0NwMj2AFR8CZg3pgpvqOKeXjw@mail.gmail.com \
    --to=ndesaulniers@google.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=nathan@kernel.org \
    --cc=patches@lists.linux.dev \
    --cc=seanjc@google.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.