aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-11-04 17:26:30 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-11-04 17:26:30 -0400
commit2d6349944d967129c1da3c47287376f10121dbe1 (patch)
treebdac217045cf59066726709699db0dc62ecd6bda
parentf0a32ee42f73a7e6229d6dd68d222a507447acd7 (diff)
parentdad4675388fcb4353aea64174a165fb8494f1c13 (diff)
Merge branch 'fixes' of git://git.armlinux.org.uk/~rmk/linux-arm
Pull ARM fixes from Russell King: - omit EFI memory map sorting, which was recently introduced, but caused problems with the decompressor due to additional sections being emitted. - avoid unaligned load fault-generating instructions in the decompressor by switching to a private unaligned implementation. - add a symbol into the decompressor to further debug non-boot situations (ld's documentation is extremely poor for how "." works, ld doesn't seem to follow its own documentation!) - parse endian information to sparse * 'fixes' of git://git.armlinux.org.uk/~rmk/linux-arm: ARM: add debug ".edata_real" symbol ARM: 8716/1: pass endianness info to sparse efi/libstub: arm: omit sorting of the UEFI memory map ARM: 8715/1: add a private asm/unaligned.h
-rw-r--r--arch/arm/Makefile2
-rw-r--r--arch/arm/boot/compressed/vmlinux.lds.S9
-rw-r--r--arch/arm/include/asm/Kbuild1
-rw-r--r--arch/arm/include/asm/unaligned.h27
-rw-r--r--drivers/firmware/efi/libstub/Makefile6
-rw-r--r--drivers/firmware/efi/libstub/arm-stub.c7
6 files changed, 46 insertions, 6 deletions
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 817e5cfef83a..36ae4454554c 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -44,10 +44,12 @@ endif
44 44
45ifeq ($(CONFIG_CPU_BIG_ENDIAN),y) 45ifeq ($(CONFIG_CPU_BIG_ENDIAN),y)
46KBUILD_CPPFLAGS += -mbig-endian 46KBUILD_CPPFLAGS += -mbig-endian
47CHECKFLAGS += -D__ARMEB__
47AS += -EB 48AS += -EB
48LD += -EB 49LD += -EB
49else 50else
50KBUILD_CPPFLAGS += -mlittle-endian 51KBUILD_CPPFLAGS += -mlittle-endian
52CHECKFLAGS += -D__ARMEL__
51AS += -EL 53AS += -EL
52LD += -EL 54LD += -EL
53endif 55endif
diff --git a/arch/arm/boot/compressed/vmlinux.lds.S b/arch/arm/boot/compressed/vmlinux.lds.S
index 7a4c59154361..7d06aa19c3e6 100644
--- a/arch/arm/boot/compressed/vmlinux.lds.S
+++ b/arch/arm/boot/compressed/vmlinux.lds.S
@@ -85,6 +85,15 @@ SECTIONS
85 85
86 _edata = .; 86 _edata = .;
87 87
88 /*
89 * The image_end section appears after any additional loadable sections
90 * that the linker may decide to insert in the binary image. Having
91 * this symbol allows further debug in the near future.
92 */
93 .image_end (NOLOAD) : {
94 _edata_real = .;
95 }
96
88 _magic_sig = ZIMAGE_MAGIC(0x016f2818); 97 _magic_sig = ZIMAGE_MAGIC(0x016f2818);
89 _magic_start = ZIMAGE_MAGIC(_start); 98 _magic_start = ZIMAGE_MAGIC(_start);
90 _magic_end = ZIMAGE_MAGIC(_edata); 99 _magic_end = ZIMAGE_MAGIC(_edata);
diff --git a/arch/arm/include/asm/Kbuild b/arch/arm/include/asm/Kbuild
index 721ab5ecfb9b..0f2c8a2a8131 100644
--- a/arch/arm/include/asm/Kbuild
+++ b/arch/arm/include/asm/Kbuild
@@ -20,7 +20,6 @@ generic-y += simd.h
20generic-y += sizes.h 20generic-y += sizes.h
21generic-y += timex.h 21generic-y += timex.h
22generic-y += trace_clock.h 22generic-y += trace_clock.h
23generic-y += unaligned.h
24 23
25generated-y += mach-types.h 24generated-y += mach-types.h
26generated-y += unistd-nr.h 25generated-y += unistd-nr.h
diff --git a/arch/arm/include/asm/unaligned.h b/arch/arm/include/asm/unaligned.h
new file mode 100644
index 000000000000..ab905ffcf193
--- /dev/null
+++ b/arch/arm/include/asm/unaligned.h
@@ -0,0 +1,27 @@
1#ifndef __ASM_ARM_UNALIGNED_H
2#define __ASM_ARM_UNALIGNED_H
3
4/*
5 * We generally want to set CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS on ARMv6+,
6 * but we don't want to use linux/unaligned/access_ok.h since that can lead
7 * to traps on unaligned stm/ldm or strd/ldrd.
8 */
9#include <asm/byteorder.h>
10
11#if defined(__LITTLE_ENDIAN)
12# include <linux/unaligned/le_struct.h>
13# include <linux/unaligned/be_byteshift.h>
14# include <linux/unaligned/generic.h>
15# define get_unaligned __get_unaligned_le
16# define put_unaligned __put_unaligned_le
17#elif defined(__BIG_ENDIAN)
18# include <linux/unaligned/be_struct.h>
19# include <linux/unaligned/le_byteshift.h>
20# include <linux/unaligned/generic.h>
21# define get_unaligned __get_unaligned_be
22# define put_unaligned __put_unaligned_be
23#else
24# error need to define endianess
25#endif
26
27#endif /* __ASM_ARM_UNALIGNED_H */
diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile
index 2371a92808be..adaa4a964f0c 100644
--- a/drivers/firmware/efi/libstub/Makefile
+++ b/drivers/firmware/efi/libstub/Makefile
@@ -34,13 +34,14 @@ lib-y := efi-stub-helper.o gop.o secureboot.o
34lib-$(CONFIG_RESET_ATTACK_MITIGATION) += tpm.o 34lib-$(CONFIG_RESET_ATTACK_MITIGATION) += tpm.o
35 35
36# include the stub's generic dependencies from lib/ when building for ARM/arm64 36# include the stub's generic dependencies from lib/ when building for ARM/arm64
37arm-deps := fdt_rw.c fdt_ro.c fdt_wip.c fdt.c fdt_empty_tree.c fdt_sw.c sort.c 37arm-deps-y := fdt_rw.c fdt_ro.c fdt_wip.c fdt.c fdt_empty_tree.c fdt_sw.c
38arm-deps-$(CONFIG_ARM64) += sort.c
38 39
39$(obj)/lib-%.o: $(srctree)/lib/%.c FORCE 40$(obj)/lib-%.o: $(srctree)/lib/%.c FORCE
40 $(call if_changed_rule,cc_o_c) 41 $(call if_changed_rule,cc_o_c)
41 42
42lib-$(CONFIG_EFI_ARMSTUB) += arm-stub.o fdt.o string.o random.o \ 43lib-$(CONFIG_EFI_ARMSTUB) += arm-stub.o fdt.o string.o random.o \
43 $(patsubst %.c,lib-%.o,$(arm-deps)) 44 $(patsubst %.c,lib-%.o,$(arm-deps-y))
44 45
45lib-$(CONFIG_ARM) += arm32-stub.o 46lib-$(CONFIG_ARM) += arm32-stub.o
46lib-$(CONFIG_ARM64) += arm64-stub.o 47lib-$(CONFIG_ARM64) += arm64-stub.o
@@ -91,5 +92,4 @@ quiet_cmd_stubcopy = STUBCPY $@
91# explicitly by the decompressor linker script. 92# explicitly by the decompressor linker script.
92# 93#
93STUBCOPY_FLAGS-$(CONFIG_ARM) += --rename-section .data=.data.efistub 94STUBCOPY_FLAGS-$(CONFIG_ARM) += --rename-section .data=.data.efistub
94STUBCOPY_RM-$(CONFIG_ARM) += -R ___ksymtab+sort -R ___kcrctab+sort
95STUBCOPY_RELOC-$(CONFIG_ARM) := R_ARM_ABS 95STUBCOPY_RELOC-$(CONFIG_ARM) := R_ARM_ABS
diff --git a/drivers/firmware/efi/libstub/arm-stub.c b/drivers/firmware/efi/libstub/arm-stub.c
index a94601d5939e..01a9d78ee415 100644
--- a/drivers/firmware/efi/libstub/arm-stub.c
+++ b/drivers/firmware/efi/libstub/arm-stub.c
@@ -350,7 +350,9 @@ void efi_get_virtmap(efi_memory_desc_t *memory_map, unsigned long map_size,
350 * The easiest way to find adjacent regions is to sort the memory map 350 * The easiest way to find adjacent regions is to sort the memory map
351 * before traversing it. 351 * before traversing it.
352 */ 352 */
353 sort(memory_map, map_size / desc_size, desc_size, cmp_mem_desc, NULL); 353 if (IS_ENABLED(CONFIG_ARM64))
354 sort(memory_map, map_size / desc_size, desc_size, cmp_mem_desc,
355 NULL);
354 356
355 for (l = 0; l < map_size; l += desc_size, prev = in) { 357 for (l = 0; l < map_size; l += desc_size, prev = in) {
356 u64 paddr, size; 358 u64 paddr, size;
@@ -367,7 +369,8 @@ void efi_get_virtmap(efi_memory_desc_t *memory_map, unsigned long map_size,
367 * a 4k page size kernel to kexec a 64k page size kernel and 369 * a 4k page size kernel to kexec a 64k page size kernel and
368 * vice versa. 370 * vice versa.
369 */ 371 */
370 if (!regions_are_adjacent(prev, in) || 372 if ((IS_ENABLED(CONFIG_ARM64) &&
373 !regions_are_adjacent(prev, in)) ||
371 !regions_have_compatible_memory_type_attrs(prev, in)) { 374 !regions_have_compatible_memory_type_attrs(prev, in)) {
372 375
373 paddr = round_down(in->phys_addr, SZ_64K); 376 paddr = round_down(in->phys_addr, SZ_64K);