All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-stable-rc:linux-4.9.y 1825/2149] drivers/spi/spi-s3c24xx-fiq.S:52: Error: bad instruction `subsne pc, lr, #4'
@ 2021-04-02  3:59 kernel test robot
  2021-04-03 11:00 ` Arnd Bergmann
  0 siblings, 1 reply; 8+ messages in thread
From: kernel test robot @ 2021-04-02  3:59 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 3175 bytes --]

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
Reported-by: kernel test robot <lkp@intel.com>

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 17579 bytes --]

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

* Re: [linux-stable-rc:linux-4.9.y 1825/2149] drivers/spi/spi-s3c24xx-fiq.S:52: Error: bad instruction `subsne pc, lr, #4'
  2021-04-02  3:59 [linux-stable-rc:linux-4.9.y 1825/2149] drivers/spi/spi-s3c24xx-fiq.S:52: Error: bad instruction `subsne pc, lr, #4' kernel test robot
@ 2021-04-03 11:00 ` Arnd Bergmann
  2021-04-03 11:34   ` Nathan Chancellor
  0 siblings, 1 reply; 8+ messages in thread
From: Arnd Bergmann @ 2021-04-03 11:00 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 1861 bytes --]

On Fri, Apr 2, 2021 at 5:59 AM kernel test robot <lkp@intel.com> wrote:
>
> 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
> Reported-by: kernel test robot <lkp@intel.com>
>
> 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'

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

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

* Re: [linux-stable-rc:linux-4.9.y 1825/2149] drivers/spi/spi-s3c24xx-fiq.S:52: Error: bad instruction `subsne pc, lr, #4'
  2021-04-03 11:00 ` Arnd Bergmann
@ 2021-04-03 11:34   ` Nathan Chancellor
  2021-04-03 11:47     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 8+ messages in thread
From: Nathan Chancellor @ 2021-04-03 11:34 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 2392 bytes --]

On Sat, Apr 03, 2021 at 01:00:00PM +0200, Arnd Bergmann wrote:
> On Fri, Apr 2, 2021 at 5:59 AM kernel test robot <lkp@intel.com> wrote:
> >
> > 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
> > Reported-by: kernel test robot <lkp@intel.com>
> >
> > 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'
> 
> 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.

> 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

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

* Re: [linux-stable-rc:linux-4.9.y 1825/2149] drivers/spi/spi-s3c24xx-fiq.S:52: Error: bad instruction `subsne pc, lr, #4'
  2021-04-03 11:34   ` Nathan Chancellor
@ 2021-04-03 11:47     ` Greg Kroah-Hartman
  2021-04-05 19:08         ` Nathan Chancellor
  0 siblings, 1 reply; 8+ messages in thread
From: Greg Kroah-Hartman @ 2021-04-03 11:47 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 2623 bytes --]

On Sat, Apr 03, 2021 at 04:34:31AM -0700, Nathan Chancellor wrote:
> On Sat, Apr 03, 2021 at 01:00:00PM +0200, Arnd Bergmann wrote:
> > On Fri, Apr 2, 2021 at 5:59 AM kernel test robot <lkp@intel.com> wrote:
> > >
> > > 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
> > > Reported-by: kernel test robot <lkp@intel.com>
> > >
> > > 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'
> > 
> > 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.
> 
> > 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

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

* [PATCH 4.9] ARM: 8723/2: always assume the "unified" syntax for assembly code
  2021-04-03 11:47     ` Greg Kroah-Hartman
