linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: kexec: drop invalid assembly argument
@ 2020-02-05 22:59 Stefan Agner
  2020-02-05 23:54 ` Russell King - ARM Linux admin
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Agner @ 2020-02-05 22:59 UTC (permalink / raw)
  To: linux; +Cc: linux-arm-kernel, linux-kernel, clang-built-linux, Stefan Agner

The tst menomic has only a single #<const> argument in Thumb mode. There
is an ARM variant which allows to write #<const> as #<byte>, #<rot>
which probably is where the current syntax comes from.

It seems that binutils does not care about the additional parameter.
Clang however complains in Thumb2 mode:
arch/arm/kernel/relocate_kernel.S:28:12: error: too many operands for
instruction
 tst r3,#1,0
           ^

Drop the unnecessary parameter. This fixes building this file in Thumb2
mode with the Clang integrated assembler.

Link: https://github.com/ClangBuiltLinux/linux/issues/770
Signed-off-by: Stefan Agner <stefan@agner.ch>
---
 arch/arm/kernel/relocate_kernel.S | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/kernel/relocate_kernel.S b/arch/arm/kernel/relocate_kernel.S
index 7eaa2ae7aff5..72a08786e16e 100644
--- a/arch/arm/kernel/relocate_kernel.S
+++ b/arch/arm/kernel/relocate_kernel.S
@@ -25,26 +25,26 @@ ENTRY(relocate_new_kernel)
 	ldr	r3, [r0],#4
 
 	/* Is it a destination page. Put destination address to r4 */
-	tst	r3,#1,0
+	tst	r3,#1
 	beq	1f
 	bic	r4,r3,#1
 	b	0b
 1:
 	/* Is it an indirection page */
-	tst	r3,#2,0
+	tst	r3,#2
 	beq	1f
 	bic	r0,r3,#2
 	b	0b
 1:
 
 	/* are we done ? */
-	tst	r3,#4,0
+	tst	r3,#4
 	beq	1f
 	b	2f
 
 1:
 	/* is it source ? */
-	tst	r3,#8,0
+	tst	r3,#8
 	beq	0b
 	bic r3,r3,#8
 	mov r6,#1024
-- 
2.25.0


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

* Re: [PATCH] ARM: kexec: drop invalid assembly argument
  2020-02-05 22:59 [PATCH] ARM: kexec: drop invalid assembly argument Stefan Agner
@ 2020-02-05 23:54 ` Russell King - ARM Linux admin
  2020-02-21 21:09   ` Nick Desaulniers
  0 siblings, 1 reply; 3+ messages in thread
From: Russell King - ARM Linux admin @ 2020-02-05 23:54 UTC (permalink / raw)
  To: Stefan Agner; +Cc: clang-built-linux, linux-kernel, linux-arm-kernel

On Wed, Feb 05, 2020 at 11:59:26PM +0100, Stefan Agner wrote:
> The tst menomic has only a single #<const> argument in Thumb mode. There
> is an ARM variant which allows to write #<const> as #<byte>, #<rot>
> which probably is where the current syntax comes from.
> 
> It seems that binutils does not care about the additional parameter.
> Clang however complains in Thumb2 mode:
> arch/arm/kernel/relocate_kernel.S:28:12: error: too many operands for
> instruction
>  tst r3,#1,0
>            ^
> 
> Drop the unnecessary parameter. This fixes building this file in Thumb2
> mode with the Clang integrated assembler.
> 
> Link: https://github.com/ClangBuiltLinux/linux/issues/770
> Signed-off-by: Stefan Agner <stefan@agner.ch>

Please drop it in the patch system, thanks.

> ---
>  arch/arm/kernel/relocate_kernel.S | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/kernel/relocate_kernel.S b/arch/arm/kernel/relocate_kernel.S
> index 7eaa2ae7aff5..72a08786e16e 100644
> --- a/arch/arm/kernel/relocate_kernel.S
> +++ b/arch/arm/kernel/relocate_kernel.S
> @@ -25,26 +25,26 @@ ENTRY(relocate_new_kernel)
>  	ldr	r3, [r0],#4
>  
>  	/* Is it a destination page. Put destination address to r4 */
> -	tst	r3,#1,0
> +	tst	r3,#1
>  	beq	1f
>  	bic	r4,r3,#1
>  	b	0b
>  1:
>  	/* Is it an indirection page */
> -	tst	r3,#2,0
> +	tst	r3,#2
>  	beq	1f
>  	bic	r0,r3,#2
>  	b	0b
>  1:
>  
>  	/* are we done ? */
> -	tst	r3,#4,0
> +	tst	r3,#4
>  	beq	1f
>  	b	2f
>  
>  1:
>  	/* is it source ? */
> -	tst	r3,#8,0
> +	tst	r3,#8
>  	beq	0b
>  	bic r3,r3,#8
>  	mov r6,#1024
> -- 
> 2.25.0
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up

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

* Re: [PATCH] ARM: kexec: drop invalid assembly argument
  2020-02-05 23:54 ` Russell King - ARM Linux admin
