Skip to contentSkip to conversation

linux-evl: 5.18.1: build error for arch/arm

DISCUSSION Leonid Gasheev via Xenomai 2 participants 7 messages Jun 2, 2022 – Jun 4, 2022 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

A series of patches extracted from v5.18-evl-rebase has been applied to the kernel version v5.18.1

toolchain/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin

Build for the arm64 architecture is completed successfully.
But for arm:
arch/arm/kernel/irq.c: In function ‘handle_arch_irq_pipelined’:
arch/arm/kernel/irq.c:167:19: warning: cast between incompatible function types from ‘int (*)(struct pt_regs *)’ to ‘void (*)(void *)’ [-Wcast-function-type]
call_with_stack((void (*)(void *))handle_irq_pipelined, regs,

                   ^

arch/arm/kernel/entry-armv.S: Assembler messages:
arch/arm/kernel/entry-armv.S:496: Error: instruction not allowed in IT block -- tst r0,r0' arch/arm/kernel/entry-armv.S:785: Error: instruction not allowed in IT block -- tst r1,#0x0001' make[2]: *** [scripts/Makefile.build:389: arch/arm/kernel/entry-armv.o] Error 1

Signature · 1 line
Leonid Gasheev
#1 lore raw

02.06.2022 18:44, Leonid Gasheev via Xenomai пишет:

Quoted 5 lines

A series of patches extracted from v5.18-evl-rebase has been applied to the kernel version v5.18.1

toolchain/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin

Quoted 10 lines

Build for the arm64 architecture is completed successfully.
But for arm:
arch/arm/kernel/irq.c: In function ‘handle_arch_irq_pipelined’:
arch/arm/kernel/irq.c:167:19: warning: cast between incompatible function types from ‘int (*)(struct pt_regs *)’ to ‘void (*)(void *)’ [-Wcast-function-type]
   call_with_stack((void (*)(void *))handle_irq_pipelined, regs,
                   ^
arch/arm/kernel/entry-armv.S: Assembler messages:
arch/arm/kernel/entry-armv.S:496: Error: instruction not allowed in IT block -- `tst r0,r0'
arch/arm/kernel/entry-armv.S:785: Error: instruction not allowed in IT block -- `tst r1,#0x0001'
make[2]: *** [scripts/Makefile.build:389: arch/arm/kernel/entry-armv.o] Error 1

A similar situation with the 5.15.43 kernel.
The build for the arm fails:

arch/arm/kernel/entry-armv.S: Assembler messages:
arch/arm/kernel/entry-armv.S:470: Error: instruction not allowed in IT block -- tst r0,r0' arch/arm/kernel/entry-armv.S:760: Error: instruction not allowed in IT block -- tst r1,#0x0001' make[2]: *** [scripts/Makefile.build:390: arch/arm/kernel/entry-armv.o] Error 1 make[1]: *** [scripts/Makefile.build:551: arch/arm/kernel] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:1870: arch/arm] Error 2
make: *** Waiting for unfinished jobs....
kernel/audit_tree.c:33:9: error: redefinition of ‘struct node’

  struct node {
         ^~~~
In file included from ./include/linux/cpu.h:17,
                 from ./arch/arm/include/asm/cpu.h:11,
                 from ./arch/arm/include/asm/smp_plat.h:12,
                 from ./arch/arm/include/asm/irq_work.h:5,
                 from ./include/linux/irq_work.h:56,
                 from ./include/linux/irq.h:19,
                 from ./include/asm-generic/hardirq.h:17,
                 from ./arch/arm/include/asm/hardirq.h:10,
                 from ./include/linux/hardirq.h:12,
                 from ./include/linux/highmem.h:10,
                 from ./include/linux/bvec.h:10,
                 from ./include/linux/skbuff.h:17,
                 from kernel/audit.h:14,
                 from kernel/audit_tree.c:2:
./include/linux/node.h:84:8: note: originally defined here
 struct node {
        ^~~~

make[1]: *** [scripts/Makefile.build:288: kernel/audit_tree.o] Error 1

Any thoughts. I am grateful in advance.

Signature · 1 line
Leonid Gasheev
#2 lore raw
Quoted 54 lines · Leonid Gasheev via Xenomai via Xenomai

02.06.2022 18:44, Leonid Gasheev via Xenomai пишет:

Quoted 10 lines

A series of patches extracted from v5.18-evl-rebase has been applied to the kernel version v5.18.1 toolchain/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin Build for the arm64 architecture is completed successfully. But for arm:
arch/arm/kernel/irq.c: In function ‘handle_arch_irq_pipelined’:
arch/arm/kernel/irq.c:167:19: warning: cast between incompatible function types from ‘int (*)(struct pt_regs *)’ to ‘void (*)(void *)’ [-Wcast-function-type]
   call_with_stack((void (*)(void *))handle_irq_pipelined, regs,

Quoted 8 lines

                   ^
arch/arm/kernel/entry-armv.S: Assembler messages:
arch/arm/kernel/entry-armv.S:496: Error: instruction not allowed in IT block -- tst r0,r0' arch/arm/kernel/entry-armv.S:785: Error: instruction not allowed in IT block -- tst r1,#0x0001'
make[2]: *** [scripts/Makefile.build:389:
arch/arm/kernel/entry-armv.o] Error 1

A similar situation with the 5.15.43 kernel.
The build for the arm fails:

arch/arm/kernel/entry-armv.S: Assembler messages:
arch/arm/kernel/entry-armv.S:470: Error: instruction not allowed in IT block -- `tst r0,r0'
arch/arm/kernel/entry-armv.S:760: Error: instruction not allowed in IT block -- `tst r1,#0x0001'
make[2]: *** [scripts/Makefile.build:390:
arch/arm/kernel/entry-armv.o] Error 1
make[1]: *** [scripts/Makefile.build:551: arch/arm/kernel] Error 2 make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:1870: arch/arm] Error 2
make: *** Waiting for unfinished jobs.... kernel/audit_tree.c:33:9: error: redefinition of ‘struct node’

  struct node {
         ^~~~
In file included from ./include/linux/cpu.h:17,
                 from ./arch/arm/include/asm/cpu.h:11,
                 from ./arch/arm/include/asm/smp_plat.h:12,
                 from ./arch/arm/include/asm/irq_work.h:5,
                 from ./include/linux/irq_work.h:56,
                 from ./include/linux/irq.h:19,
                 from ./include/asm-generic/hardirq.h:17,
                 from ./arch/arm/include/asm/hardirq.h:10,
                 from ./include/linux/hardirq.h:12,
                 from ./include/linux/highmem.h:10,
                 from ./include/linux/bvec.h:10,
                 from ./include/linux/skbuff.h:17,
                 from kernel/audit.h:14,
                 from kernel/audit_tree.c:2:
./include/linux/node.h:84:8: note: originally defined here
 struct node {
        ^~~~
Quoted 4 lines

make[1]: *** [scripts/Makefile.build:288: kernel/audit_tree.o] Error 1

Any thoughts. I am grateful in advance.

v5.15.44/arm builds fine here, so this could be a toolchain issue. The oldest toolchain I tested with is:
arm-linux-gnueabihf-gcc (Linaro GCC 7.5-2019.12) 7.5.0

Signature · 1 line
Philippe.
#3 lore raw

03.06.2022 10:01, Philippe Gerum пишет:

Quoted 60 lines
Quoted 57 lines · Leonid Gasheev via Xenomai via Xenomai

02.06.2022 18:44, Leonid Gasheev via Xenomai пишет:

Quoted 10 lines

A series of patches extracted from v5.18-evl-rebase has been applied to the kernel version v5.18.1 toolchain/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin Build for the arm64 architecture is completed successfully. But for arm:
arch/arm/kernel/irq.c: In function ‘handle_arch_irq_pipelined’:
arch/arm/kernel/irq.c:167:19: warning: cast between incompatible function types from ‘int (*)(struct pt_regs *)’ to ‘void (*)(void *)’ [-Wcast-function-type]
   call_with_stack((void (*)(void *))handle_irq_pipelined, regs,

Quoted 8 lines

                   ^
arch/arm/kernel/entry-armv.S: Assembler messages:
arch/arm/kernel/entry-armv.S:496: Error: instruction not allowed in IT block -- tst r0,r0' arch/arm/kernel/entry-armv.S:785: Error: instruction not allowed in IT block -- tst r1,#0x0001'
make[2]: *** [scripts/Makefile.build:389:
arch/arm/kernel/entry-armv.o] Error 1

A similar situation with the 5.15.43 kernel.
The build for the arm fails:

arch/arm/kernel/entry-armv.S: Assembler messages:
arch/arm/kernel/entry-armv.S:470: Error: instruction not allowed in IT block -- `tst r0,r0'
arch/arm/kernel/entry-armv.S:760: Error: instruction not allowed in IT block -- `tst r1,#0x0001'
make[2]: *** [scripts/Makefile.build:390:
arch/arm/kernel/entry-armv.o] Error 1
make[1]: *** [scripts/Makefile.build:551: arch/arm/kernel] Error 2 make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:1870: arch/arm] Error 2
make: *** Waiting for unfinished jobs.... kernel/audit_tree.c:33:9: error: redefinition of ‘struct node’

   struct node {
          ^~~~
In file included from ./include/linux/cpu.h:17,
                  from ./arch/arm/include/asm/cpu.h:11,
                  from ./arch/arm/include/asm/smp_plat.h:12,
                  from ./arch/arm/include/asm/irq_work.h:5,
                  from ./include/linux/irq_work.h:56,
                  from ./include/linux/irq.h:19,
                  from ./include/asm-generic/hardirq.h:17,
                  from ./arch/arm/include/asm/hardirq.h:10,
                  from ./include/linux/hardirq.h:12,
                  from ./include/linux/highmem.h:10,
                  from ./include/linux/bvec.h:10,
                  from ./include/linux/skbuff.h:17,
                  from kernel/audit.h:14,
                  from kernel/audit_tree.c:2:
./include/linux/node.h:84:8: note: originally defined here
  struct node {
         ^~~~

make[1]: *** [scripts/Makefile.build:288: kernel/audit_tree.o] Error 1

Quoted 6 lines
Quoted 1 line

Any thoughts. I am grateful in advance.

v5.15.44/arm builds fine here, so this could be a toolchain issue. The oldest toolchain I tested with is:
arm-linux-gnueabihf-gcc (Linaro GCC 7.5-2019.12) 7.5.0

Good afternoon.
I found the problem, but it seems strange to me.
If the CONFIG_THUMB2_KERNEL=y parameter is in the kernel configuration, I get an error:
arch/arm/kernel/entry-armv.S: Assembler messages:
arch/arm/kernel/entry-armv.S:496: Error: instruction not allowed in IT block -- tst r0,r0' arch/arm/kernel/entry-armv.S:785: Error: instruction not allowed in IT block -- tst r1,#0x0001'

If the CONFIG_THUMB2_KERNEL parameter is not set, then compilation is successful.

I looked at the history of my work with this architecture. The last time it was the 5.1 kernel, and there is no such error in my records. Unfortunately I can't fix it. I know assembly code very poorly.

P.S. test board: bananapi-m3, cpu a83t, allwinner

Signature · 1 line
Leonid Gasheev
#4 lore raw
Quoted 76 lines · Leonid Gasheev via Xenomai via Xenomai

03.06.2022 10:01, Philippe Gerum пишет:

Quoted 59 lines
Quoted 57 lines · Leonid Gasheev via Xenomai via Xenomai

02.06.2022 18:44, Leonid Gasheev via Xenomai пишет:

Quoted 10 lines

A series of patches extracted from v5.18-evl-rebase has been applied to the kernel version v5.18.1 toolchain/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin Build for the arm64 architecture is completed successfully. But for arm:
arch/arm/kernel/irq.c: In function ‘handle_arch_irq_pipelined’:
arch/arm/kernel/irq.c:167:19: warning: cast between incompatible function types from ‘int (*)(struct pt_regs *)’ to ‘void (*)(void *)’ [-Wcast-function-type]
   call_with_stack((void (*)(void *))handle_irq_pipelined, regs,

Quoted 8 lines

                   ^
arch/arm/kernel/entry-armv.S: Assembler messages:
arch/arm/kernel/entry-armv.S:496: Error: instruction not allowed in IT block -- tst r0,r0' arch/arm/kernel/entry-armv.S:785: Error: instruction not allowed in IT block -- tst r1,#0x0001'
make[2]: *** [scripts/Makefile.build:389:
arch/arm/kernel/entry-armv.o] Error 1

A similar situation with the 5.15.43 kernel.
The build for the arm fails:

arch/arm/kernel/entry-armv.S: Assembler messages:
arch/arm/kernel/entry-armv.S:470: Error: instruction not allowed in IT block -- `tst r0,r0'
arch/arm/kernel/entry-armv.S:760: Error: instruction not allowed in IT block -- `tst r1,#0x0001'
make[2]: *** [scripts/Makefile.build:390:
arch/arm/kernel/entry-armv.o] Error 1
make[1]: *** [scripts/Makefile.build:551: arch/arm/kernel] Error 2 make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:1870: arch/arm] Error 2
make: *** Waiting for unfinished jobs.... kernel/audit_tree.c:33:9: error: redefinition of ‘struct node’

   struct node {
          ^~~~
In file included from ./include/linux/cpu.h:17,
                  from ./arch/arm/include/asm/cpu.h:11,
                  from ./arch/arm/include/asm/smp_plat.h:12,
                  from ./arch/arm/include/asm/irq_work.h:5,
                  from ./include/linux/irq_work.h:56,
                  from ./include/linux/irq.h:19,
                  from ./include/asm-generic/hardirq.h:17,
                  from ./arch/arm/include/asm/hardirq.h:10,
                  from ./include/linux/hardirq.h:12,
                  from ./include/linux/highmem.h:10,
                  from ./include/linux/bvec.h:10,
                  from ./include/linux/skbuff.h:17,
                  from kernel/audit.h:14,
                  from kernel/audit_tree.c:2:
./include/linux/node.h:84:8: note: originally defined here
  struct node {
         ^~~~

make[1]: *** [scripts/Makefile.build:288: kernel/audit_tree.o] Error 1

Quoted 6 lines
Quoted 1 line

Any thoughts. I am grateful in advance.

v5.15.44/arm builds fine here, so this could be a toolchain issue. The
oldest toolchain I tested with is:
arm-linux-gnueabihf-gcc (Linaro GCC 7.5-2019.12) 7.5.0

Good afternoon.
I found the problem, but it seems strange to me.
If the CONFIG_THUMB2_KERNEL=y parameter is in the kernel configuration, I get an error:
arch/arm/kernel/entry-armv.S: Assembler messages:
arch/arm/kernel/entry-armv.S:496: Error: instruction not allowed in IT block -- `tst r0,r0'
arch/arm/kernel/entry-armv.S:785: Error: instruction not allowed in IT block -- `tst r1,#0x0001'

Quoted 8 lines

If the CONFIG_THUMB2_KERNEL parameter is not set, then compilation is successful.

I looked at the history of my work with this architecture. The last time it was the 5.1 kernel, and there is no such error in my records. Unfortunately I can't fix it. I know assembly code very poorly.

P.S. test board: bananapi-m3, cpu a83t, allwinner

Ok, confirmed. I can reproduce this now building for a nanopi. I'll have a look asap and follow up.

Signature · 1 line
Philippe.
#5 lore raw
Quoted 81 lines · Philippe Gerum via Xenomai
Quoted 79 lines · Leonid Gasheev via Xenomai via Xenomai

03.06.2022 10:01, Philippe Gerum пишет:

Quoted 59 lines
Quoted 57 lines · Leonid Gasheev via Xenomai via Xenomai

02.06.2022 18:44, Leonid Gasheev via Xenomai пишет:

Quoted 10 lines

A series of patches extracted from v5.18-evl-rebase has been applied to the kernel version v5.18.1 toolchain/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin Build for the arm64 architecture is completed successfully. But for arm:
arch/arm/kernel/irq.c: In function ‘handle_arch_irq_pipelined’:
arch/arm/kernel/irq.c:167:19: warning: cast between incompatible function types from ‘int (*)(struct pt_regs *)’ to ‘void (*)(void *)’ [-Wcast-function-type]
   call_with_stack((void (*)(void *))handle_irq_pipelined, regs,

Quoted 8 lines

                   ^
arch/arm/kernel/entry-armv.S: Assembler messages:
arch/arm/kernel/entry-armv.S:496: Error: instruction not allowed in IT block -- tst r0,r0' arch/arm/kernel/entry-armv.S:785: Error: instruction not allowed in IT block -- tst r1,#0x0001'
make[2]: *** [scripts/Makefile.build:389:
arch/arm/kernel/entry-armv.o] Error 1

A similar situation with the 5.15.43 kernel.
The build for the arm fails:

arch/arm/kernel/entry-armv.S: Assembler messages:
arch/arm/kernel/entry-armv.S:470: Error: instruction not allowed in IT block -- `tst r0,r0'
arch/arm/kernel/entry-armv.S:760: Error: instruction not allowed in IT block -- `tst r1,#0x0001'
make[2]: *** [scripts/Makefile.build:390:
arch/arm/kernel/entry-armv.o] Error 1
make[1]: *** [scripts/Makefile.build:551: arch/arm/kernel] Error 2 make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:1870: arch/arm] Error 2
make: *** Waiting for unfinished jobs.... kernel/audit_tree.c:33:9: error: redefinition of ‘struct node’

   struct node {
          ^~~~
In file included from ./include/linux/cpu.h:17,
                  from ./arch/arm/include/asm/cpu.h:11,
                  from ./arch/arm/include/asm/smp_plat.h:12,
                  from ./arch/arm/include/asm/irq_work.h:5,
                  from ./include/linux/irq_work.h:56,
                  from ./include/linux/irq.h:19,
                  from ./include/asm-generic/hardirq.h:17,
                  from ./arch/arm/include/asm/hardirq.h:10,
                  from ./include/linux/hardirq.h:12,
                  from ./include/linux/highmem.h:10,
                  from ./include/linux/bvec.h:10,
                  from ./include/linux/skbuff.h:17,
                  from kernel/audit.h:14,
                  from kernel/audit_tree.c:2:
./include/linux/node.h:84:8: note: originally defined here
  struct node {
         ^~~~

make[1]: *** [scripts/Makefile.build:288: kernel/audit_tree.o] Error 1

Quoted 6 lines
Quoted 1 line

Any thoughts. I am grateful in advance.

v5.15.44/arm builds fine here, so this could be a toolchain issue. The
oldest toolchain I tested with is:
arm-linux-gnueabihf-gcc (Linaro GCC 7.5-2019.12) 7.5.0

Good afternoon.
I found the problem, but it seems strange to me.
If the CONFIG_THUMB2_KERNEL=y parameter is in the kernel configuration, I get an error:
arch/arm/kernel/entry-armv.S: Assembler messages:
arch/arm/kernel/entry-armv.S:496: Error: instruction not allowed in IT block -- `tst r0,r0'
arch/arm/kernel/entry-armv.S:785: Error: instruction not allowed in IT block -- `tst r1,#0x0001'

If the CONFIG_THUMB2_KERNEL parameter is not set, then compilation is successful.

Quoted 8 lines
Quoted 5 lines

I looked at the history of my work with this architecture. The last time it was the 5.1 kernel, and there is no such error in my records. Unfortunately I can't fix it. I know assembly code very poorly.

P.S. test board: bananapi-m3, cpu a83t, allwinner

Ok, confirmed. I can reproduce this now building for a nanopi. I'll have a look asap and follow up.

Ok, not only that code is wrong thumb2-wise, but it does not make much sense either. This is a left-over from an ancient implementation kept without thinking too much. You can just drop it.

arch/arm/kernel/entry-armv.S +0 -1
index c3c26345baaf..3a95cdb80e90 100644
@@ -466,7 +466,6 @@ __irq_usr:
 	irq_handler
 	mov	why, #0
 #ifdef CONFIG_IRQ_PIPELINE
-THUMB(	it ne)
 	tst	r0, r0
 	beq	fast_ret_to_user	@ skip epilogue if oob (in-band cannot be stalled)
 #endif
arch/arm/kernel/entry-header.S +0 -1
index efeaae7c180a..da1251c4e636 100644
@@ -414,7 +414,6 @@
 	.macro ret_to_user_pipelined, tmp
 #ifdef CONFIG_IRQ_PIPELINE
 	ldr	\tmp, [tsk, #TI_LOCAL_FLAGS]
-THUMB(	it ne)
 	tst	\tmp, #_TLF_OOB
 	bne	fast_ret_to_user
 #endif
Signature · 1 line
Philippe.
#6 lore raw

04.06.2022 17:07, Philippe Gerum пишет:

Quoted 115 lines
Quoted 81 lines · Philippe Gerum via Xenomai
Quoted 79 lines · Leonid Gasheev via Xenomai via Xenomai

03.06.2022 10:01, Philippe Gerum пишет:

Quoted 59 lines
Quoted 57 lines · Leonid Gasheev via Xenomai via Xenomai

02.06.2022 18:44, Leonid Gasheev via Xenomai пишет:

Quoted 10 lines

A series of patches extracted from v5.18-evl-rebase has been applied to the kernel version v5.18.1 toolchain/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin Build for the arm64 architecture is completed successfully. But for arm:
arch/arm/kernel/irq.c: In function ‘handle_arch_irq_pipelined’:
arch/arm/kernel/irq.c:167:19: warning: cast between incompatible function types from ‘int (*)(struct pt_regs *)’ to ‘void (*)(void *)’ [-Wcast-function-type]
   call_with_stack((void (*)(void *))handle_irq_pipelined, regs,

Quoted 8 lines

                   ^
arch/arm/kernel/entry-armv.S: Assembler messages:
arch/arm/kernel/entry-armv.S:496: Error: instruction not allowed in IT block -- tst r0,r0' arch/arm/kernel/entry-armv.S:785: Error: instruction not allowed in IT block -- tst r1,#0x0001'
make[2]: *** [scripts/Makefile.build:389:
arch/arm/kernel/entry-armv.o] Error 1

A similar situation with the 5.15.43 kernel.
The build for the arm fails:

arch/arm/kernel/entry-armv.S: Assembler messages:
arch/arm/kernel/entry-armv.S:470: Error: instruction not allowed in IT block -- `tst r0,r0'
arch/arm/kernel/entry-armv.S:760: Error: instruction not allowed in IT block -- `tst r1,#0x0001'
make[2]: *** [scripts/Makefile.build:390:
arch/arm/kernel/entry-armv.o] Error 1
make[1]: *** [scripts/Makefile.build:551: arch/arm/kernel] Error 2 make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:1870: arch/arm] Error 2
make: *** Waiting for unfinished jobs.... kernel/audit_tree.c:33:9: error: redefinition of ‘struct node’

    struct node {
           ^~~~
In file included from ./include/linux/cpu.h:17,
                   from ./arch/arm/include/asm/cpu.h:11,
                   from ./arch/arm/include/asm/smp_plat.h:12,
                   from ./arch/arm/include/asm/irq_work.h:5,
                   from ./include/linux/irq_work.h:56,
                   from ./include/linux/irq.h:19,
                   from ./include/asm-generic/hardirq.h:17,
                   from ./arch/arm/include/asm/hardirq.h:10,
                   from ./include/linux/hardirq.h:12,
                   from ./include/linux/highmem.h:10,
                   from ./include/linux/bvec.h:10,
                   from ./include/linux/skbuff.h:17,
                   from kernel/audit.h:14,
                   from kernel/audit_tree.c:2:
./include/linux/node.h:84:8: note: originally defined here
   struct node {
          ^~~~

make[1]: *** [scripts/Makefile.build:288: kernel/audit_tree.o] Error 1

Quoted 6 lines
Quoted 1 line

Any thoughts. I am grateful in advance.

v5.15.44/arm builds fine here, so this could be a toolchain issue. The
oldest toolchain I tested with is:
arm-linux-gnueabihf-gcc (Linaro GCC 7.5-2019.12) 7.5.0

Good afternoon.
I found the problem, but it seems strange to me.
If the CONFIG_THUMB2_KERNEL=y parameter is in the kernel configuration, I get an error:
arch/arm/kernel/entry-armv.S: Assembler messages:
arch/arm/kernel/entry-armv.S:496: Error: instruction not allowed in IT block -- `tst r0,r0'
arch/arm/kernel/entry-armv.S:785: Error: instruction not allowed in IT block -- `tst r1,#0x0001'

If the CONFIG_THUMB2_KERNEL parameter is not set, then compilation is successful.

Quoted 8 lines
Quoted 5 lines

I looked at the history of my work with this architecture. The last time it was the 5.1 kernel, and there is no such error in my records. Unfortunately I can't fix it. I know assembly code very poorly.

P.S. test board: bananapi-m3, cpu a83t, allwinner

Ok, confirmed. I can reproduce this now building for a nanopi. I'll have a look asap and follow up.

Ok, not only that code is wrong thumb2-wise, but it does not make much sense either. This is a left-over from an ancient implementation kept without thinking too much. You can just drop it.

arch/arm/kernel/entry-armv.S +0 -1
index c3c26345baaf..3a95cdb80e90 100644
@@ -466,7 +466,6 @@ __irq_usr:
  	irq_handler
  	mov	why, #0
  #ifdef CONFIG_IRQ_PIPELINE
-THUMB(	it ne)
  	tst	r0, r0
  	beq	fast_ret_to_user	@ skip epilogue if oob (in-band cannot be stalled)
  #endif
arch/arm/kernel/entry-header.S +0 -0
index efeaae7c180a..da1251c4e636 100644

arch/arm/kernel/entry-header.S line 419

Quoted 7 lines
arch/arm/kernel/entry-header.S +0 -1
@@ -414,7 +414,6 @@
  	.macro ret_to_user_pipelined, tmp
  #ifdef CONFIG_IRQ_PIPELINE
  	ldr	\tmp, [tsk, #TI_LOCAL_FLAGS]
-THUMB(	it ne)
  	tst	\tmp, #_TLF_OOB
  	bne	fast_ret_to_user
  #endif

Thank you!

Signature · 1 line
Leonid Gasheev