Skip to contentSkip to conversation

drivers/spi/spi-s3c24xx-fiq.S:52: Error: bad instruction `subsne pc, lr, #4'

PATCH In review kernel test robot 4 participants 6 messages Apr 2, 2021 – Apr 10, 2021

Subsystems (2)
lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.9.y
head:   1872b07a2ec0357e1349cc0081b182dd0b3e9dd7
commit: bc690c8239c3646434e19792851e825fafdb2782 [1825/2149] ARM: s3c: fix fiq for clang IAS
config: arm-randconfig-r033-20210401 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 7.5.0

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/commit/?id=bc690c8239c3646434e19792851e825fafdb2782
git remote add linux-stable-rc https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git fetch --no-tags linux-stable-rc linux-4.9.y
git checkout bc690c8239c3646434e19792851e825fafdb2782
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-7.5.0 make.cross ARCH=arm

If you fix the issue, kindly add following tag as appropriate

All errors (new ones prefixed by >>):

drivers/spi/spi-s3c24xx-fiq.S: Assembler messages:

>> drivers/spi/spi-s3c24xx-fiq.S:52: Error: bad instruction `subsne pc,lr,#4'

drivers/spi/spi-s3c24xx-fiq.S:78: Error: bad instruction subsne pc,lr,#4' drivers/spi/spi-s3c24xx-fiq.S:102: Error: bad instruction subsne pc,lr,#4'

