sh: various doc, build, init fixes
Subsystems (9)
Randy Dunlap
reviewerv4 cover sh: various doc, build, init fixes
All of these patches have been sent previously, anywhere from one to 3 times. All patches are now called "v4".
This refresh/resend is to assist the new SH maintainer.
[PATCH 1/7 v4] sh: SH2007: drop the bad URL info
[PATCH 2/7 v4] sh: nmi_debug: fix return value of __setup handler [PATCH 3/7 v4] sh: init: use OF_EARLY_FLATTREE for early init [PATCH 4/7 v4] sh: math-emu: fix macro redefined warning [PATCH 5/7 v4] sh: remove sh5/sh64 last fragments
[PATCH 6/7 v4] sh: fix Kconfig entry for NUMA => SMP
[PATCH 7/7 v4] sh: mcount.S: fix build error when PRINTK is not enabled
diffstat:
Documentation/kbuild/kbuild.rst | 1 - Documentation/scheduler/sched-arch.rst | 2 -- Documentation/translations/zh_CN/scheduler/sched-arch.rst | 2 -- arch/sh/Kconfig | 4 ++++ arch/sh/Kconfig.debug | 2 +- arch/sh/boards/Kconfig | 1 - arch/sh/kernel/head_32.S | 6 +++--- arch/sh/kernel/nmi_debug.c | 4 ++-- arch/sh/kernel/setup.c | 4 ++-- arch/sh/math-emu/sfp-util.h | 4 ---- scripts/checkstack.pl | 7 ------- tools/perf/arch/common.c | 2 -- tools/scripts/Makefile.arch | 5 ----- tools/testing/selftests/mm/Makefile | 2 +- tools/testing/selftests/mm/run_vmtests.sh | 2 +- 15 files changed, 14 insertions(+), 34 deletions(-)
Randy Dunlap
reviewerPATCH v4 1/7 sh: SH2007: drop the bad URL info
This URL provided is no longer functional, so drop it.
---
v2: skipped
v3: skipped
v4: refresh/rebase and resend
arch/sh/boards/Kconfig | 1 - 1 file changed, 1 deletion(-)
arch/sh/boards/Kconfig +0 -1
@@ -358,7 +358,6 @@ config SH_SH2007 intended for embedded applications. It has an Ethernet interface (SMC9118), direct connected Compact Flash socket, two serial ports and PC-104 bus. - More information at <http://sh2000.sh-linux.org>. config SH_APSH4A3A bool "AP-SH4A-3A"
Re: [PATCH 1/7 v4] sh: SH2007: drop the bad URL info
Quoted 23 lines · Randy Dunlap
This URL provided is no longer functional, so drop it.
Fixes 3a598264436e ("sh: SH-2007 board support.")Signed-off-by Randy Dunlap <[email protected]>Cc John Paul Adrian Glaubitz <[email protected]>Cc Yoshinori Sato <[email protected]>Cc Rich Felker <[email protected]>Cc Geert Uytterhoeven <[email protected]>Cc Hitoshi Mitake <[email protected]>Reviewed-by Geert Uytterhoeven <[email protected]>---
v2: skipped
v3: skipped
v4: refresh/rebase and resendarch/sh/boards/Kconfig | 1 - 1 file changed, 1 deletion(-)diff -- a/arch/sh/boards/Kconfig b/arch/sh/boards/Kconfig
arch/sh/boards/Kconfig config SH_SH2007 · line 363
Quoted 7 lines
arch/sh/boards/Kconfig +0
-1@@ -358,7 +358,6 @@ config SH_SH2007 intended for embedded applications. It has an Ethernet interface (SMC9118), direct connected Compact Flash socket, two serial ports and PC-104 bus. - More information at <http://sh2000.sh-linux.org>. config SH_APSH4A3A bool "AP-SH4A-3A"
Signature · 4 lines
.''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Randy Dunlap
reviewerPATCH v4 2/7 sh: nmi_debug: fix return value of __setup handler
In reply to Randy Dunlap__setup() handlers should return 1 to obsolete_checksetup() in init/main.c to indicate that the boot option has been handled. A return of 0 causes the boot option/value to be listed as an Unknown kernel parameter and added to init's (limited) argument or environment strings. Also, error return codes don't mean anything to obsolete_checksetup() -- only non-zero (usually 1) or zero. So return 1 from nmi_debug_setup().
---
v2: add more Cc's;
refresh and resend;v3: add Arnd to Cc: list
v4: update Cc: list, refresh & resend
arch/sh/kernel/nmi_debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/sh/kernel/nmi_debug.c +2 -2
@@ -49,7 +49,7 @@ static int __init nmi_debug_setup(char *register_die_notifier (&nmi_debug_nb);if (*str !='=' ) -return 0 ; +return 1 ;for (p = str +1 ; *p; p = sep +1 ) { sep =strchr (p,',' );
@@ -70,6 +70,6 @@ static int __init nmi_debug_setup(char *break ; } -return 0 ; +return 1 ; }__setup ("nmi_debug" , nmi_debug_setup);
Re: [PATCH 2/7 v4] sh: nmi_debug: fix return value of __setup handler
Quoted 39 lines · Randy Dunlap
__setup()handlers should return 1 toobsolete_checksetup()ininit/main.cto indicate that the boot option has been handled. A return of 0 causes the boot option/value to be listed as an Unknown kernel parameter and added to init's (limited) argument or environment strings. Also, error return codes don't mean anything toobsolete_checksetup()-- only non-zero (usually 1) or zero. So return 1 fromnmi_debug_setup().Fixes 1e1030dccb10 ("sh: nmi_debug support.")Signed-off-by Randy Dunlap <[email protected]>Reported-by Igor Zhbanov <[email protected]>Link lore.kernel.org/r/[email protected]Cc John Paul Adrian Glaubitz <[email protected]>Cc Yoshinori Sato <[email protected]>Cc Rich Felker <[email protected]>---
v2: add more Cc's; refresh and resend;v3: add Arnd to Cc: list
v4: update Cc: list, refresh & resendarch/sh/kernel/nmi_debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)diff --
a/arch/sh/kernel/nmi_debug.cb/arch/sh/kernel/nmi_debug.carch/sh/kernel/nmi_debug.c +1
-1@@ -49,7 +49,7 @@ static int __init nmi_debug_setup(char *register_die_notifier (&nmi_debug_nb);if (*str !='=' ) -return 0 ; +return 1 ;for (p = str +1 ; *p; p = sep +1 ) { sep =strchr (p,',' );
arch/sh/kernel/nmi_debug.c static int __init nmi_debug_setup(char * · line 75
Quoted 7 lines
arch/sh/kernel/nmi_debug.c +1
-1@@ -70,6 +70,6 @@ static int __init nmi_debug_setup(char *break ; } -return 0 ; +return 1 ; }__setup ("nmi_debug" , nmi_debug_setup);
Signature · 4 lines
.''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Randy Dunlap
reviewerPATCH v4 3/7 sh: init: use OF_EARLY_FLATTREE for early init
In reply to Randy DunlapWhen CONFIG_OF_EARLY_FLATTREE and CONFIG_SH_DEVICE_TREE are not set, SH3 build fails with a call to early_init_dt_scan(), so in arch/sh/kernel/setup.c and arch/sh/kernel/head_32.S, use CONFIG_OF_EARLY_FLATTREE instead of CONFIG_OF_FLATTREE.
Fixes this build error:../arch/sh/kernel/setup.c: In function 'sh_fdt_init':../arch/sh/kernel/setup.c:262:26: error: implicit declaration of function 'early_init_dt_scan' [-Werror=implicit-function-declaration]
262 | if (!dt_virt || !early_init_dt_scan(dt_virt)) {
---
v2: use Suggested-by: for Rob.
add more Cc's.
v3: skipped
v4: update Cc's, refresh & resend
arch/sh/kernel/head_32.S | 6 +++--- arch/sh/kernel/setup.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-)
diff arch/sh/kernel/setup.c arch/sh/kernel/setup.c
arch/sh/kernel/setup.c +2 -2
@@ -244,7 +244,7 @@ void __init __weak plat_early_device_set { } -#ifdef CONFIG_OF_FLATTREE +#ifdef CONFIG_OF_EARLY_FLATTREE void __ref sh_fdt_init (phys_addr_t dt_phys) {static int done =0 ;
@@ -326,7 +326,7 @@ void __init setup_arch(char **cmdline_p)/* Let earlyprintk output early console messages */ sh_early_platform_driver_probe ("earlyprintk" ,1 ,1 ); -#ifdef CONFIG_OF_FLATTREE +#ifdef CONFIG_OF_EARLY_FLATTREE #ifdef CONFIG_USE_BUILTIN_DTB unflatten_and_copy_device_tree ();#else
arch/sh/kernel/head_32.S +3 -3
@@ -64,7 +64,7 @@ ENTRY(_stext) ldc r0, r6_bank #endif -#ifdef CONFIG_OF_FLATTREE +#ifdef CONFIG_OF_EARLY_FLATTREE mov r4, r12 ! Store device tree blob pointer in r12 #endif
@@ -315,7 +315,7 @@ ENTRY(_stext) 10: #endif -#ifdef CONFIG_OF_FLATTREE +#ifdef CONFIG_OF_EARLY_FLATTREE mov.l 8f, r0 ! Make flat device tree available early. jsr @r0 mov r12, r4
@@ -346,7 +346,7 @@ ENTRY(stack_start) 5: .long start_kernel 6: .long cpu_init 7: .long init_thread_union -#if defined(CONFIG_OF_FLATTREE) +#if defined(CONFIG_OF_EARLY_FLATTREE) 8: .long sh_fdt_init #endif
Re: [PATCH 3/7 v4] sh: init: use OF_EARLY_FLATTREE for early init
Quoted 76 lines · Randy Dunlap
When
CONFIG_OF_EARLY_FLATTREEandCONFIG_SH_DEVICE_TREEare not set, SH3 build fails with a call toearly_init_dt_scan(), so inarch/sh/kernel/setup.candarch/sh/kernel/head_32.S, useCONFIG_OF_EARLY_FLATTREEinstead ofCONFIG_OF_FLATTREE.Fixes this build error:
../arch/sh/kernel/setup.c: In function 'sh_fdt_init':../arch/sh/kernel/setup.c:262:26: error: implicit declaration of function 'early_init_dt_scan' [-Werror=implicit-function-declaration]
262 | if (!dt_virt || !early_init_dt_scan(dt_virt)) {Fixes 03767daa1387 ("sh: fix build regression with CONFIG_OF && !CONFIG_OF_FLATTREE")Fixes eb6b6930a70f ("sh: fix memory corruption of unflattened device tree")Signed-off-by Randy Dunlap <[email protected]>Suggested-by Rob Herring <[email protected]>Cc Frank Rowand <[email protected]>Cc Rich Felker <[email protected]>Cc Yoshinori Sato <[email protected]>Cc Geert Uytterhoeven <[email protected]>Cc John Paul Adrian Glaubitz <[email protected]>---
v2: use Suggested-by: for Rob.
add more Cc's.
v3: skipped
v4: update Cc's, refresh & resendarch/sh/kernel/head_32.S | 6 +++--- arch/sh/kernel/setup.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-)diff
arch/sh/kernel/setup.carch/sh/kernel/setup.cdiff --a/arch/sh/kernel/setup.cb/arch/sh/kernel/setup.carch/sh/kernel/setup.c +2
-2@@ -244,7 +244,7 @@ void __init __weak plat_early_device_set { } -#ifdef CONFIG_OF_FLATTREE +#ifdef CONFIG_OF_EARLY_FLATTREE void __ref sh_fdt_init (phys_addr_t dt_phys) {static int done =0 ;@@ -326,7 +326,7 @@ void __init setup_arch(char **cmdline_p)/* Let earlyprintk output early console messages */ sh_early_platform_driver_probe ("earlyprintk" ,1 ,1 ); -#ifdef CONFIG_OF_FLATTREE +#ifdef CONFIG_OF_EARLY_FLATTREE #ifdef CONFIG_USE_BUILTIN_DTB unflatten_and_copy_device_tree ();#else diff --
a/arch/sh/kernel/head_32.Sb/arch/sh/kernel/head_32.Sarch/sh/kernel/head_32.S +2
-2@@ -64,7 +64,7 @@ ENTRY(_stext) ldc r0, r6_bank #endif -#ifdef CONFIG_OF_FLATTREE +#ifdef CONFIG_OF_EARLY_FLATTREE mov r4, r12 ! Store device tree blob pointer in r12 #endif@@ -315,7 +315,7 @@ ENTRY(_stext) 10: #endif -#ifdef CONFIG_OF_FLATTREE +#ifdef CONFIG_OF_EARLY_FLATTREE mov.l 8f, r0 ! Make flat device tree available early. jsr @r0 mov r12, r4
arch/sh/kernel/head_32.S ENTRY(stack_start) · line 352
Quoted 8 lines
arch/sh/kernel/head_32.S +1
-1@@ -346,7 +346,7 @@ ENTRY(stack_start) 5: .long start_kernel 6: .long cpu_init 7: .long init_thread_union -#if defined(CONFIG_OF_FLATTREE) +#if defined(CONFIG_OF_EARLY_FLATTREE) 8: .long sh_fdt_init #endif
Signature · 4 lines
.''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Randy Dunlap
reviewerPATCH v4 4/7 sh: math-emu: fix macro redefined warning
In reply to Randy DunlapFix a warning that was reported by the kernel test robot:
In file included from ../include/math-emu/soft-fp.h:27,
from ../arch/sh/math-emu/math.c:22:
../arch/sh/include/asm/sfp-machine.h:17: warning: "__BYTE_ORDER" redefined
17 | #define __BYTE_ORDER __BIG_ENDIAN
In file included from ../arch/sh/math-emu/math.c:21:../arch/sh/math-emu/sfp-util.h:71: note: this is the location of the previous definition
71 | #define __BYTE_ORDER __LITTLE_ENDIAN
---
v2: add Reviewed-by Geert,
rebase to linux-next-20211115
v3: skipped
v4: refresh & resend
arch/sh/math-emu/sfp-util.h | 4 ---- 1 file changed, 4 deletions(-)
arch/sh/math-emu/sfp-util.h +0 -4
@@ -67,7 +67,3 @@ } while (0)#define abort () return 0 - -#define __BYTE_ORDER __LITTLE_ENDIAN - -
Re: [PATCH 4/7 v4] sh: math-emu: fix macro redefined warning
Quoted 33 lines · Randy Dunlap
Fix a warning that was reported by the kernel test robot:
In file included from
../include/math-emu/soft-fp.h:27,from ../arch/sh/math-emu/math.c:22:
../arch/sh/include/asm/sfp-machine.h:17: warning: "__BYTE_ORDER" redefined
17 | #define__BYTE_ORDER__BIG_ENDIAN
In file included from../arch/sh/math-emu/math.c:21:../arch/sh/math-emu/sfp-util.h:71: note: this is the location of the previous definition
71 | #define__BYTE_ORDER__LITTLE_ENDIANFixes b929926f01f2 ("sh: define __BIG_ENDIAN for math-emu")Signed-off-by Randy Dunlap <[email protected]>Reported-by kernel test robot <[email protected]>Link lore.kernel.org/r/[email protected]Cc John Paul Adrian Glaubitz <[email protected]>Cc Yoshinori Sato <[email protected]>Cc Rich Felker <[email protected]>Reviewed-by Geert Uytterhoeven <[email protected]>---
v2: add Reviewed-by Geert,rebase to linux-next-20211115v3: skipped
v4: refresh & resendarch/sh/math-emu/sfp-util.h | 4 ---- 1 file changed, 4 deletions(-)diff --
a/arch/sh/math-emu/sfp-util.hb/arch/sh/math-emu/sfp-util.h
arch/sh/math-emu/sfp-util.h line 73
Quoted 7 lines
arch/sh/math-emu/sfp-util.h +0
-4@@ -67,7 +67,3 @@ } while (0)#define abort () return 0 - -#define __BYTE_ORDER __LITTLE_ENDIAN - -
Signature · 4 lines
.''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Randy Dunlap
reviewerPATCH v4 5/7 sh: remove sh5/sh64 last fragments
In reply to Randy DunlapA previous patch removed most of the sh5 (sh64) support from the kernel tree. Now remove the last stragglers.
---
v2: update after adding the parisc64 alias to kbuild.rst
v3: skipped
v4: refresh & resend
Documentation/kbuild/kbuild.rst | 1 - Documentation/scheduler/sched-arch.rst | 2 -- Documentation/translations/zh_CN/scheduler/sched-arch.rst | 2 -- scripts/checkstack.pl | 7 ------- tools/perf/arch/common.c | 2 -- tools/scripts/Makefile.arch | 5 ----- tools/testing/selftests/mm/Makefile | 2 +- tools/testing/selftests/mm/run_vmtests.sh | 2 +- 8 files changed, 2 insertions(+), 21 deletions(-)
Documentation/kbuild/kbuild.rst +0 -1
@@ -161,7 +161,6 @@ But some architectures such as x86 and s - x86: i386 for 32 bit, x86_64 for 64 bit - parisc: parisc64 for 64 bit -- sh: sh for 32 bit, sh64 for 64 bit - sparc: sparc32 for 32 bit, sparc64 for 64 bit CROSS_COMPILE
Documentation/scheduler/sched-arch.rst +0 -2
@@ -70,7 +70,5 @@ Possible arch problems I found (and eith ia64 - is safe_halt call racy vs interrupts? (does it sleep?) (See #4a) -sh64 - Is sleeping racy vs interrupts? (See #4a) - sparc - IRQs on at this point(?), change local_irq_save to _disable. - TODO: needs secondary CPUs to disable preempt (See #1)
Documentation/translations/zh_CN/scheduler/sched-arch.rst +0 -2
@@ -70,7 +70,5 @@ 我发现的可能的arch问题(并试 ia64 - safe_halt的调用与中断相比,是否很荒谬? (它睡眠了吗) (参考 #4a) -sh64 - 睡眠与中断相比,是否很荒谬? (参考 #4a) - sparc - 在这一点上,IRQ是开着的(?),把local_irq_save改为_disable。 - 待办事项: 需要第二个CPU来禁用抢占 (参考 #1)
scripts/checkstack.pl +0 -7
@@ -10,7 +10,6 @@ # Mips port by Juan Quintela <[email protected]> # IA64 port via Andreas Dilger # Arm port by Holger Schurig -# sh64 port by Paul Mundt # Random bits by Matt Mackall <[email protected]> # M68k port by Geert Uytterhoeven and Andreas Schwab # AArch64, PARISC ports by Kyle McMartin
@@ -100,12 +99,6 @@ my (@stack, $re, $dre, $sub, $x, $xs, $f # 100092: e3 f0 ff c8 ff 71 lay %r15,-56(%r15) $re = qr/.*(?:lay|ag?hi).*\%r15,-(([0-9]{2}|[3-9])[0-9]{2}) (?:\(\%r15\))?$/ox; - } elsif ($arch =~ /^sh64$/) { - #XXX: we only check for the immediate case presently, - # though we will want to check for the movi/sub - # pair for larger users. -- PFM. - #a00048e0: d4fc40f0 addi.l r15,-240,r15 - $re = qr/.*addi\.l.*r15,-(([0-9]{2}|[3-9])[0-9]{2}),r15/o; } elsif ($arch eq 'sparc' || $arch eq 'sparc64') { # f0019d10: 9d e3 bf 90 save %sp, -112, %sp $re = qr/.*save.*%sp, -(([0-9]{2}|[3-9])[0-9]{2}), %sp/o;
tools/perf/arch/common.c +0 -2
@@ -51,9 +51,7 @@ const char *const s390_triplets[] = {const char *const sh_triplets[] = {"sh-unknown-linux-gnu-" , -"sh64-unknown-linux-gnu-" ,"sh-linux-gnu-" , -"sh64-linux-gnu-" ,NULL };
tools/scripts/Makefile.arch +0 -5
@@ -29,11 +29,6 @@ ifeq ($(ARCH),sparc64) SRCARCH := sparc endif -# Additional ARCH settings for sh -ifeq ($(ARCH),sh64) - SRCARCH := sh -endif - # Additional ARCH settings for loongarch ifeq ($(ARCH),loongarch32) SRCARCH := loongarch
tools/testing/selftests/mm/Makefile +1 -1
@@ -90,7 +90,7 @@ endif endif -ifneq (,$(filter $(MACHINE),arm64 ia64 mips64 parisc64 ppc64 riscv64 s390x sh64 sparc64 x86_64)) +ifneq (,$(filter $(MACHINE),arm64 ia64 mips64 parisc64 ppc64 riscv64 s390x sparc64 x86_64)) TEST_GEN_FILES += va_128TBswitch TEST_GEN_FILES += virtual_address_range TEST_GEN_FILES += write_to_hugetlbfs
tools/testing/selftests/mm/run_vmtests.sh +1 -1
@@ -132,7 +132,7 @@ else fi # filter 64bit architectures -ARCH64STR="arm64 ia64 mips64 parisc64 ppc64 ppc64le riscv64 s390x sh64 sparc64 x86_64" +ARCH64STR="arm64 ia64 mips64 parisc64 ppc64 ppc64le riscv64 s390x sparc64 x86_64" if [ -z "$ARCH" ]; then ARCH=$(uname -m 2>/dev/null | sed -e 's/aarch64.*/arm64/') fi
John Paul Adrian Glaubitz
maintainerRe: [PATCH 5/7 v4] sh: remove sh5/sh64 last fragments
Hi Randy!
Quoted 31 lines · Randy Dunlap
A previous patch removed most of the sh5 (sh64) support from the kernel tree. Now remove the last stragglers.
Fixes 37744feebc08 ("sh: remove sh5 support")Signed-off-by Randy Dunlap <[email protected]>Cc Geert Uytterhoeven <[email protected]>Cc Arnd Bergmann <[email protected]>Cc Rich Felker <[email protected]>Cc Yoshinori Sato <[email protected]>Cc John Paul Adrian Glaubitz <[email protected]>---
v2: update after adding the parisc64 alias tokbuild.rst
v3: skipped
v4: refresh & resendDocumentation/kbuild/kbuild.rst | 1 - Documentation/scheduler/sched-arch.rst | 2 -- Documentation/translations/zh_CN/scheduler/sched-arch.rst | 2 -- scripts/checkstack.pl | 7 ------- tools/perf/arch/common.c | 2 -- tools/scripts/Makefile.arch | 5 ----- tools/testing/selftests/mm/Makefile | 2 +- tools/testing/selftests/mm/run_vmtests.sh | 2 +- 8 files changed, 2 insertions(+), 21 deletions(-)diff --
a/Documentation/kbuild/kbuild.rstb/Documentation/kbuild/kbuild.rst
Documentation/kbuild/kbuild.rst But some architectures such as x86 and s · line 166
Quoted 7 lines
Documentation/kbuild/kbuild.rst +0
-1@@ -161,7 +161,6 @@ But some architectures such as x86 and s - x86: i386 for 32 bit, x86_64 for 64 bit - parisc: parisc64 for 64 bit -- sh: sh for 32 bit, sh64 for 64 bit - sparc: sparc32 for 32 bit, sparc64 for 64 bit CROSS_COMPILE
This hunk doesn't apply anymore since the parisc part has been dropped although I can't find the commit for that. Could you rebase your patch, please?
Apologies that I didn't have the time earlier to start looking at this series!
Adrian
Signature · 4 lines
.''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Randy Dunlap
reviewerRe: [PATCH 5/7 v4] sh: remove sh5/sh64 last fragments
Hi--
Quoted 40 lines · John Paul Adrian Glaubitz
Hi Randy!
Quoted 37 lines · Randy Dunlap
A previous patch removed most of the sh5 (sh64) support from the kernel tree. Now remove the last stragglers.
Fixes 37744feebc08 ("sh: remove sh5 support")Signed-off-by Randy Dunlap <[email protected]>Cc Geert Uytterhoeven <[email protected]>Cc Arnd Bergmann <[email protected]>Cc Rich Felker <[email protected]>Cc Yoshinori Sato <[email protected]>Cc John Paul Adrian Glaubitz <[email protected]>---
v2: update after adding the parisc64 alias tokbuild.rst
v3: skipped
v4: refresh & resendDocumentation/kbuild/kbuild.rst | 1 - Documentation/scheduler/sched-arch.rst | 2 -- Documentation/translations/zh_CN/scheduler/sched-arch.rst | 2 -- scripts/checkstack.pl | 7 ------- tools/perf/arch/common.c | 2 -- tools/scripts/Makefile.arch | 5 ----- tools/testing/selftests/mm/Makefile | 2 +- tools/testing/selftests/mm/run_vmtests.sh | 2 +- 8 files changed, 2 insertions(+), 21 deletions(-)diff --
a/Documentation/kbuild/kbuild.rstb/Documentation/kbuild/kbuild.rstDocumentation/kbuild/kbuild.rst +0
-1@@ -161,7 +161,6 @@ But some architectures such as x86 and s - x86: i386 for 32 bit, x86_64 for 64 bit - parisc: parisc64 for 64 bit -- sh: sh for 32 bit, sh64 for 64 bit - sparc: sparc32 for 32 bit, sparc64 for 64 bit
Quoted 4 lines
Documentation/kbuild/kbuild.rst But some architectures such as x86 and s · line 166
Quoted 1 line
Documentation/kbuild/kbuild.rst +0
-0CROSS_COMPILEThis hunk doesn't apply anymore since the parisc part has been dropped although I can't find the commit for that. Could you rebase your patch, please?
The parisc part has not been dropped. It's in linux-next but not yet in mainline. (commit 49deed336ef9a)
Do you want this patch to apply to mainline? (I created it in linux-next.) I can do that in a few hours. I'm busy ATM.
I suppose there will be a merge conflict between parisc and SH.
Quoted 1 line
Apologies that I didn't have the time earlier to start looking at this series!
No problem. We'll get there. Thanks.
Signature · 1 line
~Randy
John Paul Adrian Glaubitz
maintainerRe: [PATCH 5/7 v4] sh: remove sh5/sh64 last fragments
Quoted 52 lines · Randy Dunlap
Hi--
Quoted 41 lines · John Paul Adrian Glaubitz
Hi Randy!
Quoted 38 lines · Randy Dunlap
A previous patch removed most of the sh5 (sh64) support from the kernel tree. Now remove the last stragglers.
Fixes 37744feebc08 ("sh: remove sh5 support")Signed-off-by Randy Dunlap <[email protected]>Cc Geert Uytterhoeven <[email protected]>Cc Arnd Bergmann <[email protected]>Cc Rich Felker <[email protected]>Cc Yoshinori Sato <[email protected]>Cc John Paul Adrian Glaubitz <[email protected]>---
v2: update after adding the parisc64 alias tokbuild.rst
v3: skipped
v4: refresh & resendDocumentation/kbuild/kbuild.rst | 1 - Documentation/scheduler/sched-arch.rst | 2 -- Documentation/translations/zh_CN/scheduler/sched-arch.rst | 2 -- scripts/checkstack.pl | 7 ------- tools/perf/arch/common.c | 2 -- tools/scripts/Makefile.arch | 5 ----- tools/testing/selftests/mm/Makefile | 2 +- tools/testing/selftests/mm/run_vmtests.sh | 2 +- 8 files changed, 2 insertions(+), 21 deletions(-)diff --
a/Documentation/kbuild/kbuild.rstb/Documentation/kbuild/kbuild.rstDocumentation/kbuild/kbuild.rst +0
-4@@ -161,7 +161,6 @@ But some architectures such as x86 and s - x86: i386 for 32 bit, x86_64 for 64 bit - parisc: parisc64 for 64 bit -- sh: sh for 32 bit, sh64 for 64 bit - sparc: sparc32 for 32 bit, sparc64 for 64 bitQuoted 4 lines
Quoted 1 line
CROSS_COMPILEThis hunk doesn't apply anymore since the parisc part has been dropped although I can't find the commit for that. Could you rebase your patch, please?
Quoted 7 lines
The parisc part has not been dropped. It's in linux-next but not yet in mainline. (commit
49deed336ef9a)Do you want this patch to apply to mainline? (I created it in linux-next.) I can do that in a few hours. I'm busy ATM.
I suppose there will be a merge conflict between parisc and SH.
Oops, sorry. My bad. I will use the proper tree.
Adrian
Randy Dunlap
reviewerRe: [PATCH 5/7 v4] sh: remove sh5/sh64 last fragments
Quoted 55 lines · John Paul Adrian Glaubitz
Quoted 55 lines · Randy Dunlap
Hi--
Quoted 41 lines · John Paul Adrian Glaubitz
Hi Randy!
Quoted 38 lines · Randy Dunlap
A previous patch removed most of the sh5 (sh64) support from the kernel tree. Now remove the last stragglers.
Fixes 37744feebc08 ("sh: remove sh5 support")Signed-off-by Randy Dunlap <[email protected]>Cc Geert Uytterhoeven <[email protected]>Cc Arnd Bergmann <[email protected]>Cc Rich Felker <[email protected]>Cc Yoshinori Sato <[email protected]>Cc John Paul Adrian Glaubitz <[email protected]>---
v2: update after adding the parisc64 alias tokbuild.rst
v3: skipped
v4: refresh & resendDocumentation/kbuild/kbuild.rst | 1 - Documentation/scheduler/sched-arch.rst | 2 -- Documentation/translations/zh_CN/scheduler/sched-arch.rst | 2 -- scripts/checkstack.pl | 7 ------- tools/perf/arch/common.c | 2 -- tools/scripts/Makefile.arch | 5 ----- tools/testing/selftests/mm/Makefile | 2 +- tools/testing/selftests/mm/run_vmtests.sh | 2 +- 8 files changed, 2 insertions(+), 21 deletions(-)diff --
a/Documentation/kbuild/kbuild.rstb/Documentation/kbuild/kbuild.rstDocumentation/kbuild/kbuild.rst +0
-4@@ -161,7 +161,6 @@ But some architectures such as x86 and s - x86: i386 for 32 bit, x86_64 for 64 bit - parisc: parisc64 for 64 bit -- sh: sh for 32 bit, sh64 for 64 bit - sparc: sparc32 for 32 bit, sparc64 for 64 bitQuoted 4 lines
Quoted 1 line
CROSS_COMPILEThis hunk doesn't apply anymore since the parisc part has been dropped although I can't find the commit for that. Could you rebase your patch, please?
The parisc part has not been dropped. It's in linux-next but not yet in mainline. (commit
49deed336ef9a)
Quoted 6 lines
Quoted 4 lines
Do you want this patch to apply to mainline? (I created it in linux-next.) I can do that in a few hours. I'm busy ATM.
I suppose there will be a merge conflict between parisc and SH.
Oops, sorry. My bad. I will use the proper tree.
Just let me know if you want me to resend it.
Thanks.
Signature · 1 line
~Randy
John Paul Adrian Glaubitz
maintainerRe: [PATCH 5/7 v4] sh: remove sh5/sh64 last fragments
Hi Randy!
Quoted 4 lines · Randy Dunlap
Quoted 1 line
Oops, sorry. My bad. I will use the proper tree.
Just let me know if you want me to resend it.
Thanks.
No, that's fine. I will rebase my for-next tree.
Adrian
Signature · 4 lines
.''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Re: [PATCH 5/7 v4] sh: remove sh5/sh64 last fragments
Hi Adrian,
Quoted 7 lines · John Paul Adrian Glaubitz
Quoted 4 lines · Randy Dunlap
Quoted 1 line
Oops, sorry. My bad. I will use the proper tree.
Just let me know if you want me to resend it.
Thanks.No, that's fine. I will rebase my for-next tree.
Rebase on top of what? Commit 49deed336ef9a409 ("parisc:
update kbuild doc. aliases for parisc64") is in the parisc tree. You must not base the SH tree on the parisc tree.
Don't care about the simple conflict, Stephen and Linus can handle that fine.
FTR, if the conflict was more complex, an immutable branch to be merged by all parties would be appropriate. But that's overkill and thus not needed for simple conflicts like this.
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
John Paul Adrian Glaubitz
maintainerRe: [PATCH 5/7 v4] sh: remove sh5/sh64 last fragments
Hi Geert!
Quoted 7 lines · Geert Uytterhoeven
Hi Adrian,
Quoted 3 lines · John Paul Adrian Glaubitz
Quoted 2 lines · Randy Dunlap
Quoted 1 line
Oops, sorry. My bad. I will use the proper tree.
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Just let me know if you want me to resend it.
Thanks.No, that's fine. I will rebase my for-next tree.
Rebase on top of what? Commit
49deed336ef9a409("parisc:
update kbuild doc. aliases for parisc64") is in the parisc tree. You must not base the SH tree on the parisc tree.
Oh, I wasn't aware of that.
Quoted 6 lines
Don't care about the simple conflict, Stephen and Linus can handle that fine.
FTR, if the conflict was more complex, an immutable branch to be merged by all parties would be appropriate. But that's overkill and thus not needed for simple conflicts like this.
I'll resolve the conflict manually then. Thanks.
Adrian
Signature · 4 lines
.''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Re: [PATCH 5/7 v4] sh: remove sh5/sh64 last fragments
In reply to Randy DunlapQuoted 128 lines · Randy Dunlap
A previous patch removed most of the sh5 (sh64) support from the kernel tree. Now remove the last stragglers.
Fixes 37744feebc08 ("sh: remove sh5 support")Signed-off-by Randy Dunlap <[email protected]>Cc Geert Uytterhoeven <[email protected]>Cc Arnd Bergmann <[email protected]>Cc Rich Felker <[email protected]>Cc Yoshinori Sato <[email protected]>Cc John Paul Adrian Glaubitz <[email protected]>---
v2: update after adding the parisc64 alias tokbuild.rst
v3: skipped
v4: refresh & resendDocumentation/kbuild/kbuild.rst | 1 - Documentation/scheduler/sched-arch.rst | 2 -- Documentation/translations/zh_CN/scheduler/sched-arch.rst | 2 -- scripts/checkstack.pl | 7 ------- tools/perf/arch/common.c | 2 -- tools/scripts/Makefile.arch | 5 ----- tools/testing/selftests/mm/Makefile | 2 +- tools/testing/selftests/mm/run_vmtests.sh | 2 +- 8 files changed, 2 insertions(+), 21 deletions(-)diff --
a/Documentation/kbuild/kbuild.rstb/Documentation/kbuild/kbuild.rstDocumentation/kbuild/kbuild.rst +0
-1@@ -161,7 +161,6 @@ But some architectures such as x86 and s - x86: i386 for 32 bit, x86_64 for 64 bit - parisc: parisc64 for 64 bit -- sh: sh for 32 bit, sh64 for 64 bit - sparc: sparc32 for 32 bit, sparc64 for 64 bit CROSS_COMPILEdiff --
a/Documentation/scheduler/sched-arch.rstb/Documentation/scheduler/sched-arch.rstDocumentation/scheduler/sched-arch.rst +0
-2@@ -70,7 +70,5 @@ Possible arch problems I found (and eith ia64 - is safe_halt call racy vs interrupts? (does it sleep?) (See #4a) -sh64 - Is sleeping racy vs interrupts? (See #4a) - sparc - IRQs on at this point(?), change local_irq_save to _disable. - TODO: needs secondary CPUs to disable preempt (See #1)diff --
a/Documentation/translations/zh_CN/scheduler/sched-arch.rstb/Documentation/translations/zh_CN/scheduler/sched-arch.rstDocumentation/translations/zh_CN/scheduler/sched-arch.rst +0
-2@@ -70,7 +70,5 @@ 我发现的可能的arch问题(并试 ia64 - safe_halt的调用与中断相比,是否很荒谬? (它睡眠了吗) (参考 #4a) -sh64 - 睡眠与中断相比,是否很荒谬? (参考 #4a) - sparc - 在这一点上,IRQ是开着的(?),把local_irq_save改为_disable。 - 待办事项: 需要第二个CPU来禁用抢占 (参考 #1)diff --
a/scripts/checkstack.plb/scripts/checkstack.plscripts/checkstack.pl +0
-7@@ -10,7 +10,6 @@ # Mips port by Juan Quintela <[email protected]> # IA64 port via Andreas Dilger # Arm port by Holger Schurig -# sh64 port by Paul Mundt # Random bits by Matt Mackall <[email protected]> # M68k port by Geert Uytterhoeven and Andreas Schwab # AArch64, PARISC ports by Kyle McMartin@@ -100,12 +99,6 @@ my (@stack, $re, $dre, $sub, $x, $xs, $f # 100092: e3 f0 ff c8 ff 71 lay %r15,-56(%r15) $re = qr/.*(?:lay|ag?hi).*\%r15,-(([0-9]{2}|[3-9])[0-9]{2}) (?:\(\%r15\))?$/ox; - } elsif ($arch =~ /^sh64$/) { - #XXX: we only check for the immediate case presently, - # though we will want to check for the movi/sub - # pair for larger users. -- PFM. - #a00048e0: d4fc40f0 addi.l r15,-240,r15 - $re = qr/.*addi\.l.*r15,-(([0-9]{2}|[3-9])[0-9]{2}),r15/o; } elsif ($arch eq 'sparc' || $arch eq 'sparc64') { # f0019d10: 9d e3 bf 90 save %sp, -112, %sp $re = qr/.*save.*%sp, -(([0-9]{2}|[3-9])[0-9]{2}), %sp/o;diff --
a/tools/perf/arch/common.cb/tools/perf/arch/common.ctools/perf/arch/common.c +0
-2@@ -51,9 +51,7 @@ const char *const s390_triplets[] = {const char *const sh_triplets[] = {"sh-unknown-linux-gnu-" , -"sh64-unknown-linux-gnu-" ,"sh-linux-gnu-" , -"sh64-linux-gnu-" ,NULL };diff -- a/tools/scripts/Makefile.arch b/tools/scripts/Makefile.arch
tools/scripts/Makefile.arch +0
-5@@ -29,11 +29,6 @@ ifeq ($(ARCH),sparc64) SRCARCH := sparc endif -# Additional ARCH settings for sh -ifeq ($(ARCH),sh64) - SRCARCH := sh -endif - # Additional ARCH settings for loongarch ifeq ($(ARCH),loongarch32) SRCARCH := loongarchdiff -- a/tools/testing/selftests/mm/Makefile b/tools/testing/selftests/mm/Makefile
tools/testing/selftests/mm/Makefile +1
-1@@ -90,7 +90,7 @@ endif endif -ifneq (,$(filter $(MACHINE),arm64 ia64 mips64 parisc64 ppc64 riscv64 s390x sh64 sparc64 x86_64)) +ifneq (,$(filter $(MACHINE),arm64 ia64 mips64 parisc64 ppc64 riscv64 s390x sparc64 x86_64)) TEST_GEN_FILES += va_128TBswitch TEST_GEN_FILES += virtual_address_range TEST_GEN_FILES += write_to_hugetlbfsdiff --
a/tools/testing/selftests/mm/run_vmtests.shb/tools/testing/selftests/mm/run_vmtests.sh
tools/testing/selftests/mm/run_vmtests.sh else · line 138
Quoted 8 lines
tools/testing/selftests/mm/run_vmtests.sh +1
-1@@ -132,7 +132,7 @@ else fi # filter 64bit architectures -ARCH64STR="arm64 ia64 mips64 parisc64 ppc64 ppc64le riscv64 s390x sh64 sparc64 x86_64" +ARCH64STR="arm64 ia64 mips64 parisc64 ppc64 ppc64le riscv64 s390x sparc64 x86_64" if [ -z "$ARCH" ]; then ARCH=$(uname -m 2>/dev/null | sed -e 's/aarch64.*/arm64/') fi
Signature · 4 lines
.''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Randy Dunlap
reviewerPATCH v4 6/7 sh: fix Kconfig entry for NUMA => SMP
In reply to Randy DunlapFix SUPERH builds that select SYS_SUPPORTS_NUMA but do not select SYS_SUPPORTS_SMP and SMP.
kernel/sched/topology.c is only built for CONFIG_SMP and then the NUMA code + data inside topology.c is only built when CONFIG_NUMA is set/enabled, so these arch/sh/ configs need to select SMP and SYS_SUPPORTS_SMP to build the NUMA support.
Fixes this build error in multiple SUPERH configs:
mm/page_alloc.o: In function `get_page_from_freelist':
page_alloc.c:(.text+0x2ca8): undefined reference to `node_reclaim_distance'
---
v2: skipped
v3: skipped
v4: refresh & resend
arch/sh/Kconfig | 4 ++++ 1 file changed, 4 insertions(+)
arch/sh/Kconfig +4 -0
@@ -477,6 +477,8 @@ config CPU_SUBTYPE_SH7722 select CPU_SHX2 select ARCH_SHMOBILE select ARCH_SPARSEMEM_ENABLE + select SYS_SUPPORTS_SMP + select SMP select SYS_SUPPORTS_NUMA select SYS_SUPPORTS_SH_CMT select PINCTRL
@@ -487,6 +489,8 @@ config CPU_SUBTYPE_SH7366 select CPU_SHX2 select ARCH_SHMOBILE select ARCH_SPARSEMEM_ENABLE + select SYS_SUPPORTS_SMP + select SMP select SYS_SUPPORTS_NUMA select SYS_SUPPORTS_SH_CMT
John Paul Adrian Glaubitz
maintainerRe: [PATCH 6/7 v4] sh: fix Kconfig entry for NUMA => SMP
Quoted 43 lines · Randy Dunlap
Fix SUPERH builds that select
SYS_SUPPORTS_NUMAbut do not selectSYS_SUPPORTS_SMPand SMP.
kernel/sched/topology.cis only built forCONFIG_SMPand then the NUMA code + data insidetopology.cis only built whenCONFIG_NUMAis set/enabled, so thesearch/sh/configs need to select SMP andSYS_SUPPORTS_SMPto build the NUMA support.Fixes this build error in multiple SUPERH configs:
mm/page_alloc.o: In function `get_page_from_freelist':
page_alloc.c:(.text+0x2ca8): undefined reference to `node_reclaim_distance'Fixes 357d59469c11 ("sh: Tidy up dependencies for SH-2 build.")Fixes 9109a30e5a54 ("sh: add support for sh7366 processor")Signed-off-by Randy Dunlap <[email protected]>Reported-by Geert Uytterhoeven <[email protected]>Cc John Paul Adrian Glaubitz <[email protected]>Cc Yoshinori Sato <[email protected]>Cc Rich Felker <[email protected]>---
v2: skipped
v3: skipped
v4: refresh & resendarch/sh/Kconfig | 4 ++++ 1 file changed, 4 insertions(+)diff -- a/arch/sh/Kconfig b/arch/sh/Kconfig
arch/sh/Kconfig +2
-0@@ -477,6 +477,8 @@ config CPU_SUBTYPE_SH7722 select CPU_SHX2 select ARCH_SHMOBILE select ARCH_SPARSEMEM_ENABLE + select SYS_SUPPORTS_SMP + select SMP select SYS_SUPPORTS_NUMA select SYS_SUPPORTS_SH_CMT select PINCTRL
arch/sh/Kconfig config CPU_SUBTYPE_SH7366 · line 496
Quoted 8 lines
arch/sh/Kconfig +2
-0@@ -487,6 +489,8 @@ config CPU_SUBTYPE_SH7366 select CPU_SHX2 select ARCH_SHMOBILE select ARCH_SPARSEMEM_ENABLE + select SYS_SUPPORTS_SMP + select SMP select SYS_SUPPORTS_NUMA select SYS_SUPPORTS_SH_CMT
It seems that we need this change for these configurations as well:
- config CPU_SHX3
- config CPU_SUBTYPE_SH7785
Although I can trigger a build failure for CPU_SUBTYPE_SH7785 only when setting CONFIG_NUMA=y:
CC net/ipv6/addrconf_core.omm/slab.c: In function 'slab_memory_callback':mm/slab.c:1127:23: error: implicit declaration of function 'init_cache_node_node'; did you mean 'drain_cache_node_node'? [-Werror=implicit-function-declaration]
1127 | ret = init_cache_node_node(nid);
| ^~~~~~~~~~~~~~~~~~~~
| drain_cache_node_nodeI would expect this error to be reproducible for CPU_SHX3 as well when CONFIG_NUMA=y but CONFIG_SMP=n. But for some reason, I am not seeing the error then.
Adrian
Signature · 4 lines
.''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
John Paul Adrian Glaubitz
maintainerRe: [PATCH 6/7 v4] sh: fix Kconfig entry for NUMA => SMP
Hi Randy!
Quoted 64 lines · John Paul Adrian Glaubitz
Quoted 43 lines · Randy Dunlap
Fix SUPERH builds that select
SYS_SUPPORTS_NUMAbut do not selectSYS_SUPPORTS_SMPand SMP.
kernel/sched/topology.cis only built forCONFIG_SMPand then the NUMA code + data insidetopology.cis only built whenCONFIG_NUMAis set/enabled, so thesearch/sh/configs need to select SMP andSYS_SUPPORTS_SMPto build the NUMA support.Fixes this build error in multiple SUPERH configs:
mm/page_alloc.o: In function `get_page_from_freelist':
page_alloc.c:(.text+0x2ca8): undefined reference to `node_reclaim_distance'Fixes 357d59469c11 ("sh: Tidy up dependencies for SH-2 build.")Fixes 9109a30e5a54 ("sh: add support for sh7366 processor")Signed-off-by Randy Dunlap <[email protected]>Reported-by Geert Uytterhoeven <[email protected]>Cc John Paul Adrian Glaubitz <[email protected]>Cc Yoshinori Sato <[email protected]>Cc Rich Felker <[email protected]>---
v2: skipped
v3: skipped
v4: refresh & resendarch/sh/Kconfig | 4 ++++ 1 file changed, 4 insertions(+)diff -- a/arch/sh/Kconfig b/arch/sh/Kconfig
arch/sh/Kconfig +2
-0@@ -477,6 +477,8 @@ config CPU_SUBTYPE_SH7722 select CPU_SHX2 select ARCH_SHMOBILE select ARCH_SPARSEMEM_ENABLE + select SYS_SUPPORTS_SMP + select SMP select SYS_SUPPORTS_NUMA select SYS_SUPPORTS_SH_CMT select PINCTRLarch/sh/Kconfig config CPU_SUBTYPE_SH7366 · line 496
Quoted 8 lines
arch/sh/Kconfig +2
-0@@ -487,6 +489,8 @@ config CPU_SUBTYPE_SH7366 select CPU_SHX2 select ARCH_SHMOBILE select ARCH_SPARSEMEM_ENABLE + select SYS_SUPPORTS_SMP + select SMP select SYS_SUPPORTS_NUMA select SYS_SUPPORTS_SH_CMTIt seems that we need this change for these configurations as well:
- config
CPU_SHX3
- configCPU_SUBTYPE_SH7785Although I can trigger a build failure for
CPU_SUBTYPE_SH7785only when settingCONFIG_NUMA=y:CC
net/ipv6/addrconf_core.omm/slab.c: In function 'slab_memory_callback':mm/slab.c:1127:23: error: implicit declaration of function 'init_cache_node_node'; did you mean 'drain_cache_node_node'? [-Werror=implicit-function-declaration]
Quoted 7 lines
1127 | ret = init_cache_node_node(nid); | ^~~~~~~~~~~~~~~~~~~~ | drain_cache_node_nodeI would expect this error to be reproducible for
CPU_SHX3as well whenCONFIG_NUMA=ybutCONFIG_SMP=n. But for some reason, I am not seeing the error then.
Can you make this change for config CPU_SUBTYPE_SH7785 as well?
Then the change should be fine.
Adrian
Signature · 4 lines
.''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Randy Dunlap
reviewerRe: [PATCH 6/7 v4] sh: fix Kconfig entry for NUMA => SMP
Quoted 71 lines · John Paul Adrian Glaubitz
Hi Randy!
Quoted 68 lines · John Paul Adrian Glaubitz
Quoted 43 lines · Randy Dunlap
Fix SUPERH builds that select
SYS_SUPPORTS_NUMAbut do not selectSYS_SUPPORTS_SMPand SMP.
kernel/sched/topology.cis only built forCONFIG_SMPand then the NUMA code + data insidetopology.cis only built whenCONFIG_NUMAis set/enabled, so thesearch/sh/configs need to select SMP andSYS_SUPPORTS_SMPto build the NUMA support.Fixes this build error in multiple SUPERH configs:
mm/page_alloc.o: In function `get_page_from_freelist':
page_alloc.c:(.text+0x2ca8): undefined reference to `node_reclaim_distance'Fixes 357d59469c11 ("sh: Tidy up dependencies for SH-2 build.")Fixes 9109a30e5a54 ("sh: add support for sh7366 processor")Signed-off-by Randy Dunlap <[email protected]>Reported-by Geert Uytterhoeven <[email protected]>Cc John Paul Adrian Glaubitz <[email protected]>Cc Yoshinori Sato <[email protected]>Cc Rich Felker <[email protected]>---
v2: skipped
v3: skipped
v4: refresh & resendarch/sh/Kconfig | 4 ++++ 1 file changed, 4 insertions(+)diff -- a/arch/sh/Kconfig b/arch/sh/Kconfig
arch/sh/Kconfig +2
-0@@ -477,6 +477,8 @@ config CPU_SUBTYPE_SH7722 select CPU_SHX2 select ARCH_SHMOBILE select ARCH_SPARSEMEM_ENABLE + select SYS_SUPPORTS_SMP + select SMP select SYS_SUPPORTS_NUMA select SYS_SUPPORTS_SH_CMT select PINCTRLarch/sh/Kconfig config CPU_SUBTYPE_SH7366 · line 496
Quoted 8 lines
arch/sh/Kconfig +2
-0@@ -487,6 +489,8 @@ config CPU_SUBTYPE_SH7366 select CPU_SHX2 select ARCH_SHMOBILE select ARCH_SPARSEMEM_ENABLE + select SYS_SUPPORTS_SMP + select SMP select SYS_SUPPORTS_NUMA select SYS_SUPPORTS_SH_CMTIt seems that we need this change for these configurations as well:
- config
CPU_SHX3
- configCPU_SUBTYPE_SH7785Although I can trigger a build failure for
CPU_SUBTYPE_SH7785only when settingCONFIG_NUMA=y:CC
net/ipv6/addrconf_core.omm/slab.c: In function 'slab_memory_callback':mm/slab.c:1127:23: error: implicit declaration of function 'init_cache_node_node'; did you mean 'drain_cache_node_node'? [-Werror=implicit-function-declaration]1127 | ret = init_cache_node_node(nid); | ^~~~~~~~~~~~~~~~~~~~ | drain_cache_node_node
Quoted 7 lines
Quoted 3 lines
I would expect this error to be reproducible for
CPU_SHX3as well whenCONFIG_NUMA=ybutCONFIG_SMP=n. But for some reason, I am not seeing the error then.Can you make this change for config
CPU_SUBTYPE_SH7785as well?Then the change should be fine.
Will do. Thanks.
Signature · 1 line
~Randy
Randy Dunlap
reviewerPATCH v4 7/7 sh: mcount.S: fix build error when PRINTK is not enabled
In reply to Randy DunlapFix a build error in mcount.S when CONFIG_PRINTK is not enabled. Fixes this build error:
sh2-linux-ld: arch/sh/lib/mcount.o: in function `stack_panic':
(.text+0xec): undefined reference to `dump_stack'
---
v2: add PRINTK to STACK_DEBUG dependency (thanks, Geert)
v3: skipped
v4: refresh & resend
arch/sh/Kconfig.debug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/sh/Kconfig.debug +1 -1
@@ -15,7 +15,7 @@ config SH_STANDARD_BIOS config STACK_DEBUG bool "Check for stack overflows" - depends on DEBUG_KERNEL + depends on DEBUG_KERNEL && PRINTK help This option will cause messages to be printed if free stack space drops below a certain limit. Saying Y here will add overhead to
John Paul Adrian Glaubitz
maintainerRe: [PATCH 7/7 v4] sh: mcount.S: fix build error when PRINTK is not enabled
Quoted 25 lines · Randy Dunlap
Fix a build error in
mcount.SwhenCONFIG_PRINTKis not enabled. Fixes this build error:sh2-linux-ld:
arch/sh/lib/mcount.o: in function `stack_panic':
(.text+0xec): undefined reference to `dump_stack'Fixes e460ab27b6c3 ("sh: Fix up stack overflow check with ftrace disabled.")Signed-off-by Randy Dunlap <[email protected]>Cc John Paul Adrian Glaubitz <[email protected]>Cc Yoshinori Sato <[email protected]>Cc Rich Felker <[email protected]>Suggested-by Geert Uytterhoeven <[email protected]>---
v2: add PRINTK toSTACK_DEBUGdependency (thanks, Geert)
v3: skipped
v4: refresh & resendarch/sh/Kconfig.debug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)diff -- a/arch/sh/Kconfig.debug b/arch/sh/Kconfig.debug
arch/sh/Kconfig.debug config SH_STANDARD_BIOS · line 21
Quoted 8 lines
arch/sh/Kconfig.debug +1
-1@@ -15,7 +15,7 @@ config SH_STANDARD_BIOS config STACK_DEBUG bool "Check for stack overflows" - depends on DEBUG_KERNEL + depends on DEBUG_KERNEL && PRINTK help This option will cause messages to be printed if free stack space drops below a certain limit. Saying Y here will add overhead to
I can't really test this change as the moment I am enabling CONFIG_STACK_DEBUG, the build fails with:
CC scripts/mod/devicetable-offsets.s
sh4-linux-gcc: error: -pg and -fomit-frame-pointer are incompatible make[1]: *** [scripts/Makefile.build:252: scripts/mod/empty.o] Error 1 make[1]: *** Waiting for unfinished jobs....
sh4-linux-gcc: error: -pg and -fomit-frame-pointer are incompatible make[1]: *** [scripts/Makefile.build:114: scripts/mod/devicetable-offsets.s] Error 1
make: *** [Makefile:1286: prepare0] Error 2
So, I assume we need to strip -fomit-frame-pointer from KBUILD_CFLAGS, correct?
I tried this change, but that doesn't fix it for me:
arch/sh/Makefile +1 -0
@@ -173,6 +173,7 @@ KBUILD_AFLAGS += $(cflags-y) ifeq ($(CONFIG_MCOUNT),y) KBUILD_CFLAGS += -pg + KBUILD_CFLAGS := $(subst -fomit-frame-pointer,,$(KBUILD_CFLAGS)) endif ifeq ($(CONFIG_DWARF_UNWINDER),y)
Any ideas?
Adrian
Signature · 4 lines
.''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Re: [PATCH 7/7 v4] sh: mcount.S: fix build error when PRINTK is not enabled
Hi Adrian,
Quoted 63 lines · John Paul Adrian Glaubitz
Quoted 25 lines · Randy Dunlap
Fix a build error in
mcount.SwhenCONFIG_PRINTKis not enabled. Fixes this build error:sh2-linux-ld:
arch/sh/lib/mcount.o: in function `stack_panic':
(.text+0xec): undefined reference to `dump_stack'Fixes e460ab27b6c3 ("sh: Fix up stack overflow check with ftrace disabled.")Signed-off-by Randy Dunlap <[email protected]>Cc John Paul Adrian Glaubitz <[email protected]>Cc Yoshinori Sato <[email protected]>Cc Rich Felker <[email protected]>Suggested-by Geert Uytterhoeven <[email protected]>---
v2: add PRINTK toSTACK_DEBUGdependency (thanks, Geert)
v3: skipped
v4: refresh & resendarch/sh/Kconfig.debug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)diff -- a/arch/sh/Kconfig.debug b/arch/sh/Kconfig.debug
arch/sh/Kconfig.debug config SH_STANDARD_BIOS · line 21
Quoted 8 lines
arch/sh/Kconfig.debug +1
-1@@ -15,7 +15,7 @@ config SH_STANDARD_BIOS config STACK_DEBUG bool "Check for stack overflows" - depends on DEBUG_KERNEL + depends on DEBUG_KERNEL && PRINTK help This option will cause messages to be printed if free stack space drops below a certain limit. Saying Y here will add overhead toI can't really test this change as the moment I am enabling
CONFIG_STACK_DEBUG, the build fails with:CC
scripts/mod/devicetable-offsets.s
sh4-linux-gcc: error: -pg and -fomit-frame-pointer are incompatible make[1]: *** [scripts/Makefile.build:252:scripts/mod/empty.o] Error 1 make[1]: *** Waiting for unfinished jobs....
sh4-linux-gcc: error: -pg and -fomit-frame-pointer are incompatible make[1]: *** [scripts/Makefile.build:114:scripts/mod/devicetable-offsets.s] Error 1
make: *** [Makefile:1286: prepare0] Error 2So, I assume we need to strip -fomit-frame-pointer from
KBUILD_CFLAGS, correct?I tried this change, but that doesn't fix it for me:
arch/sh/Makefile +1
-0@@ -173,6 +173,7 @@ KBUILD_AFLAGS += $(cflags-y) ifeq ($(CONFIG_MCOUNT),y) KBUILD_CFLAGS += -pg + KBUILD_CFLAGS := $(subst -fomit-frame-pointer,,$(KBUILD_CFLAGS)) endif ifeq ($(CONFIG_DWARF_UNWINDER),y)
Quoted 1 line
Any ideas?
Please try with "+=" instead of ":=".
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
John Paul Adrian Glaubitz
maintainerRe: [PATCH 7/7 v4] sh: mcount.S: fix build error when PRINTK is not enabled
Hi Geert!
Quoted 65 lines · Geert Uytterhoeven
Hi Adrian,
Quoted 61 lines · John Paul Adrian Glaubitz
Quoted 25 lines · Randy Dunlap
Fix a build error in
mcount.SwhenCONFIG_PRINTKis not enabled. Fixes this build error:sh2-linux-ld:
arch/sh/lib/mcount.o: in function `stack_panic':
(.text+0xec): undefined reference to `dump_stack'Fixes e460ab27b6c3 ("sh: Fix up stack overflow check with ftrace disabled.")Signed-off-by Randy Dunlap <[email protected]>Cc John Paul Adrian Glaubitz <[email protected]>Cc Yoshinori Sato <[email protected]>Cc Rich Felker <[email protected]>Suggested-by Geert Uytterhoeven <[email protected]>---
v2: add PRINTK toSTACK_DEBUGdependency (thanks, Geert)
v3: skipped
v4: refresh & resendarch/sh/Kconfig.debug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)diff -- a/arch/sh/Kconfig.debug b/arch/sh/Kconfig.debug
arch/sh/Kconfig.debug config SH_STANDARD_BIOS · line 21
Quoted 8 lines
arch/sh/Kconfig.debug +1
-1@@ -15,7 +15,7 @@ config SH_STANDARD_BIOS config STACK_DEBUG bool "Check for stack overflows" - depends on DEBUG_KERNEL + depends on DEBUG_KERNEL && PRINTK help This option will cause messages to be printed if free stack space drops below a certain limit. Saying Y here will add overhead toI can't really test this change as the moment I am enabling
CONFIG_STACK_DEBUG, the build fails with:CC
scripts/mod/devicetable-offsets.s
sh4-linux-gcc: error: -pg and -fomit-frame-pointer are incompatible make[1]: *** [scripts/Makefile.build:252:scripts/mod/empty.o] Error 1 make[1]: *** Waiting for unfinished jobs....
sh4-linux-gcc: error: -pg and -fomit-frame-pointer are incompatible make[1]: *** [scripts/Makefile.build:114:scripts/mod/devicetable-offsets.s] Error 1
make: *** [Makefile:1286: prepare0] Error 2So, I assume we need to strip -fomit-frame-pointer from
KBUILD_CFLAGS, correct?I tried this change, but that doesn't fix it for me:
arch/sh/Makefile +1
-0@@ -173,6 +173,7 @@ KBUILD_AFLAGS += $(cflags-y) ifeq ($(CONFIG_MCOUNT),y) KBUILD_CFLAGS += -pg + KBUILD_CFLAGS := $(subst -fomit-frame-pointer,,$(KBUILD_CFLAGS)) endif
Quoted 5 lines
Quoted 3 lines
arch/sh/Makefile +0
-0ifeq ($(CONFIG_DWARF_UNWINDER),y)Any ideas?
Please try with "+=" instead of ":=".
That doesn't work either. I tried the following, but that didn't strip -fomit-frame-pointer:
arch/sh/Makefile +1 -1
@@ -172,7 +172,7 @@ KBUILD_CPPFLAGS += $(cflags-y) KBUILD_AFLAGS += $(cflags-y) ifeq ($(CONFIG_MCOUNT),y) - KBUILD_CFLAGS += -pg + KBUILD_CFLAGS := $(subst -fomit-frame-pointer,,$(KBUILD_CFLAGS)) -pg endif ifeq ($(CONFIG_DWARF_UNWINDER),y)
I will have to do some more digging tonight.
Adrian
Signature · 4 lines
.''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Re: [PATCH 7/7 v4] sh: mcount.S: fix build error when PRINTK is not enabled
Hi Adrian,
Quoted 64 lines · John Paul Adrian Glaubitz
Quoted 63 lines · Geert Uytterhoeven
Quoted 61 lines · John Paul Adrian Glaubitz
Quoted 25 lines · Randy Dunlap
Fix a build error in
mcount.SwhenCONFIG_PRINTKis not enabled. Fixes this build error:sh2-linux-ld:
arch/sh/lib/mcount.o: in function `stack_panic':
(.text+0xec): undefined reference to `dump_stack'Fixes e460ab27b6c3 ("sh: Fix up stack overflow check with ftrace disabled.")Signed-off-by Randy Dunlap <[email protected]>Cc John Paul Adrian Glaubitz <[email protected]>Cc Yoshinori Sato <[email protected]>Cc Rich Felker <[email protected]>Suggested-by Geert Uytterhoeven <[email protected]>---
v2: add PRINTK toSTACK_DEBUGdependency (thanks, Geert)
v3: skipped
v4: refresh & resendarch/sh/Kconfig.debug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)diff -- a/arch/sh/Kconfig.debug b/arch/sh/Kconfig.debug
arch/sh/Kconfig.debug config SH_STANDARD_BIOS · line 21
Quoted 8 lines
arch/sh/Kconfig.debug +1
-1@@ -15,7 +15,7 @@ config SH_STANDARD_BIOS config STACK_DEBUG bool "Check for stack overflows" - depends on DEBUG_KERNEL + depends on DEBUG_KERNEL && PRINTK help This option will cause messages to be printed if free stack space drops below a certain limit. Saying Y here will add overhead toI can't really test this change as the moment I am enabling
CONFIG_STACK_DEBUG, the build fails with:CC
scripts/mod/devicetable-offsets.s
sh4-linux-gcc: error: -pg and -fomit-frame-pointer are incompatible make[1]: *** [scripts/Makefile.build:252:scripts/mod/empty.o] Error 1 make[1]: *** Waiting for unfinished jobs....
sh4-linux-gcc: error: -pg and -fomit-frame-pointer are incompatible make[1]: *** [scripts/Makefile.build:114:scripts/mod/devicetable-offsets.s] Error 1
make: *** [Makefile:1286: prepare0] Error 2So, I assume we need to strip -fomit-frame-pointer from
KBUILD_CFLAGS, correct?I tried this change, but that doesn't fix it for me:
arch/sh/Makefile +1
-0@@ -173,6 +173,7 @@ KBUILD_AFLAGS += $(cflags-y) ifeq ($(CONFIG_MCOUNT),y) KBUILD_CFLAGS += -pg + KBUILD_CFLAGS := $(subst -fomit-frame-pointer,,$(KBUILD_CFLAGS)) endif
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
arch/sh/Makefile +0
-0ifeq ($(CONFIG_DWARF_UNWINDER),y)Any ideas?
Please try with "+=" instead of ":=".
That doesn't work either. I tried the following, but that didn't strip -fomit-frame-pointer:
Oops, obviously all of that happened before my morning coffee ;-)
Makefile has:
ifdef CONFIG_FRAME_POINTER
KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
KBUILD_RUSTFLAGS += -Cforce-frame-pointers=y
else
# Some targets (ARM with Thumb2, for example), can't be built with frame # pointers. For those, we don't have FUNCTION_TRACER automatically # select FRAME_POINTER. However, FUNCTION_TRACER adds -pg, and this is # incompatible with -fomit-frame-pointer with current GCC, so we don't use # -fomit-frame-pointer with FUNCTION_TRACER.
# In the Rust target specification, "frame-pointer" is set explicitly # to "may-omit".
ifndef CONFIG_FUNCTION_TRACER
KBUILD_CFLAGS += -fomit-frame-pointer
endif
endif
Your config probably has CONFIG_FRAME_POINTER set?
arch/sh/Kconfig.debug=config DWARF_UNWINDER arch/sh/Kconfig.debug- bool "Enable the DWARF unwinder for stacktraces" arch/sh/Kconfig.debug- depends on DEBUG_KERNEL arch/sh/Kconfig.debug: select FRAME_POINTER
You should make sure that cannot happen when CONFIG_FUNCTION_TRACER is enabled. I.e. make DWARF_UNWINDER depend on !FUNCTION_TRACER?
Other architectures do something similar:
arch/sparc/Kconfig.debug:config FRAME_POINTER
arch/sparc/Kconfig.debug- bool
arch/sparc/Kconfig.debug- depends on MCOUNT
arch/x86/Kconfig.debug:config FRAME_POINTER arch/x86/Kconfig.debug- depends on !UNWINDER_ORC && !UNWINDER_GUESS arch/x86/Kconfig.debug- bool
Probably you need to adjust the following, too:
lib/Kconfig.debug:config FRAME_POINTER
lib/Kconfig.debug- bool "Compile the kernel with frame pointers"
lib/Kconfig.debug- depends on DEBUG_KERNEL && (M68K || UML ||
SUPERH) || ARCH_WANT_FRAME_POINTERS
lib/Kconfig.debug- default y if (DEBUG_INFO && UML) ||
ARCH_WANT_FRAME_POINTERS
i.e. drop SUPERH from the list above, and select ARCH_WANT_FRAME_POINTERS if !FUNCTION_TRACER.
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Re: [PATCH 7/7 v4] sh: mcount.S: fix build error when PRINTK is not enabled
CC linux-sh
Quoted 136 lines · Geert Uytterhoeven
Quoted 64 lines · John Paul Adrian Glaubitz
Quoted 63 lines · Geert Uytterhoeven
Quoted 61 lines · John Paul Adrian Glaubitz
Quoted 25 lines · Randy Dunlap
Fix a build error in
mcount.SwhenCONFIG_PRINTKis not enabled. Fixes this build error:sh2-linux-ld:
arch/sh/lib/mcount.o: in function `stack_panic':
(.text+0xec): undefined reference to `dump_stack'Fixes e460ab27b6c3 ("sh: Fix up stack overflow check with ftrace disabled.")Signed-off-by Randy Dunlap <[email protected]>Cc John Paul Adrian Glaubitz <[email protected]>Cc Yoshinori Sato <[email protected]>Cc Rich Felker <[email protected]>Suggested-by Geert Uytterhoeven <[email protected]>---
v2: add PRINTK toSTACK_DEBUGdependency (thanks, Geert)
v3: skipped
v4: refresh & resendarch/sh/Kconfig.debug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)diff -- a/arch/sh/Kconfig.debug b/arch/sh/Kconfig.debug
arch/sh/Kconfig.debug config SH_STANDARD_BIOS · line 21
Quoted 8 lines
arch/sh/Kconfig.debug +1
-1@@ -15,7 +15,7 @@ config SH_STANDARD_BIOS config STACK_DEBUG bool "Check for stack overflows" - depends on DEBUG_KERNEL + depends on DEBUG_KERNEL && PRINTK help This option will cause messages to be printed if free stack space drops below a certain limit. Saying Y here will add overhead toI can't really test this change as the moment I am enabling
CONFIG_STACK_DEBUG, the build fails with:CC
scripts/mod/devicetable-offsets.s
sh4-linux-gcc: error: -pg and -fomit-frame-pointer are incompatible make[1]: *** [scripts/Makefile.build:252:scripts/mod/empty.o] Error 1 make[1]: *** Waiting for unfinished jobs....
sh4-linux-gcc: error: -pg and -fomit-frame-pointer are incompatible make[1]: *** [scripts/Makefile.build:114:scripts/mod/devicetable-offsets.s] Error 1
make: *** [Makefile:1286: prepare0] Error 2So, I assume we need to strip -fomit-frame-pointer from
KBUILD_CFLAGS, correct?I tried this change, but that doesn't fix it for me:
arch/sh/Makefile +1
-0@@ -173,6 +173,7 @@ KBUILD_AFLAGS += $(cflags-y) ifeq ($(CONFIG_MCOUNT),y) KBUILD_CFLAGS += -pg + KBUILD_CFLAGS := $(subst -fomit-frame-pointer,,$(KBUILD_CFLAGS)) endifQuoted 7 lines
Quoted 5 lines
Quoted 3 lines
arch/sh/Makefile +0
-0ifeq ($(CONFIG_DWARF_UNWINDER),y)Any ideas?
Please try with "+=" instead of ":=".
That doesn't work either. I tried the following, but that didn't strip -fomit-frame-pointer:
Oops, obviously all of that happened before my morning coffee ;-)
Makefilehas:ifdef
CONFIG_FRAME_POINTER
KBUILD_CFLAGS+= -fno-omit-frame-pointer -fno-optimize-sibling-calls
KBUILD_RUSTFLAGS+= -Cforce-frame-pointers=y
else
# Some targets (ARM with Thumb2, for example), can't be built with frame # pointers. For those, we don't haveFUNCTION_TRACERautomatically # selectFRAME_POINTER. However,FUNCTION_TRACERadds -pg, and this is # incompatible with -fomit-frame-pointer with current GCC, so we don't use # -fomit-frame-pointer withFUNCTION_TRACER.
# In the Rust target specification, "frame-pointer" is set explicitly # to "may-omit".
ifndefCONFIG_FUNCTION_TRACER
KBUILD_CFLAGS+= -fomit-frame-pointer
endif
endifYour config probably has
CONFIG_FRAME_POINTERset?arch/sh/Kconfig.debug=config
DWARF_UNWINDERarch/sh/Kconfig.debug-bool "Enable the DWARF unwinder for stacktraces"arch/sh/Kconfig.debug-depends onDEBUG_KERNELarch/sh/Kconfig.debug: selectFRAME_POINTERYou should make sure that cannot happen when
CONFIG_FUNCTION_TRACERis enabled. I.e. makeDWARF_UNWINDERdepend on !FUNCTION_TRACER?Other architectures do something similar:
arch/sparc/Kconfig.debug:config
FRAME_POINTER
arch/sparc/Kconfig.debug-bool
arch/sparc/Kconfig.debug-depends on MCOUNTarch/x86/Kconfig.debug:config
FRAME_POINTERarch/x86/Kconfig.debug-depends on !UNWINDER_ORC && !UNWINDER_GUESSarch/x86/Kconfig.debug-boolProbably you need to adjust the following, too:
lib/Kconfig.debug:config
FRAME_POINTER
lib/Kconfig.debug-bool "Compile the kernel with frame pointers"
lib/Kconfig.debug-depends onDEBUG_KERNEL&& (M68K || UML ||
SUPERH) ||ARCH_WANT_FRAME_POINTERSlib/Kconfig.debug- default y if (DEBUG_INFO && UML) ||
ARCH_WANT_FRAME_POINTERSi.e. drop SUPERH from the list above, and select
ARCH_WANT_FRAME_POINTERSif !FUNCTION_TRACER.Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
John Paul Adrian Glaubitz
maintainerRe: [PATCH 7/7 v4] sh: mcount.S: fix build error when PRINTK is not enabled
In reply to Geert UytterhoevenHi Geert!
Quoted 46 lines · Geert Uytterhoeven
Oops, obviously all of that happened before my morning coffee ;-)
Makefilehas:ifdef
CONFIG_FRAME_POINTER
KBUILD_CFLAGS+= -fno-omit-frame-pointer -fno-optimize-sibling-calls
KBUILD_RUSTFLAGS+= -Cforce-frame-pointers=y
else
# Some targets (ARM with Thumb2, for example), can't be built with frame # pointers. For those, we don't haveFUNCTION_TRACERautomatically # selectFRAME_POINTER. However,FUNCTION_TRACERadds -pg, and this is # incompatible with -fomit-frame-pointer with current GCC, so we don't use # -fomit-frame-pointer withFUNCTION_TRACER.
# In the Rust target specification, "frame-pointer" is set explicitly # to "may-omit".
ifndefCONFIG_FUNCTION_TRACER
KBUILD_CFLAGS+= -fomit-frame-pointer
endif
endifYour config probably has
CONFIG_FRAME_POINTERset?arch/sh/Kconfig.debug=config
DWARF_UNWINDERarch/sh/Kconfig.debug-bool "Enable the DWARF unwinder for stacktraces"arch/sh/Kconfig.debug-depends onDEBUG_KERNELarch/sh/Kconfig.debug: selectFRAME_POINTERYou should make sure that cannot happen when
CONFIG_FUNCTION_TRACERis enabled. I.e. makeDWARF_UNWINDERdepend on !FUNCTION_TRACER?Other architectures do something similar:
arch/sparc/Kconfig.debug:config
FRAME_POINTER
arch/sparc/Kconfig.debug-bool
arch/sparc/Kconfig.debug-depends on MCOUNTarch/x86/Kconfig.debug:config
FRAME_POINTERarch/x86/Kconfig.debug-depends on !UNWINDER_ORC && !UNWINDER_GUESSarch/x86/Kconfig.debug-boolProbably you need to adjust the following, too:
lib/Kconfig.debug:config
FRAME_POINTER
lib/Kconfig.debug-bool "Compile the kernel with frame pointers"
lib/Kconfig.debug-depends onDEBUG_KERNEL&& (M68K || UML ||
SUPERH) ||ARCH_WANT_FRAME_POINTERS
Quoted 5 lines
lib/Kconfig.debug- default y if (DEBUG_INFO && UML) ||
ARCH_WANT_FRAME_POINTERSi.e. drop SUPERH from the list above, and select
ARCH_WANT_FRAME_POINTERSif !FUNCTION_TRACER.
Do you think you can send a patch for this change? I can then review and apply it together with Randy's series in case everything works as expected.
Adrian
Signature · 4 lines
.''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
John Paul Adrian Glaubitz
maintainerRe: [PATCH 7/7 v4] sh: mcount.S: fix build error when PRINTK is not enabled
In reply to Geert UytterhoevenHi Geert!
Quoted 122 lines · Geert Uytterhoeven
Hi Adrian,
Quoted 64 lines · John Paul Adrian Glaubitz
Quoted 63 lines · Geert Uytterhoeven
Quoted 61 lines · John Paul Adrian Glaubitz
Quoted 25 lines · Randy Dunlap
Fix a build error in
mcount.SwhenCONFIG_PRINTKis not enabled. Fixes this build error:sh2-linux-ld:
arch/sh/lib/mcount.o: in function `stack_panic':
(.text+0xec): undefined reference to `dump_stack'Fixes e460ab27b6c3 ("sh: Fix up stack overflow check with ftrace disabled.")Signed-off-by Randy Dunlap <[email protected]>Cc John Paul Adrian Glaubitz <[email protected]>Cc Yoshinori Sato <[email protected]>Cc Rich Felker <[email protected]>Suggested-by Geert Uytterhoeven <[email protected]>---
v2: add PRINTK toSTACK_DEBUGdependency (thanks, Geert)
v3: skipped
v4: refresh & resendarch/sh/Kconfig.debug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)diff -- a/arch/sh/Kconfig.debug b/arch/sh/Kconfig.debug
arch/sh/Kconfig.debug config SH_STANDARD_BIOS · line 21
Quoted 8 lines
arch/sh/Kconfig.debug +1
-1@@ -15,7 +15,7 @@ config SH_STANDARD_BIOS config STACK_DEBUG bool "Check for stack overflows" - depends on DEBUG_KERNEL + depends on DEBUG_KERNEL && PRINTK help This option will cause messages to be printed if free stack space drops below a certain limit. Saying Y here will add overhead toI can't really test this change as the moment I am enabling
CONFIG_STACK_DEBUG, the build fails with:CC
scripts/mod/devicetable-offsets.s
sh4-linux-gcc: error: -pg and -fomit-frame-pointer are incompatible make[1]: *** [scripts/Makefile.build:252:scripts/mod/empty.o] Error 1 make[1]: *** Waiting for unfinished jobs....
sh4-linux-gcc: error: -pg and -fomit-frame-pointer are incompatible make[1]: *** [scripts/Makefile.build:114:scripts/mod/devicetable-offsets.s] Error 1
make: *** [Makefile:1286: prepare0] Error 2So, I assume we need to strip -fomit-frame-pointer from
KBUILD_CFLAGS, correct?I tried this change, but that doesn't fix it for me:
arch/sh/Makefile +1
-0@@ -173,6 +173,7 @@ KBUILD_AFLAGS += $(cflags-y) ifeq ($(CONFIG_MCOUNT),y) KBUILD_CFLAGS += -pg + KBUILD_CFLAGS := $(subst -fomit-frame-pointer,,$(KBUILD_CFLAGS)) endifQuoted 7 lines
Quoted 5 lines
Quoted 3 lines
arch/sh/Makefile +0
-0ifeq ($(CONFIG_DWARF_UNWINDER),y)Any ideas?
Please try with "+=" instead of ":=".
That doesn't work either. I tried the following, but that didn't strip -fomit-frame-pointer:
Oops, obviously all of that happened before my morning coffee ;-)
Makefilehas:ifdef
CONFIG_FRAME_POINTER
KBUILD_CFLAGS+= -fno-omit-frame-pointer -fno-optimize-sibling-calls
KBUILD_RUSTFLAGS+= -Cforce-frame-pointers=y
else
# Some targets (ARM with Thumb2, for example), can't be built with frame # pointers. For those, we don't haveFUNCTION_TRACERautomatically # selectFRAME_POINTER. However,FUNCTION_TRACERadds -pg, and this is # incompatible with -fomit-frame-pointer with current GCC, so we don't use # -fomit-frame-pointer withFUNCTION_TRACER.
# In the Rust target specification, "frame-pointer" is set explicitly # to "may-omit".
ifndefCONFIG_FUNCTION_TRACER
KBUILD_CFLAGS+= -fomit-frame-pointer
endif
endifYour config probably has
CONFIG_FRAME_POINTERset?arch/sh/Kconfig.debug=config
DWARF_UNWINDERarch/sh/Kconfig.debug-bool "Enable the DWARF unwinder for stacktraces"arch/sh/Kconfig.debug-depends onDEBUG_KERNELarch/sh/Kconfig.debug: selectFRAME_POINTERYou should make sure that cannot happen when
CONFIG_FUNCTION_TRACERis enabled. I.e. makeDWARF_UNWINDERdepend on !FUNCTION_TRACER?Other architectures do something similar:
arch/sparc/Kconfig.debug:config
FRAME_POINTER
arch/sparc/Kconfig.debug-bool
arch/sparc/Kconfig.debug-depends on MCOUNTarch/x86/Kconfig.debug:config
FRAME_POINTERarch/x86/Kconfig.debug-depends on !UNWINDER_ORC && !UNWINDER_GUESSarch/x86/Kconfig.debug-boolProbably you need to adjust the following, too:
lib/Kconfig.debug:config
FRAME_POINTER
lib/Kconfig.debug-bool "Compile the kernel with frame pointers"
lib/Kconfig.debug-depends onDEBUG_KERNEL&& (M68K || UML ||
SUPERH) ||ARCH_WANT_FRAME_POINTERS
Quoted 5 lines
lib/Kconfig.debug- default y if (DEBUG_INFO && UML) ||
ARCH_WANT_FRAME_POINTERSi.e. drop SUPERH from the list above, and select
ARCH_WANT_FRAME_POINTERSif !FUNCTION_TRACER.
This change fixed it for me:
arch/sh/Kconfig +1 -0
@@ -55,6 +55,7 @@ config SUPERH select HAVE_SOFTIRQ_ON_OWN_STACK if IRQSTACKS select HAVE_STACKPROTECTOR select HAVE_SYSCALL_TRACEPOINTS + select ARCH_WANT_FRAME_POINTERS select IRQ_FORCED_THREADING select MODULES_USE_ELF_RELA select NEED_SG_DMA_LENGTH
lib/Kconfig.debug +1 -1
@@ -523,7 +523,7 @@ config ARCH_WANT_FRAME_POINTERS config FRAME_POINTER bool "Compile the kernel with frame pointers" - depends on DEBUG_KERNEL && (M68K || UML || SUPERH) || ARCH_WANT_FRAME_POINTERS + depends on DEBUG_KERNEL && (M68K || UML) || ARCH_WANT_FRAME_POINTERS default y if (DEBUG_INFO && UML) || ARCH_WANT_FRAME_POINTERS help If you say Y here the resulting kernel image will be slightly
It seems this is also what the other architectures do it seems.
Adrian
Signature · 4 lines
.''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Re: [PATCH 7/7 v4] sh: mcount.S: fix build error when PRINTK is not enabled
In reply to Randy DunlapQuoted 25 lines · Randy Dunlap
Fix a build error in
mcount.SwhenCONFIG_PRINTKis not enabled. Fixes this build error:sh2-linux-ld:
arch/sh/lib/mcount.o: in function `stack_panic':
(.text+0xec): undefined reference to `dump_stack'Fixes e460ab27b6c3 ("sh: Fix up stack overflow check with ftrace disabled.")Signed-off-by Randy Dunlap <[email protected]>Cc John Paul Adrian Glaubitz <[email protected]>Cc Yoshinori Sato <[email protected]>Cc Rich Felker <[email protected]>Suggested-by Geert Uytterhoeven <[email protected]>---
v2: add PRINTK toSTACK_DEBUGdependency (thanks, Geert)
v3: skipped
v4: refresh & resendarch/sh/Kconfig.debug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)diff -- a/arch/sh/Kconfig.debug b/arch/sh/Kconfig.debug
arch/sh/Kconfig.debug config SH_STANDARD_BIOS · line 21
Quoted 8 lines
arch/sh/Kconfig.debug +1
-1@@ -15,7 +15,7 @@ config SH_STANDARD_BIOS config STACK_DEBUG bool "Check for stack overflows" - depends on DEBUG_KERNEL + depends on DEBUG_KERNEL && PRINTK help This option will cause messages to be printed if free stack space drops below a certain limit. Saying Y here will add overhead to
Signature · 4 lines
.''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
John Paul Adrian Glaubitz
maintainerHi Randy!
Quoted 31 lines · Randy Dunlap
All of these patches have been sent previously, anywhere from one to 3 times. All patches are now called "v4".
This refresh/resend is to assist the new SH maintainer.
[PATCH 1/7 v4] sh: SH2007: drop the bad URL info
[PATCH 2/7 v4] sh:nmi_debug: fix return value of__setuphandler [PATCH 3/7 v4] sh: init: useOF_EARLY_FLATTREEfor early init [PATCH 4/7 v4] sh: math-emu: fix macro redefined warning [PATCH 5/7 v4] sh: remove sh5/sh64 last fragments
[PATCH 6/7 v4] sh: fixKconfigentry for NUMA => SMP
[PATCH 7/7 v4] sh:mcount.S: fix build error when PRINTK is not enableddiffstat:
Documentation/kbuild/kbuild.rst | 1 - Documentation/scheduler/sched-arch.rst | 2 -- Documentation/translations/zh_CN/scheduler/sched-arch.rst | 2 -- arch/sh/Kconfig | 4 ++++ arch/sh/Kconfig.debug | 2 +- arch/sh/boards/Kconfig | 1 - arch/sh/kernel/head_32.S | 6 +++--- arch/sh/kernel/nmi_debug.c | 4 ++-- arch/sh/kernel/setup.c | 4 ++-- arch/sh/math-emu/sfp-util.h | 4 ---- scripts/checkstack.pl | 7 ------- tools/perf/arch/common.c | 2 -- tools/scripts/Makefile.arch | 5 ----- tools/testing/selftests/mm/Makefile | 2 +- tools/testing/selftests/mm/run_vmtests.sh | 2 +- 15 files changed, 14 insertions(+), 34 deletions(-)
Quoted 9 lines
Cc John Paul Adrian Glaubitz <[email protected]>Cc Yoshinori Sato <[email protected]>Cc Rich Felker <[email protected]>Cc Geert Uytterhoeven <[email protected]>Cc Hitoshi Mitake <[email protected]>Cc Frank Rowand <[email protected]>Cc Arnd Bergmann <[email protected]>
Thanks for these fixes. All changes look good to me and I'm going to test them on my SH-7785LCR board on top of 6.3-rc1 and report back. The documentation changes obviously won't have any impact in this regard.
Adrian
Signature · 4 lines
.''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
John Paul Adrian Glaubitz
maintainerHi Randy!
Quoted 5 lines · Randy Dunlap
All of these patches have been sent previously, anywhere from one to 3 times. All patches are now called "v4".
This refresh/resend is to assist the new SH maintainer.
Quoted 7 lines
[PATCH 1/7 v4] sh: SH2007: drop the bad URL info
[PATCH 2/7 v4] sh:nmi_debug: fix return value of__setuphandler [PATCH 3/7 v4] sh: init: useOF_EARLY_FLATTREEfor early init [PATCH 4/7 v4] sh: math-emu: fix macro redefined warning [PATCH 5/7 v4] sh: remove sh5/sh64 last fragments
[PATCH 6/7 v4] sh: fixKconfigentry for NUMA => SMP
[PATCH 7/7 v4] sh:mcount.S: fix build error when PRINTK is not enabled
I have successfully applied, built and booted all patches on my SH7785LCR evaluation board except for patch #5.
I'll do the review next, then include them in my for-next tree for 6.4.
Adrian
Signature · 4 lines
.''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
John Paul Adrian Glaubitz
maintainerHi Randy!
Quoted 31 lines · Randy Dunlap
All of these patches have been sent previously, anywhere from one to 3 times. All patches are now called "v4".
This refresh/resend is to assist the new SH maintainer.
[PATCH 1/7 v4] sh: SH2007: drop the bad URL info
[PATCH 2/7 v4] sh:nmi_debug: fix return value of__setuphandler [PATCH 3/7 v4] sh: init: useOF_EARLY_FLATTREEfor early init [PATCH 4/7 v4] sh: math-emu: fix macro redefined warning [PATCH 5/7 v4] sh: remove sh5/sh64 last fragments
[PATCH 6/7 v4] sh: fixKconfigentry for NUMA => SMP
[PATCH 7/7 v4] sh:mcount.S: fix build error when PRINTK is not enableddiffstat:
Documentation/kbuild/kbuild.rst | 1 - Documentation/scheduler/sched-arch.rst | 2 -- Documentation/translations/zh_CN/scheduler/sched-arch.rst | 2 -- arch/sh/Kconfig | 4 ++++ arch/sh/Kconfig.debug | 2 +- arch/sh/boards/Kconfig | 1 - arch/sh/kernel/head_32.S | 6 +++--- arch/sh/kernel/nmi_debug.c | 4 ++-- arch/sh/kernel/setup.c | 4 ++-- arch/sh/math-emu/sfp-util.h | 4 ---- scripts/checkstack.pl | 7 ------- tools/perf/arch/common.c | 2 -- tools/scripts/Makefile.arch | 5 ----- tools/testing/selftests/mm/Makefile | 2 +- tools/testing/selftests/mm/run_vmtests.sh | 2 +- 15 files changed, 14 insertions(+), 34 deletions(-)
Quoted 9 lines
Cc John Paul Adrian Glaubitz <[email protected]>Cc Yoshinori Sato <[email protected]>Cc Rich Felker <[email protected]>Cc Geert Uytterhoeven <[email protected]>Cc Hitoshi Mitake <[email protected]>Cc Frank Rowand <[email protected]>Cc Arnd Bergmann <[email protected]>
All applied to sh-linux/for-next now except for patch number 6.
Apologies that it took so long, I'm still learning :-).
Adrian
Signature · 4 lines
.''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913