Skip to content

Commit 60ce285

Browse files
Ard BiesheuvelRussell King
authored andcommitted
ARM: 8680/1: boot/compressed: fix inappropriate Thumb2 mnemonic for __nop
Commit 06a4b6d ("ARM: 8677/1: boot/compressed: fix decompressor header layout for v7-M") fixed an issue in the layout of the header of the compressed kernel image that was caused by the assembler emitting narrow opcodes for 'mov r0, r0', and for this reason, the mnemonic was updated to use the W() macro, which will append the .w suffix (which forces a wide encoding) if required, i.e., when building the kernel in Thumb2 mode. However, this failed to take into account that on Thumb2 kernels built for CPUs that are also ARM capable, the entry point is entered in ARM mode, and so the instructions emitted here will be ARM instructions that only exist in a wide encoding to begin with, which is why the assembler rejects the .w suffix here and aborts the build with the following message: head.S: Assembler messages: head.S:132: Error: width suffixes are invalid in ARM mode -- `mov.w r0,r0' So replace the W(mov) with separate ARM and Thumb2 instructions, where the latter will only be used for THUMB2_ONLY builds. Fixes: 06a4b6d ("ARM: 8677/1: boot/compressed: fix decompressor ...") Reported-by: Arnd Bergmann <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Signed-off-by: Ard Biesheuvel <[email protected]> Signed-off-by: Russell King <[email protected]>
1 parent 06a4b6d commit 60ce285

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/arm/boot/compressed/efi-header.S

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
@ there.
1818
.inst 'M' | ('Z' << 8) | (0x1310 << 16) @ tstne r0, #0x4d000
1919
#else
20-
W(mov) r0, r0
20+
AR_CLASS( mov r0, r0 )
21+
M_CLASS( nop.w )
2122
#endif
2223
.endm
2324

0 commit comments

Comments
 (0)