@ 2021-04-05 19:08         ` Nathan Chancellor
  0 siblings, 0 replies; 8+ messages in thread
From: Nathan Chancellor @ 2021-04-05 19:08 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Sasha Levin
  Cc: Arnd Bergmann, Krzysztof Kozlowski, Nick Desaulniers,
	Nicolas Pitre, Russell King, Robin Murphy, kernel test robot,
	kbuild-all, stable

From: Nicolas Pitre <nicolas.pitre@linaro.org>

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.

Suggested-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
[nathan: Resolve small conflict on 4.9 due to a lack of 494609701e06a]
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---

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@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(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index ae55f5db97f8..9dbaa283f01d 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -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
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index e14ddca59d02..975b110e7d87 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -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
 
diff --git a/arch/arm/include/asm/unified.h b/arch/arm/include/asm/unified.h
index a91ae499614c..2c3b952be63e 100644
--- a/arch/arm/include/asm/unified.h
+++ b/arch/arm/include/asm/unified.h
@@ -20,8 +20,10 @@
 #ifndef __ASM_UNIFIED_H
 #define __ASM_UNIFIED_H
 
-#if defined(__ASSEMBLY__) && defined(CONFIG_ARM_ASM_UNIFIED)
+#if defined(__ASSEMBLY__)
 	.syntax unified
+#else
+__asm__(".syntax unified");
 #endif
 
 #ifdef CONFIG_CPU_V7M
@@ -64,77 +66,4 @@
 
 #endif	/* CONFIG_THUMB2_KERNEL */
 
-#ifndef CONFIG_ARM_ASM_UNIFIED
-
-/*
- * If the unified assembly syntax isn't used (in ARM mode), these
- * macros expand to an empty string
- */
-#ifdef __ASSEMBLY__
-	.macro	it, cond
-	.endm
-	.macro	itt, cond
-	.endm
-	.macro	ite, cond
-	.endm
-	.macro	ittt, cond
-	.endm
-	.macro	itte, cond
-	.endm
-	.macro	itet, cond
-	.endm
-	.macro	itee, cond
-	.endm
-	.macro	itttt, cond
-	.endm
-	.macro	ittte, cond
-	.endm
-	.macro	ittet, cond
-	.endm
-	.macro	ittee, cond
-	.endm
-	.macro	itett, cond
-	.endm
-	.macro	itete, cond
-	.endm
-	.macro	iteet, cond
-	.endm
-	.macro	iteee, cond
-	.endm
-#else	/* !__ASSEMBLY__ */
-__asm__(
-"	.macro	it, cond\n"
-"	.endm\n"
-"	.macro	itt, cond\n"
-"	.endm\n"
-"	.macro	ite, cond\n"
-"	.endm\n"
-"	.macro	ittt, cond\n"
-"	.endm\n"
-"	.macro	itte, cond\n"
-"	.endm\n"
-"	.macro	itet, cond\n"
-"	.endm\n"
-"	.macro	itee, cond\n"
-"	.endm\n"
-"	.macro	itttt, cond\n"
-"	.endm\n"
-"	.macro	ittte, cond\n"
-"	.endm\n"
-"	.macro	ittet, cond\n"
-"	.endm\n"
-"	.macro	ittee, cond\n"
-"	.endm\n"
-"	.macro	itett, cond\n"
-"	.endm\n"
-"	.macro	itete, cond\n"
-"	.endm\n"
-"	.macro	iteet, cond\n"
-"	.endm\n"
-"	.macro	iteee, cond\n"
-"	.endm\n");
-#endif	/* __ASSEMBLY__ */
-
-#endif	/* CONFIG_ARM_ASM_UNIFIED */
-
 #endif	/* !__ASM_UNIFIED_H */
-- 
2.31.0


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

* [PATCH 4.9] ARM: 8723/2: always assume the "unified" syntax for assembly code
@ 2021-04-05 19:08         ` Nathan Chancellor
  0 siblings, 0 replies; 8+ messages in thread
From: Nathan Chancellor @ 2021-04-05 19:08 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 5748 bytes --]

From: Nicolas Pitre <nicolas.pitre@linaro.org>

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.

Suggested-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
[nathan: Resolve small conflict on 4.9 due to a lack of 494609701e06a]
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---

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

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index ae55f5db97f8..9dbaa283f01d 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -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
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index e14ddca59d02..975b110e7d87 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -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
 
diff --git a/arch/arm/include/asm/unified.h b/arch/arm/include/asm/unified.h
index a91ae499614c..2c3b952be63e 100644
--- a/arch/arm/include/asm/unified.h
+++ b/arch/arm/include/asm/unified.h
@@ -20,8 +20,10 @@
 #ifndef __ASM_UNIFIED_H
 #define __ASM_UNIFIED_H
 
-#if defined(__ASSEMBLY__) && defined(CONFIG_ARM_ASM_UNIFIED)
+#if defined(__ASSEMBLY__)
 	.syntax unified
+#else
+__asm__(".syntax unified");
 #endif
 
 #ifdef CONFIG_CPU_V7M
@@ -64,77 +66,4 @@
 
 #endif	/* CONFIG_THUMB2_KERNEL */
 
