All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sedat Dilek <sedat.dilek@gmail.com>
To: Nathan Chancellor <natechancellor@gmail.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
	Clang-Built-Linux ML <clang-built-linux@googlegroups.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH] powerpc: Handle .text.{hot,unlikely}.* in linker script
Date: Mon, 4 Jan 2021 21:55:20 +0100	[thread overview]
Message-ID: <CA+icZUVe4AJoLWMqS3MEx700jcwDaJhw78tUgg8iD0dJvEmmYg@mail.gmail.com> (raw)
In-Reply-To: <20210104204850.990966-1-natechancellor@gmail.com>

On Mon, Jan 4, 2021 at 9:49 PM Nathan Chancellor
<natechancellor@gmail.com> wrote:
>
> Commit eff8728fe698 ("vmlinux.lds.h: Add PGO and AutoFDO input
> sections") added ".text.unlikely.*" and ".text.hot.*" due to an LLVM
> change [1].
>
> After another LLVM change [2], these sections are seen in some PowerPC
> builds, where there is a orphan section warning then build failure:
>

Looks like you forgot to add your references/links to [1] and [2].

Might be good to mention...?

With CONFIG_LD_ORPHAN_WARN=y is enabled

- Sedat

> $ make -skj"$(nproc)" \
>        ARCH=powerpc CROSS_COMPILE=powerpc64le-linux-gnu- LLVM=1 O=out \
>        distclean powernv_defconfig zImage.epapr
> ld.lld: warning: kernel/built-in.a(panic.o):(.text.unlikely.) is being placed in '.text.unlikely.'
> ...
> ld.lld: warning: address (0xc000000000009314) of section .text is not a multiple of alignment (256)
> ...
> ERROR: start_text address is c000000000009400, should be c000000000008000
> ERROR: try to enable LD_HEAD_STUB_CATCH config option
> ERROR: see comments in arch/powerpc/tools/head_check.sh
> ...
>
> Explicitly handle these sections like in the main linker script so
> there is no more build failure.
>
> Cc: stable@vger.kernel.org
> Fixes: 83a092cf95f2 ("powerpc: Link warning for orphan sections")
> Link: https://github.com/ClangBuiltLinux/linux/issues/1218
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
> ---
>  arch/powerpc/kernel/vmlinux.lds.S | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
> index 0318ba436f34..8e0b1298bf19 100644
> --- a/arch/powerpc/kernel/vmlinux.lds.S
> +++ b/arch/powerpc/kernel/vmlinux.lds.S
> @@ -85,7 +85,7 @@ SECTIONS
>                 ALIGN_FUNCTION();
>  #endif
>                 /* careful! __ftr_alt_* sections need to be close to .text */
> -               *(.text.hot TEXT_MAIN .text.fixup .text.unlikely .fixup __ftr_alt_* .ref.text);
> +               *(.text.hot .text.hot.* TEXT_MAIN .text.fixup .text.unlikely .text.unlikely.* .fixup __ftr_alt_* .ref.text);
>  #ifdef CONFIG_PPC64
>                 *(.tramp.ftrace.text);
>  #endif
>
> base-commit: d8a4f20584d5906093a8fc6aa06622102a501095
> --
> 2.30.0
>
> --
> You received this message because you are subscribed to the Google Groups "Clang Built Linux" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-linux+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/20210104204850.990966-1-natechancellor%40gmail.com.

WARNING: multiple messages have this Message-ID (diff)
From: Sedat Dilek <sedat.dilek@gmail.com>
To: Nathan Chancellor <natechancellor@gmail.com>
Cc: Nick Desaulniers <ndesaulniers@google.com>,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	Clang-Built-Linux ML <clang-built-linux@googlegroups.com>,
	Paul Mackerras <paulus@samba.org>,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] powerpc: Handle .text.{hot,unlikely}.* in linker script
Date: Mon, 4 Jan 2021 21:55:20 +0100	[thread overview]
Message-ID: <CA+icZUVe4AJoLWMqS3MEx700jcwDaJhw78tUgg8iD0dJvEmmYg@mail.gmail.com> (raw)
In-Reply-To: <20210104204850.990966-1-natechancellor@gmail.com>

