]> git.baikalelectronics.ru Git - kernel.git/commit
ARM: 8680/1: boot/compressed: fix inappropriate Thumb2 mnemonic for __nop
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 9 Jun 2017 09:14:53 +0000 (10:14 +0100)
committerRussell King <rmk+kernel@armlinux.org.uk>
Mon, 12 Jun 2017 14:47:27 +0000 (15:47 +0100)
commitb38f2c6abd6be8248f028936c0ed6e7051e5d3ac
treefeada373be9aad576df706d119039e661ecc6e19
parentbc225662515fdbc69909547ca1850a606bec6f42
ARM: 8680/1: boot/compressed: fix inappropriate Thumb2 mnemonic for __nop

Commit bc225662515f ("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: bc225662515f ("ARM: 8677/1: boot/compressed: fix decompressor ...")
Reported-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
arch/arm/boot/compressed/efi-header.S