summaryrefslogtreecommitdiffstats
path: root/arch/arm/boot/compressed/efi-header.S
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2017-05-24 16:31:57 +0200
committerRussell King <rmk+kernel@armlinux.org.uk>2017-06-05 11:29:40 +0200
commit06a4b6d009a1b74a6ec46c5418b46cc53a79fcb8 (patch)
treec56eee8aecc36198c7f3909f99effa5e802b263e /arch/arm/boot/compressed/efi-header.S
parentARM: 8676/1: NOMMU: provide pgprot_device() macro (diff)
downloadlinux-06a4b6d009a1b74a6ec46c5418b46cc53a79fcb8.tar.xz
linux-06a4b6d009a1b74a6ec46c5418b46cc53a79fcb8.zip
ARM: 8677/1: boot/compressed: fix decompressor header layout for v7-M
As reported by Patrice, the header layout of the decompressor is incorrect when building for v7-M. In this case, the __nop macro resolves to 'mov r0, r0', which is emitted as a narrow encoding, resulting in the header data fields to end up at lower offsets than required. Given the variety of targets we need to support with the same code, the startup sequence is a bit of a jumble, and uses instructions and macros whose encoding widths cannot be specified (badr), or only exist in a narrow encoding (bx) So force the use of a wide encoding in __nop, and replace the start sequence with a simple jump to the label marking the start of code, preceded by a Thumb2 mode switch if required (using explicit wide encodings where appropriate). The label itself can be moved to the start of code [where it belongs] due to the larger range of branch instructions as compared to adr instructions. Reported-by: Patrice CHOTARD <patrice.chotard@st.com> Acked-by: Nicolas Pitre <nico@linaro.org> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Diffstat (limited to 'arch/arm/boot/compressed/efi-header.S')
-rw-r--r--arch/arm/boot/compressed/efi-header.S4
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/arm/boot/compressed/efi-header.S b/arch/arm/boot/compressed/efi-header.S
index 9d5dc4fda3c1..3f7d1b74c5e0 100644
--- a/arch/arm/boot/compressed/efi-header.S
+++ b/arch/arm/boot/compressed/efi-header.S
@@ -17,14 +17,12 @@
@ there.
.inst 'M' | ('Z' << 8) | (0x1310 << 16) @ tstne r0, #0x4d000
#else
- mov r0, r0
+ W(mov) r0, r0
#endif
.endm
.macro __EFI_HEADER
#ifdef CONFIG_EFI_STUB
- b __efi_start
-
.set start_offset, __efi_start - start
.org start + 0x3c
@