On Thu, 28 Jan 2021 at 20:34, Nick Desaulniers <[email protected]> wrote:
>
> Clang's integrated assembler only accepts UAL syntax, rewrite the
> instructions that were changed by RVCTv2.1.
>
> The document "Assembly language changes after RVCTv2.1" was very
> helpful.
>
> This exposed a bug in Clang's integrated assembler, which hopefully will
> land in clang-12, but is required to test this patch with LLVM_IAS=1.
>
> Link: https://developer.arm.com/documentation/dui0473/c/writing-arm-assembly-language/assembly-language-changes-after-rvctv2-1
> Link: https://github.com/ClangBuiltLinux/linux/issues/1271
> Link: https://reviews.llvm.org/D95586
> Reported-by: Arnd Bergmann <[email protected]>
> Signed-off-by: Nick Desaulniers <[email protected]>
> ---
> * Fix additonal swpvsb case in test-arm.c when __LINUX_ARM_ARCH__ < 6,
> reported by Arnd.
> * Fix arch/arm/probes/kprobes/test-thumb.c, reported by Arnd.
> * Modify the oneline to note I'm modifying test-*.c.
>
> arch/arm/probes/kprobes/test-arm.c | 290 +++++++++++++--------------
> arch/arm/probes/kprobes/test-thumb.c | 20 +-
> 2 files changed, 155 insertions(+), 155 deletions(-)
>
...
> diff --git a/arch/arm/probes/kprobes/test-thumb.c b/arch/arm/probes/kprobes/test-thumb.c
> index 456c181a7bfe..63277c1006b9 100644
> --- a/arch/arm/probes/kprobes/test-thumb.c
> +++ b/arch/arm/probes/kprobes/test-thumb.c
> @@ -441,21 +441,21 @@ void kprobe_thumb32_test_cases(void)
> "3: mvn r0, r0 \n\t"
> "2: nop \n\t")
>
> - TEST_RX("tbh [pc, r",7, (9f-(1f+4))>>1,"]",
> + TEST_RX("tbh [pc, r",7, (9f-(1f+4))>>1,", lsl #1]",
Why is this change needed? Are the resulting opcodes equivalent? Does
GAS infer the lsl #1 but Clang doesn't?
> "9: \n\t"
> ".short (2f-1b-4)>>1 \n\t"
> ".short (3f-1b-4)>>1 \n\t"
> "3: mvn r0, r0 \n\t"
> "2: nop \n\t")
>
> - TEST_RX("tbh [pc, r",12, ((9f-(1f+4))>>1)+1,"]",
> + TEST_RX("tbh [pc, r",12, ((9f-(1f+4))>>1)+1,", lsl #1]",
> "9: \n\t"
> ".short (2f-1b-4)>>1 \n\t"
> ".short (3f-1b-4)>>1 \n\t"
> "3: mvn r0, r0 \n\t"
> "2: nop \n\t")
>
> - TEST_RRX("tbh [r",1,9f, ", r",14,1,"]",
> + TEST_RRX("tbh [r",1,9f, ", r",14,1,", lsl #1]",
> "9: \n\t"
> ".short (2f-1b-4)>>1 \n\t"
> ".short (3f-1b-4)>>1 \n\t"
> @@ -468,15 +468,15 @@ void kprobe_thumb32_test_cases(void)
>
> TEST_UNSUPPORTED("strexb r0, r1, [r2]")
> TEST_UNSUPPORTED("strexh r0, r1, [r2]")
> - TEST_UNSUPPORTED("strexd r0, r1, [r2]")
> + TEST_UNSUPPORTED("strexd r0, r1, r2, [r2]")
> TEST_UNSUPPORTED("ldrexb r0, [r1]")
> TEST_UNSUPPORTED("ldrexh r0, [r1]")
> - TEST_UNSUPPORTED("ldrexd r0, [r1]")
> + TEST_UNSUPPORTED("ldrexd r0, r1, [r1]")
>
> TEST_GROUP("Data-processing (shifted register) and (modified immediate)")
>
> #define _DATA_PROCESSING32_DNM(op,s,val) \
> - TEST_RR(op s".w r0, r",1, VAL1,", r",2, val, "") \
> + TEST_RR(op s" r0, r",1, VAL1,", r",2, val, "") \
What is wrong with these .w suffixes? Shouldn't the assembler accept
these even on instructions that only exist in a wide encoding?
> TEST_RR(op s" r1, r",1, VAL1,", r",2, val, ", lsl #3") \
> TEST_RR(op s" r2, r",3, VAL1,", r",2, val, ", lsr #4") \
> TEST_RR(op s" r3, r",3, VAL1,", r",2, val, ", asr #5") \
> @@ -764,7 +764,7 @@ CONDITION_INSTRUCTIONS(22,
> TEST("nop.w")
> TEST("wfi.w")
> TEST_SUPPORTED("wfe.w")
> - TEST_UNSUPPORTED("dbg.w #0")
> + TEST_UNSUPPORTED("dbg #0")
>
> TEST_UNSUPPORTED("clrex")
> TEST_UNSUPPORTED("dsb")
> @@ -790,9 +790,9 @@ CONDITION_INSTRUCTIONS(22,
> TEST_BB( "b.w 2b")
> TEST_BF_X("b.w 2f", SPACE_0x1000)
>
> - TEST_BF( "bl.w 2f")
> - TEST_BB( "bl.w 2b")
> - TEST_BB_X("bl.w 2b", SPACE_0x1000)
> + TEST_BF( "bl 2f")
> + TEST_BB( "bl 2b")
> + TEST_BB_X("bl 2b", SPACE_0x1000)
>
> TEST_X( "blx __dummy_arm_subroutine",
> ".arm \n\t"
> --
> 2.30.0.365.g02bc693789-goog
>
On Thu, Jan 28, 2021 at 10:03 PM Ard Biesheuvel <[email protected]> wrote:
> On Thu, 28 Jan 2021 at 20:34, Nick Desaulniers <[email protected]> wrote:
> > @@ -468,15 +468,15 @@ void kprobe_thumb32_test_cases(void)
> >
> > TEST_UNSUPPORTED("strexb r0, r1, [r2]")
> > TEST_UNSUPPORTED("strexh r0, r1, [r2]")
> > - TEST_UNSUPPORTED("strexd r0, r1, [r2]")
> > + TEST_UNSUPPORTED("strexd r0, r1, r2, [r2]")
> > TEST_UNSUPPORTED("ldrexb r0, [r1]")
> > TEST_UNSUPPORTED("ldrexh r0, [r1]")
> > - TEST_UNSUPPORTED("ldrexd r0, [r1]")
> > + TEST_UNSUPPORTED("ldrexd r0, r1, [r1]")
> >
> > TEST_GROUP("Data-processing (shifted register) and (modified immediate)")
> >
> > #define _DATA_PROCESSING32_DNM(op,s,val) \
> > - TEST_RR(op s".w r0, r",1, VAL1,", r",2, val, "") \
> > + TEST_RR(op s" r0, r",1, VAL1,", r",2, val, "") \
>
> What is wrong with these .w suffixes? Shouldn't the assembler accept
> these even on instructions that only exist in a wide encoding?
I don't know if that is a bug in the integrated assembler or
intentional behavior, but it may be easier to just change the
kernel than the compiler in this case, as it also makes it work
for older versions.
FWIW, I needed a related change in a couple of other files:
diff --git a/arch/arm/lib/copy_from_user.S b/arch/arm/lib/copy_from_user.S
index 6acdfde56849..3ced01d9afe4 100644
--- a/arch/arm/lib/copy_from_user.S
+++ b/arch/arm/lib/copy_from_user.S
@@ -60,7 +60,7 @@
#define LDR1W_SHIFT 0
.macro ldr1w ptr reg abort
- USERL(\abort, W(ldr) \reg, [\ptr], #4)
+ USERL(\abort, ldr \reg, [\ptr], #4)
.endm
.macro ldr4w ptr reg1 reg2 reg3 reg4 abort
@@ -80,7 +80,7 @@
#define STR1W_SHIFT 0
.macro str1w ptr reg abort
- W(str) \reg, [\ptr], #4
+ str \reg, [\ptr], #4
.endm
.macro str8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort
diff --git a/arch/arm/lib/copy_to_user.S b/arch/arm/lib/copy_to_user.S
index 485fa3cffdbe..a6a96f814720 100644
--- a/arch/arm/lib/copy_to_user.S
+++ b/arch/arm/lib/copy_to_user.S
@@ -34,7 +34,7 @@
#define LDR1W_SHIFT 0
.macro ldr1w ptr reg abort
- W(ldr) \reg, [\ptr], #4
+ ldr \reg, [\ptr], #4
.endm
.macro ldr4w ptr reg1 reg2 reg3 reg4 abort
@@ -77,7 +77,7 @@
#define STR1W_SHIFT 0
.macro str1w ptr reg abort
- USERL(\abort, W(str) \reg, [\ptr], #4)
+ USERL(\abort, str \reg, [\ptr], #4)
.endm
.macro str8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort
diff --git a/arch/arm/lib/memcpy.S b/arch/arm/lib/memcpy.S
index e4caf48c089f..7b980a1a4227 100644
--- a/arch/arm/lib/memcpy.S
+++ b/arch/arm/lib/memcpy.S
@@ -15,7 +15,7 @@
#define STR1W_SHIFT 0
.macro ldr1w ptr reg abort
- W(ldr) \reg, [\ptr], #4
+ ldr \reg, [\ptr], #4
.endm
.macro ldr4w ptr reg1 reg2 reg3 reg4 abort
@@ -31,7 +31,7 @@
.endm
.macro str1w ptr reg abort
- W(str) \reg, [\ptr], #4
+ str \reg, [\ptr], #4
.endm
.macro str8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort
diff --git a/arch/arm/lib/memmove.S b/arch/arm/lib/memmove.S
index 6fecc12a1f51..35c5c06b7588 100644
--- a/arch/arm/lib/memmove.S
+++ b/arch/arm/lib/memmove.S
@@ -84,24 +84,24 @@ WEAK(memmove)
addne pc, pc, ip @ C is always clear here
b 7f
6: W(nop)
- W(ldr) r3, [r1, #-4]!
- W(ldr) r4, [r1, #-4]!
- W(ldr) r5, [r1, #-4]!
- W(ldr) r6, [r1, #-4]!
- W(ldr) r7, [r1, #-4]!
- W(ldr) r8, [r1, #-4]!
- W(ldr) lr, [r1, #-4]!
+ ldr r3, [r1, #-4]!
+ ldr r4, [r1, #-4]!
+ ldr r5, [r1, #-4]!
+ ldr r6, [r1, #-4]!
+ ldr r7, [r1, #-4]!
+ ldr r8, [r1, #-4]!
+ ldr lr, [r1, #-4]!
add pc, pc, ip
nop
W(nop)
- W(str) r3, [r0, #-4]!
- W(str) r4, [r0, #-4]!
- W(str) r5, [r0, #-4]!
- W(str) r6, [r0, #-4]!
- W(str) r7, [r0, #-4]!
- W(str) r8, [r0, #-4]!
- W(str) lr, [r0, #-4]!
+ str r3, [r0, #-4]!
+ str r4, [r0, #-4]!
+ str r5, [r0, #-4]!
+ str r6, [r0, #-4]!
+ str r7, [r0, #-4]!
+ str r8, [r0, #-4]!
+ str lr, [r0, #-4]!
CALGN( bcs 2b )
On Thu, 28 Jan 2021 at 23:28, Arnd Bergmann <[email protected]> wrote:
>
> On Thu, Jan 28, 2021 at 10:03 PM Ard Biesheuvel <[email protected]> wrote:
> > On Thu, 28 Jan 2021 at 20:34, Nick Desaulniers <[email protected]> wrote:
> > > @@ -468,15 +468,15 @@ void kprobe_thumb32_test_cases(void)
> > >
> > > TEST_UNSUPPORTED("strexb r0, r1, [r2]")
> > > TEST_UNSUPPORTED("strexh r0, r1, [r2]")
> > > - TEST_UNSUPPORTED("strexd r0, r1, [r2]")
> > > + TEST_UNSUPPORTED("strexd r0, r1, r2, [r2]")
> > > TEST_UNSUPPORTED("ldrexb r0, [r1]")
> > > TEST_UNSUPPORTED("ldrexh r0, [r1]")
> > > - TEST_UNSUPPORTED("ldrexd r0, [r1]")
> > > + TEST_UNSUPPORTED("ldrexd r0, r1, [r1]")
> > >
> > > TEST_GROUP("Data-processing (shifted register) and (modified immediate)")
> > >
> > > #define _DATA_PROCESSING32_DNM(op,s,val) \
> > > - TEST_RR(op s".w r0, r",1, VAL1,", r",2, val, "") \
> > > + TEST_RR(op s" r0, r",1, VAL1,", r",2, val, "") \
> >
> > What is wrong with these .w suffixes? Shouldn't the assembler accept
> > these even on instructions that only exist in a wide encoding?
>
> I don't know if that is a bug in the integrated assembler or
> intentional behavior, but it may be easier to just change the
> kernel than the compiler in this case, as it also makes it work
> for older versions.
>
> FWIW, I needed a related change in a couple of other files:
>
For fully specified test cases, I suppose removing the .w is fine. But
for the macros below, it really isn't: it depends on the actual
register assignment whether narrow encodings exist or not, and in that
case, we definitely want the wide one. The fact that instantiating the
macro in a different way can only produce wide encodings in the first
place should really not trigger an error.
Things like this can break the Thumb2 build very subtly, so if the
integrated assembler is not up to that, we should simply disable it
for Thumb2 builds.
> diff --git a/arch/arm/lib/copy_from_user.S b/arch/arm/lib/copy_from_user.S
> index 6acdfde56849..3ced01d9afe4 100644
> --- a/arch/arm/lib/copy_from_user.S
> +++ b/arch/arm/lib/copy_from_user.S
> @@ -60,7 +60,7 @@
> #define LDR1W_SHIFT 0
>
> .macro ldr1w ptr reg abort
> - USERL(\abort, W(ldr) \reg, [\ptr], #4)
> + USERL(\abort, ldr \reg, [\ptr], #4)
> .endm
>
> .macro ldr4w ptr reg1 reg2 reg3 reg4 abort
> @@ -80,7 +80,7 @@
> #define STR1W_SHIFT 0
>
> .macro str1w ptr reg abort
> - W(str) \reg, [\ptr], #4
> + str \reg, [\ptr], #4
> .endm
>
> .macro str8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort
> diff --git a/arch/arm/lib/copy_to_user.S b/arch/arm/lib/copy_to_user.S
> index 485fa3cffdbe..a6a96f814720 100644
> --- a/arch/arm/lib/copy_to_user.S
> +++ b/arch/arm/lib/copy_to_user.S
> @@ -34,7 +34,7 @@
> #define LDR1W_SHIFT 0
>
> .macro ldr1w ptr reg abort
> - W(ldr) \reg, [\ptr], #4
> + ldr \reg, [\ptr], #4
> .endm
>
> .macro ldr4w ptr reg1 reg2 reg3 reg4 abort
> @@ -77,7 +77,7 @@
> #define STR1W_SHIFT 0
>
> .macro str1w ptr reg abort
> - USERL(\abort, W(str) \reg, [\ptr], #4)
> + USERL(\abort, str \reg, [\ptr], #4)
> .endm
>
> .macro str8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort
> diff --git a/arch/arm/lib/memcpy.S b/arch/arm/lib/memcpy.S
> index e4caf48c089f..7b980a1a4227 100644
> --- a/arch/arm/lib/memcpy.S
> +++ b/arch/arm/lib/memcpy.S
> @@ -15,7 +15,7 @@
> #define STR1W_SHIFT 0
>
> .macro ldr1w ptr reg abort
> - W(ldr) \reg, [\ptr], #4
> + ldr \reg, [\ptr], #4
> .endm
>
> .macro ldr4w ptr reg1 reg2 reg3 reg4 abort
> @@ -31,7 +31,7 @@
> .endm
>
> .macro str1w ptr reg abort
> - W(str) \reg, [\ptr], #4
> + str \reg, [\ptr], #4
> .endm
>
> .macro str8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort
> diff --git a/arch/arm/lib/memmove.S b/arch/arm/lib/memmove.S
> index 6fecc12a1f51..35c5c06b7588 100644
> --- a/arch/arm/lib/memmove.S
> +++ b/arch/arm/lib/memmove.S
> @@ -84,24 +84,24 @@ WEAK(memmove)
> addne pc, pc, ip @ C is always clear here
> b 7f
> 6: W(nop)
> - W(ldr) r3, [r1, #-4]!
> - W(ldr) r4, [r1, #-4]!
> - W(ldr) r5, [r1, #-4]!
> - W(ldr) r6, [r1, #-4]!
> - W(ldr) r7, [r1, #-4]!
> - W(ldr) r8, [r1, #-4]!
> - W(ldr) lr, [r1, #-4]!
> + ldr r3, [r1, #-4]!
> + ldr r4, [r1, #-4]!
> + ldr r5, [r1, #-4]!
> + ldr r6, [r1, #-4]!
> + ldr r7, [r1, #-4]!
> + ldr r8, [r1, #-4]!
> + ldr lr, [r1, #-4]!
>
> add pc, pc, ip
> nop
> W(nop)
> - W(str) r3, [r0, #-4]!
> - W(str) r4, [r0, #-4]!
> - W(str) r5, [r0, #-4]!
> - W(str) r6, [r0, #-4]!
> - W(str) r7, [r0, #-4]!
> - W(str) r8, [r0, #-4]!
> - W(str) lr, [r0, #-4]!
> + str r3, [r0, #-4]!
> + str r4, [r0, #-4]!
> + str r5, [r0, #-4]!
> + str r6, [r0, #-4]!
> + str r7, [r0, #-4]!
> + str r8, [r0, #-4]!
> + str lr, [r0, #-4]!
>
> CALGN( bcs 2b )
> On Thu, 28 Jan 2021 at 20:34, Nick Desaulniers <[email protected]> wrote:
> > + TEST_RX("tbh [pc, r",7, (9f-(1f+4))>>1,", lsl #1]",
> >
> On Thu, Jan 28, 2021 at 1:03 PM Ard Biesheuvel <[email protected]> wrote:
> Why is this change needed? Are the resulting opcodes equivalent? Does
> GAS infer the lsl #1 but Clang doesn't?
Yes; it seems if you serialize/deserialize this using GNU `as` and
objdump, that's the canonical form (GNU objdump seems to print in UAL
form, IIUC). I didn't see anything specifically about `tbh` in
https://developer.arm.com/documentation/dui0473/c/writing-arm-assembly-language/assembly-language-changes-after-rvctv2-1?lang=en
but it's what GNU objdump produces and what clang's integrated
assembler accepts.
> >
> > #define _DATA_PROCESSING32_DNM(op,s,val) \
> > - TEST_RR(op s".w r0, r",1, VAL1,", r",2, val, "") \
> > + TEST_RR(op s" r0, r",1, VAL1,", r",2, val, "") \
>
> What is wrong with these .w suffixes? Shouldn't the assembler accept
> these even on instructions that only exist in a wide encoding?
Yeah, I'm not sure these have anything to do with UAL. Looking at
LLVM's sources and IIRC, LLVM has "InstAlias"es it uses for .w
suffixes. I think I need to fix those in LLVM for a couple
instructions, rather than modify these in kernel sources. I'll split
off the arm-test.c and thumb-test.c into separate patches, fix LLVM,
and drop the .w suffix changes to thumb-test.c.
--
Thanks,
~Nick Desaulniers
On Fri, 29 Jan 2021 at 00:30, Ard Biesheuvel <[email protected]> wrote:
>
> On Thu, 28 Jan 2021 at 23:28, Arnd Bergmann <[email protected]> wrote:
> >
> > On Thu, Jan 28, 2021 at 10:03 PM Ard Biesheuvel <[email protected]> wrote:
> > > On Thu, 28 Jan 2021 at 20:34, Nick Desaulniers <[email protected]> wrote:
> > > > @@ -468,15 +468,15 @@ void kprobe_thumb32_test_cases(void)
> > > >
> > > > TEST_UNSUPPORTED("strexb r0, r1, [r2]")
> > > > TEST_UNSUPPORTED("strexh r0, r1, [r2]")
> > > > - TEST_UNSUPPORTED("strexd r0, r1, [r2]")
> > > > + TEST_UNSUPPORTED("strexd r0, r1, r2, [r2]")
> > > > TEST_UNSUPPORTED("ldrexb r0, [r1]")
> > > > TEST_UNSUPPORTED("ldrexh r0, [r1]")
> > > > - TEST_UNSUPPORTED("ldrexd r0, [r1]")
> > > > + TEST_UNSUPPORTED("ldrexd r0, r1, [r1]")
> > > >
> > > > TEST_GROUP("Data-processing (shifted register) and (modified immediate)")
> > > >
> > > > #define _DATA_PROCESSING32_DNM(op,s,val) \
> > > > - TEST_RR(op s".w r0, r",1, VAL1,", r",2, val, "") \
> > > > + TEST_RR(op s" r0, r",1, VAL1,", r",2, val, "") \
> > >
> > > What is wrong with these .w suffixes? Shouldn't the assembler accept
> > > these even on instructions that only exist in a wide encoding?
> >
> > I don't know if that is a bug in the integrated assembler or
> > intentional behavior, but it may be easier to just change the
> > kernel than the compiler in this case, as it also makes it work
> > for older versions.
> >
> > FWIW, I needed a related change in a couple of other files:
> >
>
> For fully specified test cases, I suppose removing the .w is fine. But
> for the macros below, it really isn't: it depends on the actual
> register assignment whether narrow encodings exist or not, and in that
> case, we definitely want the wide one. The fact that instantiating the
> macro in a different way can only produce wide encodings in the first
> place should really not trigger an error.
>
> Things like this can break the Thumb2 build very subtly, so if the
> integrated assembler is not up to that, we should simply disable it
> for Thumb2 builds.
>
As mentioned in issue #1271, my observation here is not entirely accurate.
In the general case, macros that take register names as inputs can
produce narrow or wide opcodes depending on which exact registers are
being used (narrow opcodes mostly only support registers r0-r7)
However, in this particular case, all the ldr/str instructions are
either the pre-indexed or the post-indexed variants, for which only a
wide encoding exists, and so omitting the .w suffix is safe here.
However, if we apply the change below, can we please document this in
a comment, i.e., that encoding T4 is used for LDR/STR, and so the
result is guaranteed to be wide in spite of the missing suffix?
> > diff --git a/arch/arm/lib/copy_from_user.S b/arch/arm/lib/copy_from_user.S
> > index 6acdfde56849..3ced01d9afe4 100644
> > --- a/arch/arm/lib/copy_from_user.S
> > +++ b/arch/arm/lib/copy_from_user.S
> > @@ -60,7 +60,7 @@
> > #define LDR1W_SHIFT 0
> >
> > .macro ldr1w ptr reg abort
> > - USERL(\abort, W(ldr) \reg, [\ptr], #4)
> > + USERL(\abort, ldr \reg, [\ptr], #4)
> > .endm
> >
> > .macro ldr4w ptr reg1 reg2 reg3 reg4 abort
> > @@ -80,7 +80,7 @@
> > #define STR1W_SHIFT 0
> >
> > .macro str1w ptr reg abort
> > - W(str) \reg, [\ptr], #4
> > + str \reg, [\ptr], #4
> > .endm
> >
> > .macro str8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort
> > diff --git a/arch/arm/lib/copy_to_user.S b/arch/arm/lib/copy_to_user.S
> > index 485fa3cffdbe..a6a96f814720 100644
> > --- a/arch/arm/lib/copy_to_user.S
> > +++ b/arch/arm/lib/copy_to_user.S
> > @@ -34,7 +34,7 @@
> > #define LDR1W_SHIFT 0
> >
> > .macro ldr1w ptr reg abort
> > - W(ldr) \reg, [\ptr], #4
> > + ldr \reg, [\ptr], #4
> > .endm
> >
> > .macro ldr4w ptr reg1 reg2 reg3 reg4 abort
> > @@ -77,7 +77,7 @@
> > #define STR1W_SHIFT 0
> >
> > .macro str1w ptr reg abort
> > - USERL(\abort, W(str) \reg, [\ptr], #4)
> > + USERL(\abort, str \reg, [\ptr], #4)
> > .endm
> >
> > .macro str8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort
> > diff --git a/arch/arm/lib/memcpy.S b/arch/arm/lib/memcpy.S
> > index e4caf48c089f..7b980a1a4227 100644
> > --- a/arch/arm/lib/memcpy.S
> > +++ b/arch/arm/lib/memcpy.S
> > @@ -15,7 +15,7 @@
> > #define STR1W_SHIFT 0
> >
> > .macro ldr1w ptr reg abort
> > - W(ldr) \reg, [\ptr], #4
> > + ldr \reg, [\ptr], #4
> > .endm
> >
> > .macro ldr4w ptr reg1 reg2 reg3 reg4 abort
> > @@ -31,7 +31,7 @@
> > .endm
> >
> > .macro str1w ptr reg abort
> > - W(str) \reg, [\ptr], #4
> > + str \reg, [\ptr], #4
> > .endm
> >
> > .macro str8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort
> > diff --git a/arch/arm/lib/memmove.S b/arch/arm/lib/memmove.S
> > index 6fecc12a1f51..35c5c06b7588 100644
> > --- a/arch/arm/lib/memmove.S
> > +++ b/arch/arm/lib/memmove.S
> > @@ -84,24 +84,24 @@ WEAK(memmove)
> > addne pc, pc, ip @ C is always clear here
> > b 7f
> > 6: W(nop)
> > - W(ldr) r3, [r1, #-4]!
> > - W(ldr) r4, [r1, #-4]!
> > - W(ldr) r5, [r1, #-4]!
> > - W(ldr) r6, [r1, #-4]!
> > - W(ldr) r7, [r1, #-4]!
> > - W(ldr) r8, [r1, #-4]!
> > - W(ldr) lr, [r1, #-4]!
> > + ldr r3, [r1, #-4]!
> > + ldr r4, [r1, #-4]!
> > + ldr r5, [r1, #-4]!
> > + ldr r6, [r1, #-4]!
> > + ldr r7, [r1, #-4]!
> > + ldr r8, [r1, #-4]!
> > + ldr lr, [r1, #-4]!
> >
> > add pc, pc, ip
> > nop
> > W(nop)
> > - W(str) r3, [r0, #-4]!
> > - W(str) r4, [r0, #-4]!
> > - W(str) r5, [r0, #-4]!
> > - W(str) r6, [r0, #-4]!
> > - W(str) r7, [r0, #-4]!
> > - W(str) r8, [r0, #-4]!
> > - W(str) lr, [r0, #-4]!
> > + str r3, [r0, #-4]!
> > + str r4, [r0, #-4]!
> > + str r5, [r0, #-4]!
> > + str r6, [r0, #-4]!
> > + str r7, [r0, #-4]!
> > + str r8, [r0, #-4]!
> > + str lr, [r0, #-4]!
> >
> > CALGN( bcs 2b )