linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] hexagon: Fix build error with CONFIG_STACKDEPOT and select CONFIG_ARCH_WANT_LD_ORPHAN_WARN
@ 2021-05-21  1:12 Nathan Chancellor
  2021-05-21  1:12 ` [PATCH 1/3] hexagon: Handle {,SOFT}IRQENTRY_TEXT in linker script Nathan Chancellor
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Nathan Chancellor @ 2021-05-21  1:12 UTC (permalink / raw)
  To: Brian Cain, Andrew Morton
  Cc: Nick Desaulniers, linux-hexagon, linux-kernel, clang-built-linux,
	Nathan Chancellor

Hi all,

This series fixes an error with ARCH=hexagon that was pointed out by
the patch "mm/slub: use stackdepot to save stack trace in objects",
which is in -mm/-next.

The first patch fixes that error by handling the '.irqentry.text' and
'.softirqentry.text' sections.

The second patch switches Hexagon over to the common DISCARDS macro,
which should have been done when Hexagon was merged into the tree to
match commit 023bf6f1b8bf ("linker script: unify usage of discard
definition").

The third patch selects CONFIG_ARCH_WANT_LD_ORPHAN_WARN so that
something like this does not happen again.

Nathan Chancellor (3):
  hexagon: Handle {,SOFT}IRQENTRY_TEXT in linker script
  hexagon: Use common DISCARDS macro
  hexagon: Select ARCH_WANT_LD_ORPHAN_WARN

 arch/hexagon/Kconfig              | 1 +
 arch/hexagon/kernel/vmlinux.lds.S | 9 +++------
 2 files changed, 4 insertions(+), 6 deletions(-)


base-commit: 7a42b92b6d30c3f09629c7d5ada9e3de2aba01af
-- 
2.32.0.rc0


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

* [PATCH 1/3] hexagon: Handle {,SOFT}IRQENTRY_TEXT in linker script
  2021-05-21  1:12 [PATCH 0/3] hexagon: Fix build error with CONFIG_STACKDEPOT and select CONFIG_ARCH_WANT_LD_ORPHAN_WARN Nathan Chancellor
@ 2021-05-21  1:12 ` Nathan Chancellor
  2021-06-01 19:16   ` Nick Desaulniers
  2021-06-03 16:59   ` Brian Cain
  2021-05-21  1:12 ` [PATCH 2/3] hexagon: Use common DISCARDS macro Nathan Chancellor
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 13+ messages in thread
From: Nathan Chancellor @ 2021-05-21  1:12 UTC (permalink / raw)
  To: Brian Cain, Andrew Morton
  Cc: Nick Desaulniers, linux-hexagon, linux-kernel, clang-built-linux,
	Nathan Chancellor

Patch "mm/slub: use stackdepot to save stack trace in objects" in -mm
selects CONFIG_STACKDEPOT when CONFIG_STACKTRACE_SUPPORT is selected and
CONFIG_STACKDEPOT requires IRQENTRY_TEXT and SOFTIRQENTRY_TEXT to be
handled after commit 505a0ef15f96 ("kasan: stackdepot: move
filter_irq_stacks() to stackdepot.c") due to the use of the
__{,soft}irqentry_text_{start,end} section symbols. If those sections
are not handled, the build is broken.

$ make ARCH=hexagon CROSS_COMPILE=hexagon-linux- LLVM=1 LLVM_IAS=1 defconfig all
...
ld.lld: error: undefined symbol: __irqentry_text_start
>>> referenced by stackdepot.c
>>>               stackdepot.o:(filter_irq_stacks) in archive lib/built-in.a
>>> referenced by stackdepot.c
>>>               stackdepot.o:(filter_irq_stacks) in archive lib/built-in.a

ld.lld: error: undefined symbol: __irqentry_text_end
>>> referenced by stackdepot.c
>>>               stackdepot.o:(filter_irq_stacks) in archive lib/built-in.a
>>> referenced by stackdepot.c
>>>               stackdepot.o:(filter_irq_stacks) in archive lib/built-in.a

ld.lld: error: undefined symbol: __softirqentry_text_start
>>> referenced by stackdepot.c
>>>               stackdepot.o:(filter_irq_stacks) in archive lib/built-in.a
>>> referenced by stackdepot.c
>>>               stackdepot.o:(filter_irq_stacks) in archive lib/built-in.a

ld.lld: error: undefined symbol: __softirqentry_text_end
>>> referenced by stackdepot.c
>>>               stackdepot.o:(filter_irq_stacks) in archive lib/built-in.a
>>> referenced by stackdepot.c
>>>               stackdepot.o:(filter_irq_stacks) in archive lib/built-in.a
...

Add these sections to the Hexagon linker script so the build continues
to work. ld.lld's orphan section warning would have caught this prior to
the -mm commit mentioned above:

ld.lld: warning: kernel/built-in.a(softirq.o):(.softirqentry.text) is being placed in '.softirqentry.text'
ld.lld: warning: kernel/built-in.a(softirq.o):(.softirqentry.text) is being placed in '.softirqentry.text'
ld.lld: warning: kernel/built-in.a(softirq.o):(.softirqentry.text) is being placed in '.softirqentry.text'

Fixes: 505a0ef15f96 ("kasan: stackdepot: move filter_irq_stacks() to stackdepot.c")
Link: https://github.com/ClangBuiltLinux/linux/issues/1381
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 arch/hexagon/kernel/vmlinux.lds.S | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/hexagon/kernel/vmlinux.lds.S b/arch/hexagon/kernel/vmlinux.lds.S
index 35b18e55eae8..20f19539c5fc 100644
--- a/arch/hexagon/kernel/vmlinux.lds.S
+++ b/arch/hexagon/kernel/vmlinux.lds.S
@@ -38,6 +38,8 @@ SECTIONS
 	.text : AT(ADDR(.text)) {
 		_text = .;
 		TEXT_TEXT
+		IRQENTRY_TEXT
+		SOFTIRQENTRY_TEXT
 		SCHED_TEXT
 		CPUIDLE_TEXT
 		LOCK_TEXT
-- 
2.32.0.rc0


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

* [PATCH 2/3] hexagon: Use common DISCARDS macro
  2021-05-21  1:12 [PATCH 0/3] hexagon: Fix build error with CONFIG_STACKDEPOT and select CONFIG_ARCH_WANT_LD_ORPHAN_WARN Nathan Chancellor
  2021-05-21  1:12 ` [PATCH 1/3] hexagon: Handle {,SOFT}IRQENTRY_TEXT in linker script Nathan Chancellor