On Mon, Jan 4, 2021 at 9:49 PM Nathan Chancellor
<natechancellor@gmail.com> wrote:
>
> Commit eff8728fe698 ("vmlinux.lds.h: Add PGO and AutoFDO input
> sections") added ".text.unlikely.*" and ".text.hot.*" due to an LLVM
> change [1].
>
> After another LLVM change [2], these sections are seen in some PowerPC
> builds, where there is a orphan section warning then build failure:
>

Looks like you forgot to add your references/links to [1] and [2].

Might be good to mention...?

With CONFIG_LD_ORPHAN_WARN=y is enabled

- Sedat

> $ make -skj"$(nproc)" \
>        ARCH=powerpc CROSS_COMPILE=powerpc64le-linux-gnu- LLVM=1 O=out \
>        distclean powernv_defconfig zImage.epapr
> ld.lld: warning: kernel/built-in.a(panic.o):(.text.unlikely.) is being placed in '.text.unlikely.'
> ...
> ld.lld: warning: address (0xc000000000009314) of section .text is not a multiple of alignment (256)
> ...
> ERROR: start_text address is c000000000009400, should be c000000000008000
> ERROR: try to enable LD_HEAD_STUB_CATCH config option
> ERROR: see comments in arch/powerpc/tools/head_check.sh
> ...
>
> Explicitly handle these sections like in the main linker script so
> there is no more build failure.
>
> Cc: stable@vger.kernel.org
> Fixes: 83a092cf95f2 ("powerpc: Link warning for orphan sections")
> Link: https://github.com/ClangBuiltLinux/linux/issues/1218
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
> ---
>  arch/powerpc/kernel/vmlinux.lds.S | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
> index 0318ba436f34..8e0b1298bf19 100644
> --- a/arch/powerpc/kernel/vmlinux.lds.S
> +++ b/arch/powerpc/kernel/vmlinux.lds.S
> @@ -85,7 +85,7 @@ SECTIONS
>                 ALIGN_FUNCTION();
>  #endif
>                 /* careful! __ftr_alt_* sections need to be close to .text */
> -               *(.text.hot TEXT_MAIN .text.fixup .text.unlikely .fixup __ftr_alt_* .ref.text);
> +               *(.text.hot .text.hot.* TEXT_MAIN .text.fixup .text.unlikely .text.unlikely.* .fixup __ftr_alt_* .ref.text);
>  #ifdef CONFIG_PPC64
>                 *(.tramp.ftrace.text);
>  #endif
>
> base-commit: d8a4f20584d5906093a8fc6aa06622102a501095
> --
> 2.30.0
>
> --
> You received this message because you are subscribed to the Google Groups "Clang Built Linux" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-linux+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/20210104204850.990966-1-natechancellor%40gmail.com.

  reply	other threads:[~2021-01-05  0:11 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-04 20:48 [PATCH] powerpc: Handle .text.{hot,unlikely}.* in linker script Nathan Chancellor
2021-01-04 20:48 ` Nathan Chancellor
2021-01-04 20:55 ` Sedat Dilek [this message]
2021-01-04 20:55   ` Sedat Dilek
2021-01-04 20:57   ` Nathan Chancellor
2021-01-04 20:57     ` Nathan Chancellor
2021-01-04 20:59 ` [PATCH v2] " Nathan Chancellor
2021-01-04 20:59   ` Nathan Chancellor
2021-01-15 12:23   ` Michael Ellerman
2021-01-15 12:23     ` [PATCH v2] powerpc: Handle .text.{hot, unlikely}.* " Michael Ellerman
2021-01-16 18:44   ` [PATCH v2] powerpc: Handle .text.{hot,unlikely}.* " Segher Boessenkool
2021-01-16 18:44     ` [PATCH v2] powerpc: Handle .text.{hot, unlikely}.* " Segher Boessenkool
2021-01-16 18:52     ` [PATCH v2] powerpc: Handle .text.{hot,unlikely}.* " Nathan Chancellor
2021-01-16 18:52       ` 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=CA+icZUVe4AJoLWMqS3MEx700jcwDaJhw78tUgg8iD0dJvEmmYg@mail.gmail.com \
    --to=sedat.dilek@gmail.com \
    --cc=benh@kernel.crashing.org \
    --cc=clang-built-linux@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=natechancellor@gmail.com \
    --cc=ndesaulniers@google.com \
    --cc=paulus@samba.org \
    --cc=stable@vger.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.