@ 2020-02-21 21:09   ` Nick Desaulniers
  0 siblings, 0 replies; 3+ messages in thread
From: Nick Desaulniers @ 2020-02-21 21:09 UTC (permalink / raw)
  To: Stefan Agner
  Cc: clang-built-linux, LKML, Linux ARM, Russell King - ARM Linux admin

On Wed, Feb 5, 2020 at 3:54 PM Russell King - ARM Linux admin
<linux@armlinux.org.uk> wrote:
>
> On Wed, Feb 05, 2020 at 11:59:26PM +0100, Stefan Agner wrote:
> > The tst menomic has only a single #<const> argument in Thumb mode. There
> > is an ARM variant which allows to write #<const> as #<byte>, #<rot>
> > which probably is where the current syntax comes from.
> >
> > It seems that binutils does not care about the additional parameter.
> > Clang however complains in Thumb2 mode:
> > arch/arm/kernel/relocate_kernel.S:28:12: error: too many operands for
> > instruction
> >  tst r3,#1,0
> >            ^
> >
> > Drop the unnecessary parameter. This fixes building this file in Thumb2
> > mode with the Clang integrated assembler.
> >
> > Link: https://github.com/ClangBuiltLinux/linux/issues/770
> > Signed-off-by: Stefan Agner <stefan@agner.ch>
>
> Please drop it in the patch system, thanks.

Hi Stefan, did you add this to the patch tracking system? Looks like a
bunch got accepted, but I didn't see it in:
https://www.armlinux.org.uk/developer/patches/section.php?section=20&page=132

>
> > ---
> >  arch/arm/kernel/relocate_kernel.S | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/arch/arm/kernel/relocate_kernel.S b/arch/arm/kernel/relocate_kernel.S
> > index 7eaa2ae7aff5..72a08786e16e 100644
> > --- a/arch/arm/kernel/relocate_kernel.S
> > +++ b/arch/arm/kernel/relocate_kernel.S
> > @@ -25,26 +25,26 @@ ENTRY(relocate_new_kernel)
> >       ldr     r3, [r0],#4
> >
> >       /* Is it a destination page. Put destination address to r4 */
> > -     tst     r3,#1,0
> > +     tst     r3,#1
> >       beq     1f
> >       bic     r4,r3,#1
> >       b       0b
> >  1:
> >       /* Is it an indirection page */
> > -     tst     r3,#2,0
> > +     tst     r3,#2
> >       beq     1f
> >       bic     r0,r3,#2
> >       b       0b
> >  1:
> >
> >       /* are we done ? */
> > -     tst     r3,#4,0
> > +     tst     r3,#4
> >       beq     1f
> >       b       2f
> >
> >  1:
> >       /* is it source ? */
> > -     tst     r3,#8,0
> > +     tst     r3,#8
> >       beq     0b
> >       bic r3,r3,#8
> >       mov r6,#1024
> > --
> > 2.25.0
> >
> >
> > _______________________________________________
> > linux-arm-kernel mailing list
> > linux-arm-kernel@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> >
>
> --
> RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
> FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
> According to speedtest.net: 11.9Mbps down 500kbps up
>
> --
> You received this message because you are subscribed to the Google Groups "Clang Built Linux" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-linux+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/20200205235440.GW25745%40shell.armlinux.org.uk.



-- 
Thanks,
~Nick Desaulniers

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

end of thread, other threads:[~2020-02-21 21:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-05 22:59 [PATCH] ARM: kexec: drop invalid assembly argument Stefan Agner
2020-02-05 23:54 ` Russell King - ARM Linux admin
2020-02-21 21:09   ` Nick Desaulniers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).