@ 2021-05-21  1:12 ` Nathan Chancellor
  2021-06-01 19:18   ` Nick Desaulniers
  2021-06-03 16:59   ` Brian Cain
  2021-05-21  1:12 ` [PATCH 3/3] hexagon: Select ARCH_WANT_LD_ORPHAN_WARN Nathan Chancellor
  2021-06-03  1:17 ` [PATCH 0/3] hexagon: Fix build error with CONFIG_STACKDEPOT and select CONFIG_ARCH_WANT_LD_ORPHAN_WARN Nathan Chancellor
  3 siblings, 2 replies; 13+ messages in thread
From: Nathan Chancellor @ 2021-05-21  1:12 UTC (permalink / raw)
  To: Brian Cain, Andrew Morton
  Cc: Nick Desaulniers, linux-hexagon, linux-kernel, clang-built-linux,
	Nathan Chancellor

ld.lld warns that the '.modinfo' section is not currently handled:

ld.lld: warning: kernel/built-in.a(workqueue.o):(.modinfo) is being placed in '.modinfo'
ld.lld: warning: kernel/built-in.a(printk/printk.o):(.modinfo) is being placed in '.modinfo'
ld.lld: warning: kernel/built-in.a(irq/spurious.o):(.modinfo) is being placed in '.modinfo'
ld.lld: warning: kernel/built-in.a(rcu/update.o):(.modinfo) is being placed in '.modinfo'

The '.modinfo' section was added in commit 898490c010b5 ("moduleparam:
Save information about built-in modules in separate file") to the
DISCARDS macro but Hexagon has never used that macro. The unification of
DISCARDS happened in commit 023bf6f1b8bf ("linker script: unify usage of
discard definition") in 2009, prior to Hexagon being added in 2011.

Switch Hexagon over to the DISCARDS macro so that anything that is
expected to be discarded gets discarded.

Fixes: e95bf452a9e2 ("Hexagon: Add configuration and makefiles for the Hexagon architecture.")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 arch/hexagon/kernel/vmlinux.lds.S | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/arch/hexagon/kernel/vmlinux.lds.S b/arch/hexagon/kernel/vmlinux.lds.S
index 20f19539c5fc..57465bff1fe4 100644
--- a/arch/hexagon/kernel/vmlinux.lds.S
+++ b/arch/hexagon/kernel/vmlinux.lds.S
@@ -61,14 +61,9 @@ SECTIONS
 
 	_end = .;
 
-	/DISCARD/ : {
-		EXIT_TEXT
-		EXIT_DATA
-		EXIT_CALL
-	}
-
 	STABS_DEBUG
 	DWARF_DEBUG
 	ELF_DETAILS
 
+	DISCARDS
 }
-- 
2.32.0.rc0


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

* [PATCH 3/3] hexagon: Select ARCH_WANT_LD_ORPHAN_WARN
  2021-05-21  1:12 [PATCH 0/3] hexagon: Fix build error with CONFIG_STACKDEPOT and select CONFIG_ARCH_WANT_LD_ORPHAN_WARN Nathan Chancellor
  2021-05-21  1:12 ` [PATCH 1/3] hexagon: Handle {,SOFT}IRQENTRY_TEXT in linker script Nathan Chancellor
  2021-05-21  1:12 ` [PATCH 2/3] hexagon: Use common DISCARDS macro Nathan Chancellor
@ 2021-05-21  1:12 ` Nathan Chancellor
  2021-06-01 19:20   ` Nick Desaulniers
  2021-06-03 16:59   ` Brian Cain
  2021-06-03  1:17 ` [PATCH 0/3] hexagon: Fix build error with CONFIG_STACKDEPOT and select CONFIG_ARCH_WANT_LD_ORPHAN_WARN Nathan Chancellor
  3 siblings, 2 replies; 13+ messages in thread
From: Nathan Chancellor @ 2021-05-21  1:12 UTC (permalink / raw)
  To: Brian Cain, Andrew Morton
  Cc: Nick Desaulniers, linux-hexagon, linux-kernel, clang-built-linux,
	Nathan Chancellor

Now that we handle all of the sections in a Hexagon defconfig, select
ARCH_WANT_LD_ORPHAN_WARN so that unhandled sections are warned about by
default.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 arch/hexagon/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/hexagon/Kconfig b/arch/hexagon/Kconfig
index 44a409967af1..e5a852080730 100644
--- a/arch/hexagon/Kconfig
+++ b/arch/hexagon/Kconfig
@@ -30,6 +30,7 @@ config HEXAGON
 	select MODULES_USE_ELF_RELA
 	select GENERIC_CPU_DEVICES
 	select SET_FS
+	select ARCH_WANT_LD_ORPHAN_WARN
 	help
 	  Qualcomm Hexagon is a processor architecture designed for high
 	  performance and low power across a wide variety of applications.
-- 
2.32.0.rc0


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

* Re: [PATCH 1/3] hexagon: Handle {,SOFT}IRQENTRY_TEXT in linker script
  2021-05-21  1:12 ` [PATCH 1/3] hexagon: Handle {,SOFT}IRQENTRY_TEXT in linker script Nathan Chancellor