vim +52 drivers/spi/spi-s3c24xx-fiq.S

    21	
    22		.text
    23	
    24		@ entry to these routines is as follows, with the register names
    25		@ defined in fiq.h so that they can be shared with the C files which
    26		@ setup the calling registers.
    27		@
    28		@ fiq_rirq	The base of the IRQ registers to find S3C2410_SRCPND
    29		@ fiq_rtmp	Temporary register to hold tx/rx data
    30		@ fiq_rspi	The base of the SPI register block
    31		@ fiq_rtx	The tx buffer pointer
    32		@ fiq_rrx	The rx buffer pointer
    33		@ fiq_rcount	The number of bytes to move
    34	
    35		@ each entry starts with a word entry of how long it is
    36		@ and an offset to the irq acknowledgment word
    37	
    38	ENTRY(s3c24xx_spi_fiq_rx)
    39		.word	fiq_rx_end - fiq_rx_start
    40		.word	fiq_rx_irq_ack - fiq_rx_start
    41	fiq_rx_start:
    42		ldr	fiq_rtmp, fiq_rx_irq_ack
    43		str	fiq_rtmp, [ fiq_rirq, # S3C2410_SRCPND - S3C24XX_VA_IRQ ]
    44	
    45		ldrb	fiq_rtmp, [ fiq_rspi, #  S3C2410_SPRDAT ]
    46		strb	fiq_rtmp, [ fiq_rrx ], #1
    47	
    48		mov	fiq_rtmp, #0xff
    49		strb	fiq_rtmp, [ fiq_rspi, # S3C2410_SPTDAT ]
    50	
    51		subs	fiq_rcount, fiq_rcount, #1
  > 52		subsne	pc, lr, #4		@@ return, still have work to do
    53	
    54		@@ set IRQ controller so that next op will trigger IRQ
    55		mov	fiq_rtmp, #0
    56		str	fiq_rtmp, [ fiq_rirq, # S3C2410_INTMOD  - S3C24XX_VA_IRQ ]
    57		subs	pc, lr, #4
    58	
    59	fiq_rx_irq_ack:
    60		.word	0
    61	fiq_rx_end:
    62	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

#1 lore raw
Quoted 17 lines · kernel test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.9.y
head:   1872b07a2ec0357e1349cc0081b182dd0b3e9dd7
commit: bc690c8239c3646434e19792851e825fafdb2782 [1825/2149] ARM: s3c: fix fiq for clang IAS
config: arm-randconfig-r033-20210401 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 7.5.0

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/commit/?id=bc690c8239c3646434e19792851e825fafdb2782
git remote add linux-stable-rc https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git fetch --no-tags linux-stable-rc linux-4.9.y
git checkout bc690c8239c3646434e19792851e825fafdb2782
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-7.5.0 make.cross ARCH=arm

If you fix the issue, kindly add following tag as appropriate

Quoted 8 lines

All errors (new ones prefixed by >>):

drivers/spi/spi-s3c24xx-fiq.S: Assembler messages:

Quoted 1 line
Quoted 1 line

drivers/spi/spi-s3c24xx-fiq.S:52: Error: bad instruction `subsne pc,lr,#4'

drivers/spi/spi-s3c24xx-fiq.S:78: Error: bad instruction subsne pc,lr,#4' drivers/spi/spi-s3c24xx-fiq.S:102: Error: bad instruction subsne pc,lr,#4'

Fairly sure this doesn't happen on mainline, something must have changed with the compiler flags after v4.9, not sure what.

It's probably better not to have this one backported then. Nick/Nathan, any idea what the difference might be?

Arnd

#2 lore raw
Quoted 22 lines · Arnd Bergmann
Quoted 21 lines · kernel test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.9.y
head:   1872b07a2ec0357e1349cc0081b182dd0b3e9dd7
commit: bc690c8239c3646434e19792851e825fafdb2782 [1825/2149] ARM: s3c: fix fiq for clang IAS
config: arm-randconfig-r033-20210401 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 7.5.0

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/commit/?id=bc690c8239c3646434e19792851e825fafdb2782
git remote add linux-stable-rc https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git fetch --no-tags linux-stable-rc linux-4.9.y
git checkout bc690c8239c3646434e19792851e825fafdb2782
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-7.5.0 make.cross ARCH=arm

If you fix the issue, kindly add following tag as appropriate

All errors (new ones prefixed by >>):

Quoted 7 lines
Quoted 4 lines

drivers/spi/spi-s3c24xx-fiq.S: Assembler messages:

Quoted 1 line
Quoted 1 line

drivers/spi/spi-s3c24xx-fiq.S:52: Error: bad instruction `subsne pc,lr,#4'

drivers/spi/spi-s3c24xx-fiq.S:78: Error: bad instruction subsne pc,lr,#4' drivers/spi/spi-s3c24xx-fiq.S:102: Error: bad instruction subsne pc,lr,#4'

Fairly sure this doesn't happen on mainline, something must have changed with the compiler flags after v4.9, not sure what.

Looks like this is GCC/GNU as complaining, which leads me to believe it is a lack of commit 75fea300d73a ("ARM: 8723/2: always assume the "unified" syntax for assembly code") in 4.9.

Quoted 4 lines

It's probably better not to have this one backported then. Nick/Nathan, any idea what the difference might be?

Arnd

If that commit cannot be taken to fix it, we should revert this backport in 4.9 because there is no reason for it to be there. The integrated assembler is only really working well on 5.4+.

Cheers,
Nathan

#3 lore raw
Quoted 35 lines · Nathan Chancellor
Quoted 22 lines · Arnd Bergmann
Quoted 21 lines · kernel test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.9.y
head:   1872b07a2ec0357e1349cc0081b182dd0b3e9dd7
commit: bc690c8239c3646434e19792851e825fafdb2782 [1825/2149] ARM: s3c: fix fiq for clang IAS
config: arm-randconfig-r033-20210401 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 7.5.0

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/commit/?id=bc690c8239c3646434e19792851e825fafdb2782
git remote add linux-stable-rc https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git fetch --no-tags linux-stable-rc linux-4.9.y
git checkout bc690c8239c3646434e19792851e825fafdb2782
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-7.5.0 make.cross ARCH=arm

If you fix the issue, kindly add following tag as appropriate

All errors (new ones prefixed by >>):

Quoted 7 lines
Quoted 4 lines

drivers/spi/spi-s3c24xx-fiq.S: Assembler messages:

Quoted 1 line
Quoted 1 line

drivers/spi/spi-s3c24xx-fiq.S:52: Error: bad instruction `subsne pc,lr,#4'

drivers/spi/spi-s3c24xx-fiq.S:78: Error: bad instruction subsne pc,lr,#4' drivers/spi/spi-s3c24xx-fiq.S:102: Error: bad instruction subsne pc,lr,#4'

Fairly sure this doesn't happen on mainline, something must have changed with the compiler flags after v4.9, not sure what.

Looks like this is GCC/GNU as complaining, which leads me to believe it is a lack of commit 75fea300d73a ("ARM: 8723/2: always assume the "unified" syntax for assembly code") in 4.9.

Quoted 8 lines
Quoted 4 lines

It's probably better not to have this one backported then. Nick/Nathan, any idea what the difference might be?

Arnd

If that commit cannot be taken to fix it, we should revert this backport in 4.9 because there is no reason for it to be there. The integrated assembler is only really working well on 5.4+.

I'll be glad to take it if someone backports it so that it applies :)

thanks,

greg k-h

#4 lore raw

PATCH 1/1 ARM: 8723/2: always assume the "unified" syntax for assembly code

From: Nicolas Pitre <[email protected]>

commit 75fea300d73ae5b18957949a53ec770daaeb6fc2 upstream.

The GNU assembler has implemented the "unified syntax" parsing since 2005. This "unified" syntax is required when the kernel is built in Thumb2 mode. However the "unified" syntax is a mixed bag of features, including not requiring a `#' prefix with immediate operands. This leads to situations where some code builds just fine in Thumb2 mode and fails to build in ARM mode if that prefix is missing. This behavior discrepancy makes build tests less valuable, forcing both ARM and Thumb2 builds for proper coverage.

Let's "fix" this issue by always using the "unified" syntax for both ARM and Thumb2 mode. Given that the documented minimum binutils version that properly builds the kernel is version 2.20 released in 2010, we can assume that any toolchain capable of building the latest kernel is also "unified syntax" capable.

Whith this, a bunch of macros used to mask some differences between both syntaxes can be removed, with the side effect of making LTO easier.

[nathan: Resolve small conflict on 4.9 due to a lack of 494609701e06a]

---

Hi all,

This commit is needed to fix the backport of commit 7f9942c61fa6 ("ARM:
s3c: fix fiq for clang IAS"):

https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org/message/MJWA3VGAUNQYOL7XZBYMS4EI4AYRC3XN/

It is present in 4.14+ and it has been validate via TuxSuite across a variety of arch/arm configs with no errors so I feel it should be a fairly safe backport.

Cheers,
Nathan

 arch/arm/Kconfig               |  7 +---
 arch/arm/Makefile              |  6 ++-
 arch/arm/include/asm/unified.h | 77 ++--------------------------------
 3 files changed, 8 insertions(+), 82 deletions(-)
arch/arm/Kconfig +1 -6
index ae55f5db97f8..9dbaa283f01d 100644
@@ -1546,12 +1546,10 @@ config THUMB2_KERNEL
 	depends on (CPU_V7 || CPU_V7M) && !CPU_V6 && !CPU_V6K
 	default y if CPU_THUMBONLY
 	select AEABI
-	select ARM_ASM_UNIFIED
 	select ARM_UNWIND
 	help
 	  By enabling this option, the kernel will be compiled in
-	  Thumb-2 mode. A compiler/assembler that understand the unified
-	  ARM-Thumb syntax is needed.
+	  Thumb-2 mode.
 
 	  If unsure, say N.
 
@@ -1586,9 +1584,6 @@ config THUMB2_AVOID_R_ARM_THM_JUMP11
 
 	  Unless you are sure your tools don't have this problem, say Y.
 
-config ARM_ASM_UNIFIED
-	bool
-
 config ARM_PATCH_IDIV
 	bool "Runtime patch udiv/sdiv instructions into __aeabi_{u}idiv()"
 	depends on CPU_32v7 && !XIP_KERNEL
arch/arm/Makefile +4 -2
index e14ddca59d02..975b110e7d87 100644
@@ -113,9 +113,11 @@ ifeq ($(CONFIG_ARM_UNWIND),y)
 CFLAGS_ABI	+=-funwind-tables
 endif
 
+# Accept old syntax despite ".syntax unified"
+AFLAGS_NOWARN	:=$(call as-option,-Wa$(comma)-mno-warn-deprecated,-Wa$(comma)-W)
+
 ifeq ($(CONFIG_THUMB2_KERNEL),y)
 AFLAGS_AUTOIT	:=$(call as-option,-Wa$(comma)-mimplicit-it=always,-Wa$(comma)-mauto-it)
-AFLAGS_NOWARN	:=$(call as-option,-Wa$(comma)-mno-warn-deprecated,-Wa$(comma)-W)
 CFLAGS_ISA	:=-mthumb $(AFLAGS_AUTOIT) $(AFLAGS_NOWARN)
 AFLAGS_ISA	:=$(CFLAGS_ISA) -Wa$(comma)-mthumb
 # Work around buggy relocation from gas if requested:
@@ -123,7 +125,7 @@ ifeq ($(CONFIG_THUMB2_AVOID_R_ARM_THM_JUMP11),y)
 CFLAGS_MODULE	+=-fno-optimize-sibling-calls
 endif
 else
-CFLAGS_ISA	:=$(call cc-option,-marm,)
+CFLAGS_ISA	:=$(call cc-option,-marm,) $(AFLAGS_NOWARN)
 AFLAGS_ISA	:=$(CFLAGS_ISA)
 endif
 
arch/arm/include/asm/unified.h +3 -74

88 lines not on this page · raw message

Signature · 1 line
2.31.0
#5 lore raw

Re: [PATCH 4.9] ARM: 8723/2: always assume the "unified" syntax for assembly code

Quoted 31 lines · Nathan Chancellor

From: Nicolas Pitre <[email protected]>

commit 75fea300d73ae5b18957949a53ec770daaeb6fc2 upstream.

The GNU assembler has implemented the "unified syntax" parsing since 2005. This "unified" syntax is required when the kernel is built in Thumb2 mode. However the "unified" syntax is a mixed bag of features, including not requiring a `#' prefix with immediate operands. This leads to situations where some code builds just fine in Thumb2 mode and fails to build in ARM mode if that prefix is missing. This behavior discrepancy makes build tests less valuable, forcing both ARM and Thumb2 builds for proper coverage.

Let's "fix" this issue by always using the "unified" syntax for both ARM and Thumb2 mode. Given that the documented minimum binutils version that properly builds the kernel is version 2.20 released in 2010, we can assume that any toolchain capable of building the latest kernel is also "unified syntax" capable.

Whith this, a bunch of macros used to mask some differences between both syntaxes can be removed, with the side effect of making LTO easier.

[nathan: Resolve small conflict on 4.9 due to a lack of 494609701e06a]

---

Hi all,

Quoted 8 lines

This commit is needed to fix the backport of commit 7f9942c61fa6 ("ARM:
s3c: fix fiq for clang IAS"):

https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org/message/MJWA3VGAUNQYOL7XZBYMS4EI4AYRC3XN/

It is present in 4.14+ and it has been validate via TuxSuite across a variety of arch/arm configs with no errors so I feel it should be a fairly safe backport.

Now queued up, thanks.

greg k-h