[PATCH] powerpc: fix invalid use of register expressions

Michael Ellerman mpe at ellerman.id.au
Tue Aug 8 21:32:44 AEST 2017


Andreas Schwab <schwab at linux-m68k.org> writes:

> binutils >= 2.26 now warns about misuse of register expressions in
> assembler operands that are actually literals, for example:
>
> arch/powerpc/kernel/entry_64.S:535: Warning: invalid register expression
>
> Signed-off-by: Andreas Schwab <schwab at linux-m68k.org>
> ---
>  arch/powerpc/include/asm/ppc_asm.h |  2 +-
>  arch/powerpc/kernel/swsusp_asm64.S |  2 +-
>  arch/powerpc/kvm/book3s_64_slb.S   |  2 +-
>  arch/powerpc/lib/copypage_power7.S | 14 ++++----
>  arch/powerpc/lib/copyuser_power7.S | 66 +++++++++++++++++++-------------------
>  arch/powerpc/lib/memcpy_power7.S   | 66 +++++++++++++++++++-------------------
>  arch/powerpc/lib/string_64.S       |  2 +-
>  7 files changed, 77 insertions(+), 77 deletions(-)

Thanks. I updated the change log to mention that it's almost always
s/r0/0/.

And I folded in:

diff --git a/arch/powerpc/purgatory/trampoline.S b/arch/powerpc/purgatory/trampoline.S
index 3696ea6c4826..30277446892c 100644
--- a/arch/powerpc/purgatory/trampoline.S
+++ b/arch/powerpc/purgatory/trampoline.S
@@ -67,7 +67,7 @@ master:
 	mr	%r16,%r3	/* save dt address in reg16 */
 	li	%r4,20
 	LWZX_BE	%r6,%r3,%r4	/* fetch __be32 version number at byte 20 */
-	cmpwi	%r0,%r6,2	/* v2 or later? */
+	cmpwi	%cr0,%r6,2	/* v2 or later? */
 	blt	1f
 	li	%r4,28
 	STWX_BE	%r17,%r3,%r4	/* Store my cpu as __be32 at byte 28 */

cheers


More information about the Linuxppc-dev mailing list