@ 2021-06-01 19:16   ` Nick Desaulniers
  2021-06-03 16:59   ` Brian Cain
  1 sibling, 0 replies; 13+ messages in thread
From: Nick Desaulniers @ 2021-06-01 19:16 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Brian Cain, Andrew Morton, open list:QUALCOMM HEXAGON...,
	LKML, clang-built-linux

On Thu, May 20, 2021 at 6:13 PM Nathan Chancellor <nathan@kernel.org> wrote:
>
> Patch "mm/slub: use stackdepot to save stack trace in objects" in -mm
> selects CONFIG_STACKDEPOT when CONFIG_STACKTRACE_SUPPORT is selected and
> CONFIG_STACKDEPOT requires IRQENTRY_TEXT and SOFTIRQENTRY_TEXT to be
> handled after commit 505a0ef15f96 ("kasan: stackdepot: move
> filter_irq_stacks() to stackdepot.c") due to the use of the
> __{,soft}irqentry_text_{start,end} section symbols. If those sections
> are not handled, the build is broken.
>
> $ make ARCH=hexagon CROSS_COMPILE=hexagon-linux- LLVM=1 LLVM_IAS=1 defconfig all
> ...
> ld.lld: error: undefined symbol: __irqentry_text_start
> >>> referenced by stackdepot.c
> >>>               stackdepot.o:(filter_irq_stacks) in archive lib/built-in.a
> >>> referenced by stackdepot.c
> >>>               stackdepot.o:(filter_irq_stacks) in archive lib/built-in.a
>
> ld.lld: error: undefined symbol: __irqentry_text_end
> >>> referenced by stackdepot.c
> >>>               stackdepot.o:(filter_irq_stacks) in archive lib/built-in.a
> >>> referenced by stackdepot.c
> >>>               stackdepot.o:(filter_irq_stacks) in archive lib/built-in.a
>
> ld.lld: error: undefined symbol: __softirqentry_text_start
> >>> referenced by stackdepot.c
> >>>               stackdepot.o:(filter_irq_stacks) in archive lib/built-in.a
> >>> referenced by stackdepot.c
> >>>               stackdepot.o:(filter_irq_stacks) in archive lib/built-in.a
>
> ld.lld: error: undefined symbol: __softirqentry_text_end
> >>> referenced by stackdepot.c
> >>>               stackdepot.o:(filter_irq_stacks) in archive lib/built-in.a
> >>> referenced by stackdepot.c
> >>>               stackdepot.o:(filter_irq_stacks) in archive lib/built-in.a
> ...
>
> Add these sections to the Hexagon linker script so the build continues
> to work. ld.lld's orphan section warning would have caught this prior to
> the -mm commit mentioned above:
>
> ld.lld: warning: kernel/built-in.a(softirq.o):(.softirqentry.text) is being placed in '.softirqentry.text'
> ld.lld: warning: kernel/built-in.a(softirq.o):(.softirqentry.text) is being placed in '.softirqentry.text'
> ld.lld: warning: kernel/built-in.a(softirq.o):(.softirqentry.text) is being placed in '.softirqentry.text'
>
> Fixes: 505a0ef15f96 ("kasan: stackdepot: move filter_irq_stacks() to stackdepot.c")
> Link: https://github.com/ClangBuiltLinux/linux/issues/1381
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>

Thanks for the series, and sorry I didn't get around to reviewing
before I took time off last week.

Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>

> ---
>  arch/hexagon/kernel/vmlinux.lds.S | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/arch/hexagon/kernel/vmlinux.lds.S b/arch/hexagon/kernel/vmlinux.lds.S
> index 35b18e55eae8..20f19539c5fc 100644
> --- a/arch/hexagon/kernel/vmlinux.lds.S
> +++ b/arch/hexagon/kernel/vmlinux.lds.S
> @@ -38,6 +38,8 @@ SECTIONS
>         .text : AT(ADDR(.text)) {
>                 _text = .;
>                 TEXT_TEXT
> +               IRQENTRY_TEXT
> +               SOFTIRQENTRY_TEXT
>                 SCHED_TEXT
>                 CPUIDLE_TEXT
>                 LOCK_TEXT
> --
> 2.32.0.rc0
>


-- 
Thanks,
~Nick Desaulniers

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

* Re: [PATCH 2/3] hexagon: Use common DISCARDS macro
  2021-05-21  1:12 ` [PATCH 2/3] hexagon: Use common DISCARDS macro Nathan Chancellor
@ 2021-06-01 19:18   ` Nick Desaulniers
  2021-06-03 16:59   ` Brian Cain
  1 sibling, 0 replies; 13+ messages in thread
From: Nick Desaulniers @ 2021-06-01 19:18 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Brian Cain, Andrew Morton, open list:QUALCOMM HEXAGON...,
	LKML, clang-built-linux

On Thu, May 20, 2021 at 6:13 PM Nathan Chancellor <nathan@kernel.org> wrote:
>
> ld.lld warns that the '.modinfo' section is not currently handled:
>
> ld.lld: warning: kernel/built-in.a(workqueue.o):(.modinfo) is being placed in '.modinfo'
> ld.lld: warning: kernel/built-in.a(printk/printk.o):(.modinfo) is being placed in '.modinfo'
> ld.lld: warning: kernel/built-in.a(irq/spurious.o):(.modinfo) is being placed in '.modinfo'
> ld.lld: warning: kernel/built-in.a(rcu/update.o):(.modinfo) is being placed in '.modinfo'
>
> The '.modinfo' section was added in commit 898490c010b5 ("moduleparam:
> Save information about built-in modules in separate file") to the
> DISCARDS macro but Hexagon has never used that macro. The unification of
> DISCARDS happened in commit 023bf6f1b8bf ("linker script: unify usage of
> discard definition") in 2009, prior to Hexagon being added in 2011.
>
> Switch Hexagon over to the DISCARDS macro so that anything that is
> expected to be discarded gets discarded.
>
> Fixes: e95bf452a9e2 ("Hexagon: Add configuration and makefiles for the Hexagon architecture.")
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>

Thanks for the patch.
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>

> ---
>  arch/hexagon/kernel/vmlinux.lds.S | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/arch/hexagon/kernel/vmlinux.lds.S b/arch/hexagon/kernel/vmlinux.lds.S
> index 20f19539c5fc..57465bff1fe4 100644
> --- a/arch/hexagon/kernel/vmlinux.lds.S
> +++ b/arch/hexagon/kernel/vmlinux.lds.S
> @@ -61,14 +61,9 @@ SECTIONS
>
>         _end = .;
>
> -       /DISCARD/ : {
> -               EXIT_TEXT
> -               EXIT_DATA
> -               EXIT_CALL
> -       }
> -
>         STABS_DEBUG
>         DWARF_DEBUG
>         ELF_DETAILS
>
> +       DISCARDS
>  }
> --
> 2.32.0.rc0
>


-- 
Thanks,
~Nick Desaulniers

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

* Re: [PATCH 3/3] hexagon: Select ARCH_WANT_LD_ORPHAN_WARN
  2021-05-21  1:12 ` [PATCH 3/3] hexagon: Select ARCH_WANT_LD_ORPHAN_WARN Nathan Chancellor
@ 2021-06-01 19:20   ` Nick Desaulniers
  2021-06-03 16:59   ` Brian Cain
  1 sibling, 0 replies; 13+ messages in thread
From: Nick Desaulniers @ 2021-06-01 19:20 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Brian Cain, Andrew Morton, open list:QUALCOMM HEXAGON...,
	LKML, clang-built-linux

On Thu, May 20, 2021 at 6:13 PM Nathan Chancellor <nathan@kernel.org> wrote:
>
> Now that we handle all of the sections in a Hexagon defconfig, select
> ARCH_WANT_LD_ORPHAN_WARN so that unhandled sections are warned about by
> default.

Great to see another arch using this build-safety feature!
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>

>
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
>  arch/hexagon/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/hexagon/Kconfig b/arch/hexagon/Kconfig
> index 44a409967af1..e5a852080730 100644
> --- a/arch/hexagon/Kconfig
> +++ b/arch/hexagon/Kconfig
> @@ -30,6 +30,7 @@ config HEXAGON
>         select MODULES_USE_ELF_RELA
>         select GENERIC_CPU_DEVICES
>         select SET_FS
> +       select ARCH_WANT_LD_ORPHAN_WARN
>         help
>           Qualcomm Hexagon is a processor architecture designed for high
>           performance and low power across a wide variety of applications.
> --
> 2.32.0.rc0
>


-- 
Thanks,
~Nick Desaulniers

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

* Re: [PATCH 0/3] hexagon: Fix build error with CONFIG_STACKDEPOT and select CONFIG_ARCH_WANT_LD_ORPHAN_WARN
  2021-05-21  1:12 [PATCH 0/3] hexagon: Fix build error with CONFIG_STACKDEPOT and select CONFIG_ARCH_WANT_LD_ORPHAN_WARN Nathan Chancellor
                   ` (2 preceding siblings ...)
  2021-05-21  1:12 ` [PATCH 3/3] hexagon: Select ARCH_WANT_LD_ORPHAN_WARN Nathan Chancellor
@ 2021-06-03  1:17 ` Nathan Chancellor
  2021-06-03 16:59   ` Brian Cain
  3 siblings, 1 reply; 13+ messages in thread
From: Nathan Chancellor @ 2021-06-03  1:17 UTC (permalink / raw)
  To: Brian Cain, Andrew Morton
  Cc: Nick Desaulniers, linux-hexagon, linux-kernel, clang-built-linux

On 5/20/2021 6:12 PM, Nathan Chancellor wrote:
> Hi all,
> 
> This series fixes an error with ARCH=hexagon that was pointed out by
> the patch "mm/slub: use stackdepot to save stack trace in objects",
> which is in -mm/-next.
> 
> The first patch fixes that error by handling the '.irqentry.text' and
> '.softirqentry.text' sections.
> 
> The second patch switches Hexagon over to the common DISCARDS macro,
> which should have been done when Hexagon was merged into the tree to
> match commit 023bf6f1b8bf ("linker script: unify usage of discard
> definition").
> 
> The third patch selects CONFIG_ARCH_WANT_LD_ORPHAN_WARN so that
> something like this does not happen again.
> 
> Nathan Chancellor (3):
>    hexagon: Handle {,SOFT}IRQENTRY_TEXT in linker script
>    hexagon: Use common DISCARDS macro
>    hexagon: Select ARCH_WANT_LD_ORPHAN_WARN
> 
>   arch/hexagon/Kconfig              | 1 +
>   arch/hexagon/kernel/vmlinux.lds.S | 9 +++------
>   2 files changed, 4 insertions(+), 6 deletions(-)
> 
> 
> base-commit: 7a42b92b6d30c3f09629c7d5ada9e3de2aba01af
> 

Brian, did you have any comments on this series? ARCH=hexagon defconfig 
is currently broken in -next, it would be a real shame if this continued 
to regress after you just got Hexagon building in mainline. These 
patches seem like they would be worthy of a 5.13 pull request. 
Otherwise, Andrew could pick them up with your ack and stick them in 
front of "mm/slub: use stackdepot to save stack trace in objects" so 
that there is no build regression.

Cheers,
Nathan

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

* RE: [PATCH 0/3] hexagon: Fix build error with CONFIG_STACKDEPOT and select CONFIG_ARCH_WANT_LD_ORPHAN_WARN
  2021-06-03  1:17 ` [PATCH 0/3] hexagon: Fix build error with CONFIG_STACKDEPOT and select CONFIG_ARCH_WANT_LD_ORPHAN_WARN Nathan Chancellor
@ 2021-06-03 16:59   ` Brian Cain
  2021-06-15 17:25     ` Nathan Chancellor
  0 siblings, 1 reply; 13+ messages in thread
From: Brian Cain @ 2021-06-03 16:59 UTC (permalink / raw)
  To: 'Nathan Chancellor', 'Andrew Morton'
  Cc: 'Nick Desaulniers',
	linux-hexagon, linux-kernel, clang-built-linux

> -----Original Message-----
> From: Nathan Chancellor <nathan@kernel.org>
...
> On 5/20/2021 6:12 PM, Nathan Chancellor wrote:
> > Hi all,
...
> Brian, did you have any comments on this series? ARCH=hexagon defconfig
> is currently broken in -next, it would be a real shame if this continued
> to regress after you just got Hexagon building in mainline. These
> patches seem like they would be worthy of a 5.13 pull request.

I have started the internal review process to get these queued up in my tree.  But I don't know if I would have it in time for 5.13.

> Otherwise, Andrew could pick them up with your ack and stick them in
> front of "mm/slub: use stackdepot to save stack trace in objects" so
> that there is no build regression.

Of course: I'll send my ack for the sake of keeping the build green.

-Brian


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

* RE: [PATCH 1/3] hexagon: Handle {,SOFT}IRQENTRY_TEXT in linker script
  2021-05-21  1:12 ` [PATCH 1/3] hexagon: Handle {,SOFT}IRQENTRY_TEXT in linker script Nathan Chancellor
  2021-06-01 19:16   ` Nick Desaulniers
@ 2021-06-03 16:59   ` Brian Cain
  1 sibling, 0 replies; 13+ messages in thread
From: Brian Cain @ 2021-06-03 16:59 UTC (permalink / raw)
  To: 'Nathan Chancellor', 'Andrew Morton'
  Cc: 'Nick Desaulniers',
	linux-hexagon, linux-kernel, clang-built-linux

> -----Original Message-----
> From: Nathan Chancellor <nathan@kernel.org>
> Sent: Thursday, May 20, 2021 8:13 PM
> To: Brian Cain <bcain@codeaurora.org>; Andrew Morton <akpm@linux-
> foundation.org>
> Cc: Nick Desaulniers <ndesaulniers@google.com>; linux-
> hexagon@vger.kernel.org; linux-kernel@vger.kernel.org; clang-built-
> linux@googlegroups.com; Nathan Chancellor <nathan@kernel.org>
> Subject: [PATCH 1/3] hexagon: Handle {,SOFT}IRQENTRY_TEXT in linker script
> 
> Patch "mm/slub: use stackdepot to save stack trace in objects" in -mm
> selects CONFIG_STACKDEPOT when CONFIG_STACKTRACE_SUPPORT is
> selected and
> CONFIG_STACKDEPOT requires IRQENTRY_TEXT and SOFTIRQENTRY_TEXT to
> be
> handled after commit 505a0ef15f96 ("kasan: stackdepot: move
> filter_irq_stacks() to stackdepot.c") due to the use of the
> __{,soft}irqentry_text_{start,end} section symbols. If those sections
> are not handled, the build is broken.
> 
> $ make ARCH=hexagon CROSS_COMPILE=hexagon-linux- LLVM=1 LLVM_IAS=1
> defconfig all
> ...
> ld.lld: error: undefined symbol: __irqentry_text_start
> >>> referenced by stackdepot.c
> >>>               stackdepot.o:(filter_irq_stacks) in archive
lib/built-in.a
> >>> referenced by stackdepot.c
> >>>               stackdepot.o:(filter_irq_stacks) in archive
lib/built-in.a
> 
> ld.lld: error: undefined symbol: __irqentry_text_end
> >>> referenced by stackdepot.c
> >>>               stackdepot.o:(filter_irq_stacks) in archive
lib/built-in.a
> >>> referenced by stackdepot.c
> >>>               stackdepot.o:(filter_irq_stacks) in archive
lib/built-in.a
> 
> ld.lld: error: undefined symbol: __softirqentry_text_start
> >>> referenced by stackdepot.c
> >>>               stackdepot.o:(filter_irq_stacks) in archive
lib/built-in.a
> >>> referenced by stackdepot.c
> >>>               stackdepot.o:(filter_irq_stacks) in archive
lib/built-in.a
> 
> ld.lld: error: undefined symbol: __softirqentry_text_end
> >>> referenced by stackdepot.c
> >>>               stackdepot.o:(filter_irq_stacks) in archive
lib/built-in.a
> >>> referenced by stackdepot.c
> >>>               stackdepot.o:(filter_irq_stacks) in archive
lib/built-in.a
> ...
> 
> Add these sections to the Hexagon linker script so the build continues
> to work. ld.lld's orphan section warning would have caught this prior to
> the -mm commit mentioned above:
> 
> ld.lld: warning: kernel/built-in.a(softirq.o):(.softirqentry.text) is
being placed in
> '.softirqentry.text'
> ld.lld: warning: kernel/built-in.a(softirq.o):(.softirqentry.text) is
being placed in
> '.softirqentry.text'
> ld.lld: warning: kernel/built-in.a(softirq.o):(.softirqentry.text) is
being placed in
> '.softirqentry.text'
> 
> Fixes: 505a0ef15f96 ("kasan: stackdepot: move filter_irq_stacks() to
> stackdepot.c")
> Link: https://github.com/ClangBuiltLinux/linux/issues/1381
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
>  arch/hexagon/kernel/vmlinux.lds.S | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/hexagon/kernel/vmlinux.lds.S
> b/arch/hexagon/kernel/vmlinux.lds.S
> index 35b18e55eae8..20f19539c5fc 100644
> --- a/arch/hexagon/kernel/vmlinux.lds.S
> +++ b/arch/hexagon/kernel/vmlinux.lds.S
> @@ -38,6 +38,8 @@ SECTIONS
>  	.text : AT(ADDR(.text)) {
>  		_text = .;
>  		TEXT_TEXT
> +		IRQENTRY_TEXT
> +		SOFTIRQENTRY_TEXT
>  		SCHED_TEXT
>  		CPUIDLE_TEXT
>  		LOCK_TEXT
> --
> 2.32.0.rc0

Acked-by: Brian Cain <bcain@codeaurora.org>


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

* RE: [PATCH 3/3] hexagon: Select ARCH_WANT_LD_ORPHAN_WARN
  2021-05-21  1:12 ` [PATCH 3/3] hexagon: Select ARCH_WANT_LD_ORPHAN_WARN Nathan Chancellor
  2021-06-01 19:20   ` Nick Desaulniers
@ 2021-06-03 16:59   ` Brian Cain
  1 sibling, 0 replies; 13+ messages in thread
From: Brian Cain @ 2021-06-03 16:59 UTC (permalink / raw)
  To: 'Nathan Chancellor', 'Andrew Morton'
  Cc: 'Nick Desaulniers',
	linux-hexagon, linux-kernel, clang-built-linux



> -----Original Message-----
> From: Nathan Chancellor <nathan@kernel.org>
> Sent: Thursday, May 20, 2021 8:13 PM
> To: Brian Cain <bcain@codeaurora.org>; Andrew Morton <akpm@linux-
> foundation.org>
> Cc: Nick Desaulniers <ndesaulniers@google.com>; linux-
> hexagon@vger.kernel.org; linux-kernel@vger.kernel.org; clang-built-
> linux@googlegroups.com; Nathan Chancellor <nathan@kernel.org>
> Subject: [PATCH 3/3] hexagon: Select ARCH_WANT_LD_ORPHAN_WARN
> 
> Now that we handle all of the sections in a Hexagon defconfig, select
> ARCH_WANT_LD_ORPHAN_WARN so that unhandled sections are warned
> about by
> default.
> 
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
>  arch/hexagon/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/hexagon/Kconfig b/arch/hexagon/Kconfig
> index 44a409967af1..e5a852080730 100644
> --- a/arch/hexagon/Kconfig
> +++ b/arch/hexagon/Kconfig
> @@ -30,6 +30,7 @@ config HEXAGON
>  	select MODULES_USE_ELF_RELA
>  	select GENERIC_CPU_DEVICES
>  	select SET_FS
> +	select ARCH_WANT_LD_ORPHAN_WARN
>  	help
>  	  Qualcomm Hexagon is a processor architecture designed for high
>  	  performance and low power across a wide variety of applications.
> --
> 2.32.0.rc0

Acked-by: Brian Cain <bcain@codeaurora.org>


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

* RE: [PATCH 2/3] hexagon: Use common DISCARDS macro
  2021-05-21  1:12 ` [PATCH 2/3] hexagon: Use common DISCARDS macro Nathan Chancellor
  2021-06-01 19:18   ` Nick Desaulniers
@ 2021-06-03 16:59   ` Brian Cain
  1 sibling, 0 replies; 13+ messages in thread
From: Brian Cain @ 2021-06-03 16:59 UTC (permalink / raw)
  To: 'Nathan Chancellor', 'Andrew Morton'
  Cc: 'Nick Desaulniers',
	linux-hexagon, linux-kernel, clang-built-linux



> -----Original Message-----
> From: Nathan Chancellor <nathan@kernel.org>
> Sent: Thursday, May 20, 2021 8:13 PM
> To: Brian Cain <bcain@codeaurora.org>; Andrew Morton <akpm@linux-
> foundation.org>
> Cc: Nick Desaulniers <ndesaulniers@google.com>; linux-
> hexagon@vger.kernel.org; linux-kernel@vger.kernel.org; clang-built-
> linux@googlegroups.com; Nathan Chancellor <nathan@kernel.org>
> Subject: [PATCH 2/3] hexagon: Use common DISCARDS macro
> 
> ld.lld warns that the '.modinfo' section is not currently handled:
> 
> ld.lld: warning: kernel/built-in.a(workqueue.o):(.modinfo) is being placed
in
> '.modinfo'
> ld.lld: warning: kernel/built-in.a(printk/printk.o):(.modinfo) is being
placed in
> '.modinfo'
> ld.lld: warning: kernel/built-in.a(irq/spurious.o):(.modinfo) is being
placed in
> '.modinfo'
> ld.lld: warning: kernel/built-in.a(rcu/update.o):(.modinfo) is being
placed in
> '.modinfo'
> 
> The '.modinfo' section was added in commit 898490c010b5 ("moduleparam:
> Save information about built-in modules in separate file") to the
> DISCARDS macro but Hexagon has never used that macro. The unification of
> DISCARDS happened in commit 023bf6f1b8bf ("linker script: unify usage of
> discard definition") in 2009, prior to Hexagon being added in 2011.
> 
> Switch Hexagon over to the DISCARDS macro so that anything that is
> expected to be discarded gets discarded.
> 
> Fixes: e95bf452a9e2 ("Hexagon: Add configuration and makefiles for the
> Hexagon architecture.")
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
>  arch/hexagon/kernel/vmlinux.lds.S | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/arch/hexagon/kernel/vmlinux.lds.S
> b/arch/hexagon/kernel/vmlinux.lds.S
> index 20f19539c5fc..57465bff1fe4 100644
> --- a/arch/hexagon/kernel/vmlinux.lds.S
> +++ b/arch/hexagon/kernel/vmlinux.lds.S
> @@ -61,14 +61,9 @@ SECTIONS
> 
>  	_end = .;
> 
> -	/DISCARD/ : {
> -		EXIT_TEXT
> -		EXIT_DATA
> -		EXIT_CALL
> -	}
> -
>  	STABS_DEBUG
>  	DWARF_DEBUG
>  	ELF_DETAILS
> 
> +	DISCARDS
>  }
> --
> 2.32.0.rc0

Acked-by: Brian Cain <bcain@codeaurora.org>


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

* Re: [PATCH 0/3] hexagon: Fix build error with CONFIG_STACKDEPOT and select CONFIG_ARCH_WANT_LD_ORPHAN_WARN
  2021-06-03 16:59   ` Brian Cain
@ 2021-06-15 17:25     ` Nathan Chancellor
  0 siblings, 0 replies; 13+ messages in thread
From: Nathan Chancellor @ 2021-06-15 17:25 UTC (permalink / raw)
  To: Brian Cain, Andrew Morton
  Cc: 'Nick Desaulniers',
	linux-hexagon, linux-kernel, clang-built-linux

On Thu, Jun 03, 2021 at 11:59:43AM -0500, Brian Cain wrote:
> > -----Original Message-----
> > From: Nathan Chancellor <nathan@kernel.org>
> ...
> > On 5/20/2021 6:12 PM, Nathan Chancellor wrote:
> > > Hi all,
> ...
> > Brian, did you have any comments on this series? ARCH=hexagon defconfig
> > is currently broken in -next, it would be a real shame if this continued
> > to regress after you just got Hexagon building in mainline. These
> > patches seem like they would be worthy of a 5.13 pull request.
> 
> I have started the internal review process to get these queued up in my tree.  But I don't know if I would have it in time for 5.13.
> 
> > Otherwise, Andrew could pick them up with your ack and stick them in
> > front of "mm/slub: use stackdepot to save stack trace in objects" so
> > that there is no build regression.
> 
> Of course: I'll send my ack for the sake of keeping the build green.
> 
> -Brian

Andrew, is there any way you can pick this up so that the Hexagon build
can start being green? I explained the issue in the cover letter so that
you know where to stick this patch set in your stack. If you have any
more questions, please let me know.

Cheers,
Nathan

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

end of thread, other threads:[~2021-06-15 17:25 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-21  1:12 [PATCH 0/3] hexagon: Fix build error with CONFIG_STACKDEPOT and select CONFIG_ARCH_WANT_LD_ORPHAN_WARN Nathan Chancellor
2021-05-21  1:12 ` [PATCH 1/3] hexagon: Handle {,SOFT}IRQENTRY_TEXT in linker script Nathan Chancellor
2021-06-01 19:16   ` Nick Desaulniers
2021-06-03 16:59   ` Brian Cain
2021-05-21  1:12 ` [PATCH 2/3] hexagon: Use common DISCARDS macro Nathan Chancellor
2021-06-01 19:18   ` Nick Desaulniers
2021-06-03 16:59   ` Brian Cain
2021-05-21  1:12 ` [PATCH 3/3] hexagon: Select ARCH_WANT_LD_ORPHAN_WARN Nathan Chancellor
2021-06-01 19:20   ` Nick Desaulniers
2021-06-03 16:59   ` Brian Cain
2021-06-03  1:17 ` [PATCH 0/3] hexagon: Fix build error with CONFIG_STACKDEPOT and select CONFIG_ARCH_WANT_LD_ORPHAN_WARN Nathan Chancellor
2021-06-03 16:59   ` Brian Cain
2021-06-15 17:25     ` Nathan Chancellor

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).