Skip to contentSkip to conversation

kernel/printk/printk.o: warning: objtool: __jump_table+0x0: special: can't find orig instruction

PATCH kernel test robot 7 participants 9 messages May 29, 2024 – Jun 4, 2024 LoongArch

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git linux-6.10.y-rt-rebase
head:   6d20efa57a896036453f4b061ae22601ef61b494
commit: 127f3e5b794bd6fa90d4649318dd898455efa6d7 [63/93] printk: Provide threadprintk boot argument
config: loongarch-defconfig (https://download.01.org/0day-ci/archive/20240530/[email protected]/config)
compiler: loongarch64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240530/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

>> kernel/printk/printk.o: warning: objtool: __jump_table+0x0: special: can't find orig instruction
--
>> kernel/printk/nbcon.o: warning: objtool: __jump_table+0x0: special: can't find orig instruction

objdump-func vmlinux.o __jump_table:

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#1 lore raw
Quoted 12 lines · kernel test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git linux-6.10.y-rt-rebase
head:   6d20efa57a896036453f4b061ae22601ef61b494
commit: 127f3e5b794bd6fa90d4649318dd898455efa6d7 [63/93] printk: Provide threadprintk boot argument
config: loongarch-defconfig (https://download.01.org/0day-ci/archive/20240530/[email protected]/config)
compiler: loongarch64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240530/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

Quoted 5 lines

All warnings (new ones prefixed by >>):

Quoted 1 line
Quoted 1 line

kernel/printk/printk.o: warning: objtool: __jump_table+0x0: special: can't find orig instruction

--

Quoted 1 line
Quoted 1 line

kernel/printk/nbcon.o: warning: objtool: __jump_table+0x0: special: can't find orig instruction

On loongarch, it looks like all users of the jump_table are causing this warning. I will assume this is something that needs to be fixed at the arch level (either in the kernel or the compiler).

John Ogness

#2 lore raw

+ Loongarch folks

Hi Huacai and Xuerui,

Could you please help take a look at this case? Thanks.

Quoted 25 lines · John Ogness
Quoted 12 lines · kernel test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git linux-6.10.y-rt-rebase
head:   6d20efa57a896036453f4b061ae22601ef61b494
commit: 127f3e5b794bd6fa90d4649318dd898455efa6d7 [63/93] printk: Provide threadprintk boot argument
config: loongarch-defconfig (https://download.01.org/0day-ci/archive/20240530/[email protected]/config)
compiler: loongarch64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240530/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

Quoted 5 lines

All warnings (new ones prefixed by >>):

Quoted 1 line
Quoted 1 line

kernel/printk/printk.o: warning: objtool: __jump_table+0x0: special: can't find orig instruction

--

Quoted 1 line
Quoted 1 line

kernel/printk/nbcon.o: warning: objtool: __jump_table+0x0: special: can't find orig instruction

On loongarch, it looks like all users of the jump_table are causing this warning. I will assume this is something that needs to be fixed at the arch level (either in the kernel or the compiler).

John Ogness

maintainer
#3 lore raw
Quoted 6 lines · Yujie Liu

+ Loongarch folks

Hi Huacai and Xuerui,

Could you please help take a look at this case? Thanks.

We are attempting to solve this problem, please wait some time.

Huacai

Quoted 27 lines · John Ogness
Quoted 25 lines · kernel test robot
Quoted 12 lines
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git linux-6.10.y-rt-rebase
head:   6d20efa57a896036453f4b061ae22601ef61b494
commit: 127f3e5b794bd6fa90d4649318dd898455efa6d7 [63/93] printk: Provide threadprintk boot argument
config: loongarch-defconfig (https://download.01.org/0day-ci/archive/20240530/[email protected]/config)
compiler: loongarch64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240530/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

Quoted 5 lines

All warnings (new ones prefixed by >>):

Quoted 1 line
Quoted 1 line

kernel/printk/printk.o: warning: objtool: __jump_table+0x0: special: can't find orig instruction

--

Quoted 1 line
Quoted 1 line

kernel/printk/nbcon.o: warning: objtool: __jump_table+0x0: special: can't find orig instruction

On loongarch, it looks like all users of the jump_table are causing this warning. I will assume this is something that needs to be fixed at the arch level (either in the kernel or the compiler).

John Ogness

#4 lore raw
In reply to Yujie Liu
Quoted 32 lines · Yujie Liu

+ Loongarch folks

Hi Huacai and Xuerui,

Could you please help take a look at this case? Thanks.

Quoted 25 lines · John Ogness
Quoted 12 lines · kernel test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git linux-6.10.y-rt-rebase
head:   6d20efa57a896036453f4b061ae22601ef61b494
commit: 127f3e5b794bd6fa90d4649318dd898455efa6d7 [63/93] printk: Provide threadprintk boot argument
config: loongarch-defconfig (https://download.01.org/0day-ci/archive/20240530/[email protected]/config)
compiler: loongarch64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240530/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

Quoted 5 lines

All warnings (new ones prefixed by >>):

Quoted 1 line
Quoted 1 line

kernel/printk/printk.o: warning: objtool: __jump_table+0x0: special: can't find orig instruction

--

Quoted 1 line
Quoted 1 line

kernel/printk/nbcon.o: warning: objtool: __jump_table+0x0: special: can't find orig instruction

On loongarch, it looks like all users of the jump_table are causing this warning. I will assume this is something that needs to be fixed at the arch level (either in the kernel or the compiler).

John Ogness

Here are my thoughts, anyway it is up to the maintainers.

After commit 9cc1df421f00 ("LoongArch: Update Loongson-3 default
config file"), there exist some build regressions about objtool
warnings on LoongArch. This is because objtool does not work well
with jump tables, -fno-jump-tables is already added in Makefile,
but there are some special cases, some warnings can be reproduced
because the code has __annotate_jump_table, some warnings can not
be reproduced with unknown reason (maybe due to the lower version
of compiler toolchain). In order to avoid the warnings reported
by kernel test robot, it is better to remove CONFIG_UNWINDER_ORC=y
in defconfig for now, the proper time to enable ORC stack unwinder should after objtool supports jump tables on LoongArch.

arch/loongarch/Makefile

ifdef CONFIG_OBJTOOL
KBUILD_CFLAGS += -fno-jump-tables
endif

include/linux/compiler.h

/* Annotate a C jump table to allow objtool to follow the code flow */ #define __annotate_jump_table __section(".rodata..c_jump_table")

Like this:

arch/loongarch/configs/loongson3_defconfig +0 -1
index b4252c357c8e..0eb14e9259c2 100644
@@ -983,4 +983,3 @@ CONFIG_DEBUG_FS=y
 CONFIG_SCHEDSTATS=y
 # CONFIG_DEBUG_PREEMPT is not set
 # CONFIG_FTRACE is not set
-CONFIG_UNWINDER_ORC=y

Thanks,
Tiezhu

#5 lore raw

arch/loongarch/configs/loongson3_defconfig CONFIG_DEBUG_FS=y · line 986

Quoted 12 lines · Tiezhu Yang

Like this:

arch/loongarch/configs/loongson3_defconfig +0 -1
index b4252c357c8e..0eb14e9259c2 100644
@@ -983,4 +983,3 @@ CONFIG_DEBUG_FS=y
 CONFIG_SCHEDSTATS=y
 # CONFIG_DEBUG_PREEMPT is not set
 # CONFIG_FTRACE is not set
-CONFIG_UNWINDER_ORC=y

If ORC/objtool is broken on loongarch, shouldn't you disable it then or mask at least via

arch/loongarch/Kconfig.debug +1 -0
index 98d60630c3d4b..2bce03b8f8309 100644
@@ -28,6 +28,7 @@ config UNWINDER_PROLOGUE
 
 config UNWINDER_ORC
 	bool "ORC unwinder"
+	depends on BROKEN
 	select OBJTOOL
 	help
 	  This option enables the ORC (Oops Rewind Capability) unwinder for

instead? Removing it from defconfig makes it still available to to randconfig.

Quoted 2 lines

Thanks,
Tiezhu

Sebastian

#6 lore raw
Quoted 30 lines · Sebastian Andrzej Siewior

arch/loongarch/configs/loongson3_defconfig CONFIG_DEBUG_FS=y · line 986

Quoted 12 lines · Tiezhu Yang

Like this:

arch/loongarch/configs/loongson3_defconfig +0 -1
index b4252c357c8e..0eb14e9259c2 100644
@@ -983,4 +983,3 @@ CONFIG_DEBUG_FS=y
 CONFIG_SCHEDSTATS=y
 # CONFIG_DEBUG_PREEMPT is not set
 # CONFIG_FTRACE is not set
-CONFIG_UNWINDER_ORC=y

If ORC/objtool is broken on loongarch, shouldn't you disable it then or mask at least via

arch/loongarch/Kconfig.debug +1 -0
index 98d60630c3d4b..2bce03b8f8309 100644
@@ -28,6 +28,7 @@ config UNWINDER_PROLOGUE
 
 config UNWINDER_ORC
 	bool "ORC unwinder"
+	depends on BROKEN
 	select OBJTOOL
 	help
 	  This option enables the ORC (Oops Rewind Capability) unwinder for
Quoted 2 lines

instead? Removing it from defconfig makes it still available to to randconfig.

Yes, good suggestion, I think so.
Let us wait for more comments.

Thanks,
Tiezhu

#7 lore raw
In reply to Sebastian Andrzej Siewior
Quoted 30 lines · Sebastian Andrzej Siewior
Quoted 8 lines · Tiezhu Yang

Like this:

arch/loongarch/configs/loongson3_defconfig +0 -0
index b4252c357c8e..0eb14e9259c2 100644
@@ -983,4 +983,3 @@ CONFIG_DEBUG_FS=y
Quoted 4 lines

 CONFIG_SCHEDSTATS=y
 # CONFIG_DEBUG_PREEMPT is not set
 # CONFIG_FTRACE is not set
-CONFIG_UNWINDER_ORC=y

If ORC/objtool is broken on loongarch, shouldn't you disable it then or mask at least via

arch/loongarch/Kconfig.debug +0 -0
index 98d60630c3d4b..2bce03b8f8309 100644
@@ -28,6 +28,7 @@ config UNWINDER_PROLOGUE


 config UNWINDER_ORC
  bool "ORC unwinder"

arch/loongarch/Kconfig.debug +1 -0
+	depends on BROKEN

  select OBJTOOL
  help
    This option enables the ORC (Oops Rewind Capability) unwinder for

Quoted 2 lines

instead? Removing it from defconfig makes it still available to to randconfig.

I agree but...

arch/loongarch/Kconfig +1 -1
index e38139c576ee..4706aa948a5f 100644
@@ -143,7 +143,7 @@ config LOONGARCH
        select HAVE_LIVEPATCH
        select HAVE_MOD_ARCH_SPECIFIC
        select HAVE_NMI
-       select HAVE_OBJTOOL if AS_HAS_EXPLICIT_RELOCS
+       select HAVE_OBJTOOL if AS_HAS_EXPLICIT_RELOCS && BROKEN
        select HAVE_PCI
        select HAVE_PERF_EVENTS
        select HAVE_PERF_REGS

should be better? It looks like everything depending on objtool is broken, not only ORC.

Signature · 2 lines
Xi Ruoyao <[email protected]>
School of Aerospace Science and Technology, Xidian University
#8 lore raw
Quoted 50 lines · Xi Ruoyao
Quoted 30 lines · Sebastian Andrzej Siewior
Quoted 8 lines · Tiezhu Yang

Like this:

arch/loongarch/configs/loongson3_defconfig +0 -0
index b4252c357c8e..0eb14e9259c2 100644
@@ -983,4 +983,3 @@ CONFIG_DEBUG_FS=y
Quoted 4 lines

 CONFIG_SCHEDSTATS=y
 # CONFIG_DEBUG_PREEMPT is not set
 # CONFIG_FTRACE is not set
-CONFIG_UNWINDER_ORC=y

If ORC/objtool is broken on loongarch, shouldn't you disable it then or mask at least via

arch/loongarch/Kconfig.debug +0 -0
index 98d60630c3d4b..2bce03b8f8309 100644
@@ -28,6 +28,7 @@ config UNWINDER_PROLOGUE


 config UNWINDER_ORC
  bool "ORC unwinder"

arch/loongarch/Kconfig.debug +1 -0
+	depends on BROKEN

  select OBJTOOL
  help
    This option enables the ORC (Oops Rewind Capability) unwinder for

Quoted 2 lines

instead? Removing it from defconfig makes it still available to to randconfig.

I agree but...

arch/loongarch/Kconfig +0 -0
index e38139c576ee..4706aa948a5f 100644
@@ -143,7 +143,7 @@ config LOONGARCH

        select HAVE_LIVEPATCH
        select HAVE_MOD_ARCH_SPECIFIC
        select HAVE_NMI
-       select HAVE_OBJTOOL if AS_HAS_EXPLICIT_RELOCS +       select HAVE_OBJTOOL if AS_HAS_EXPLICIT_RELOCS && BROKEN select HAVE_PCI
        select HAVE_PERF_EVENTS
        select HAVE_PERF_REGS

Quoted 2 lines

should be better?  It looks like everything depending on objtool is broken, not only ORC.

No longer needed, I've root-caused the issue:
https://lore.kernel.org/loongarch/[email protected]/

Signature · 2 lines
Xi Ruoyao <[email protected]>
School of Aerospace Science and Technology, Xidian University