-#ifndef CONFIG_ARM_ASM_UNIFIED
-
-/*
- * If the unified assembly syntax isn't used (in ARM mode), these
- * macros expand to an empty string
- */
-#ifdef __ASSEMBLY__
-	.macro	it, cond
-	.endm
-	.macro	itt, cond
-	.endm
-	.macro	ite, cond
-	.endm
-	.macro	ittt, cond
-	.endm
-	.macro	itte, cond
-	.endm
-	.macro	itet, cond
-	.endm
-	.macro	itee, cond
-	.endm
-	.macro	itttt, cond
-	.endm
-	.macro	ittte, cond
-	.endm
-	.macro	ittet, cond
-	.endm
-	.macro	ittee, cond
-	.endm
-	.macro	itett, cond
-	.endm
-	.macro	itete, cond
-	.endm
-	.macro	iteet, cond
-	.endm
-	.macro	iteee, cond
-	.endm
-#else	/* !__ASSEMBLY__ */
-__asm__(
-"	.macro	it, cond\n"
-"	.endm\n"
-"	.macro	itt, cond\n"
-"	.endm\n"
-"	.macro	ite, cond\n"
-"	.endm\n"
-"	.macro	ittt, cond\n"
-"	.endm\n"
-"	.macro	itte, cond\n"
-"	.endm\n"
-"	.macro	itet, cond\n"
-"	.endm\n"
-"	.macro	itee, cond\n"
-"	.endm\n"
-"	.macro	itttt, cond\n"
-"	.endm\n"
-"	.macro	ittte, cond\n"
-"	.endm\n"
-"	.macro	ittet, cond\n"
-"	.endm\n"
-"	.macro	ittee, cond\n"
-"	.endm\n"
-"	.macro	itett, cond\n"
-"	.endm\n"
-"	.macro	itete, cond\n"
-"	.endm\n"
-"	.macro	iteet, cond\n"
-"	.endm\n"
-"	.macro	iteee, cond\n"
-"	.endm\n");
-#endif	/* __ASSEMBLY__ */
-
-#endif	/* CONFIG_ARM_ASM_UNIFIED */
-
 #endif	/* !__ASM_UNIFIED_H */
-- 
2.31.0

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

* Re: [PATCH 4.9] ARM: 8723/2: always assume the "unified" syntax for assembly code
  2021-04-05 19:08         ` Nathan Chancellor
@ 2021-04-10 11:09           ` Greg Kroah-Hartman
  -1 siblings, 0 replies; 8+ messages in thread
From: Greg Kroah-Hartman @ 2021-04-10 11:09 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Sasha Levin, Arnd Bergmann, Krzysztof Kozlowski,
	Nick Desaulniers, Nicolas Pitre, Russell King, Robin Murphy,
	kernel test robot, kbuild-all, stable

On Mon, Apr 05, 2021 at 12:08:27PM -0700, Nathan Chancellor wrote:
> From: Nicolas Pitre <nicolas.pitre@linaro.org>
> 
> 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.
> 
> Suggested-by: Robin Murphy <robin.murphy@arm.com>
> Signed-off-by: Nicolas Pitre <nico@linaro.org>
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
> [nathan: Resolve small conflict on 4.9 due to a lack of 494609701e06a]
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
> 
> 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@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

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

* Re: [PATCH 4.9] ARM: 8723/2: always assume the "unified" syntax for assembly code
@ 2021-04-10 11:09           ` Greg Kroah-Hartman
  0 siblings, 0 replies; 8+ messages in thread
From: Greg Kroah-Hartman @ 2021-04-10 11:09 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 1960 bytes --]

On Mon, Apr 05, 2021 at 12:08:27PM -0700, Nathan Chancellor wrote:
> From: Nicolas Pitre <nicolas.pitre@linaro.org>
> 
> 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.
> 
> Suggested-by: Robin Murphy <robin.murphy@arm.com>
> Signed-off-by: Nicolas Pitre <nico@linaro.org>
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
> [nathan: Resolve small conflict on 4.9 due to a lack of 494609701e06a]
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
> 
> 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.

Now queued up, thanks.

greg k-h

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

end of thread, other threads:[~2021-04-10 11:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-02  3:59 [linux-stable-rc:linux-4.9.y 1825/2149] drivers/spi/spi-s3c24xx-fiq.S:52: Error: bad instruction `subsne pc, lr, #4' kernel test robot
2021-04-03 11:00 ` Arnd Bergmann
2021-04-03 11:34   ` Nathan Chancellor
2021-04-03 11:47     ` Greg Kroah-Hartman
2021-04-05 19:08       ` [PATCH 4.9] ARM: 8723/2: always assume the "unified" syntax for assembly code Nathan Chancellor
2021-04-05 19:08         ` Nathan Chancellor
2021-04-10 11:09         ` Greg Kroah-Hartman
2021-04-10 11:09           ` Greg Kroah-Hartman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.