Pull ARM updates from Russell King: - remove a now unnecessary usage of the KERNEL_DS for sys_oabi_epoll_ctl() - update my email address in a number of drivers - decompressor EFI updates from Ard Biesheuvel - module unwind section handling updates - sparsemem Kconfig cleanups - make act_mm macro respect THREAD_SIZE * tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm: ARM: 8980/1: Allow either FLATMEM or SPARSEMEM on the multiplatform build ARM: 8979/1: Remove redundant ARCH_SPARSEMEM_DEFAULT setting ARM: 8978/1: mm: make act_mm() respect THREAD_SIZE ARM: decompressor: run decompressor in place if loaded via UEFI ARM: decompressor: move GOT into .data for EFI enabled builds ARM: decompressor: defer loading of the contents of the LC0 structure ARM: decompressor: split off _edata and stack base into separate object ARM: decompressor: move headroom variable out of LC0 ARM: 8976/1: module: allow arch overrides for .init section names ARM: 8975/1: module: fix handling of unwind init sections ARM: 8974/1: use SPARSMEM_STATIC when SPARSEMEM is enabled ARM: 8971/1: replace the sole use of a symbol with its definition ARM: 8969/1: decompressor: simplify libfdt builds Update rmk's email address in various drivers ARM: compat: remove KERNEL_DS usage in sys_oabi_epoll_ctl()
Unified · Split
| @@ -313,6 +313,9 @@ choice · 312 unmodified lines | |||
| 313 | config ARCH_MULTIPLATFORM | 313 | config ARCH_MULTIPLATFORM |
| 314 | bool "Allow multiple platforms to be selected" | 314 | bool "Allow multiple platforms to be selected" |
| 315 | depends on MMU | 315 | depends on MMU |
| 316 | select ARCH_FLATMEM_ENABLE | ||
| 317 | select ARCH_SPARSEMEM_ENABLE | ||
| 318 | select ARCH_SELECT_MEMORY_MODEL | ||
| 316 | select ARM_HAS_SG_CHAIN | 319 | select ARM_HAS_SG_CHAIN |
| 317 | select ARM_PATCH_PHYS_VIRT | 320 | select ARM_PATCH_PHYS_VIRT |
| 318 | select AUTO_ZRELADDR | 321 | select AUTO_ZRELADDR |
| @@ -1516,11 +1519,15 @@ config OABI_COMPAT · 1197 unmodified lines | |||
| 1516 | config ARCH_HAS_HOLES_MEMORYMODEL | 1519 | config ARCH_HAS_HOLES_MEMORYMODEL |
| 1517 | bool | 1520 | bool |
| 1518 | 1521 | ||
| 1519 | config ARCH_SPARSEMEM_ENABLE | 1522 | config ARCH_SELECT_MEMORY_MODEL |
| 1523 | bool | ||
| 1524 | |||
| 1525 | config ARCH_FLATMEM_ENABLE | ||
| 1520 | bool | 1526 | bool |
| 1521 | 1527 | ||
| 1522 | config ARCH_SPARSEMEM_DEFAULT | 1528 | config ARCH_SPARSEMEM_ENABLE |
| 1523 | def_bool ARCH_SPARSEMEM_ENABLE | 1529 | bool |
| 1530 | select SPARSEMEM_STATIC if SPARSEMEM | ||
| 1524 | 1531 | ||
| 1525 | config HAVE_ARCH_PFN_VALID | 1532 | config HAVE_ARCH_PFN_VALID |
| 1526 | def_bool ARCH_HAS_HOLES_MEMORYMODEL || !SPARSEMEM | 1533 | def_bool ARCH_HAS_HOLES_MEMORYMODEL || !SPARSEMEM |
| @@ -7,12 +7,3 @@ hyp-stub.S · 6 unmodified lines | |||
| 7 | piggy_data | 7 | piggy_data |
| 8 | vmlinux | 8 | vmlinux |
| 9 | vmlinux.lds | 9 | vmlinux.lds |
| 10 | |||
| 11 | # borrowed libfdt files | ||
| 12 | fdt.c | ||
| 13 | fdt.h | ||
| 14 | fdt_ro.c | ||
| 15 | fdt_rw.c | ||
| 16 | fdt_wip.c | ||
| 17 | libfdt.h | ||
| 18 | libfdt_internal.h | ||
| @@ -76,29 +76,30 @@ compress-$(CONFIG_KERNEL_LZMA) = lzma · 75 unmodified lines | |||
| 76 | compress-$(CONFIG_KERNEL_XZ) = xzkern | 76 | compress-$(CONFIG_KERNEL_XZ) = xzkern |
| 77 | compress-$(CONFIG_KERNEL_LZ4) = lz4 | 77 | compress-$(CONFIG_KERNEL_LZ4) = lz4 |
| 78 | 78 | ||
| 79 | # Borrowed libfdt files for the ATAG compatibility mode | 79 | libfdt_objs := fdt_rw.o fdt_ro.o fdt_wip.o fdt.o |
| 80 | |||
| 81 | libfdt := fdt_rw.c fdt_ro.c fdt_wip.c fdt.c | ||
| 82 | libfdt_hdrs := fdt.h libfdt.h libfdt_internal.h | ||
| 83 | |||
| 84 | libfdt_objs := $(addsuffix .o, $(basename $(libfdt))) | ||
| 85 | |||
| 86 | $(addprefix $(obj)/,$(libfdt) $(libfdt_hdrs)): $(obj)/%: $(srctree)/scripts/dtc/libfdt/% | ||
| 87 | $(call cmd,shipped) | ||
| 88 | |||
| 89 | $(addprefix $(obj)/,$(libfdt_objs) atags_to_fdt.o): \ | ||
| 90 | $(addprefix $(obj)/,$(libfdt_hdrs)) | ||
| 91 | 80 | ||
| 92 | ifeq ($(CONFIG_ARM_ATAG_DTB_COMPAT),y) | 81 | ifeq ($(CONFIG_ARM_ATAG_DTB_COMPAT),y) |
| 93 | OBJS += $(libfdt_objs) atags_to_fdt.o | 82 | OBJS += $(libfdt_objs) atags_to_fdt.o |
| 94 | endif | 83 | endif |
| 95 | 84 | ||
| 85 | # -fstack-protector-strong triggers protection checks in this code, | ||
| 86 | # but it is being used too early to link to meaningful stack_chk logic. | ||
| 87 | nossp-flags-$(CONFIG_CC_HAS_STACKPROTECTOR_NONE) := -fno-stack-protector | ||
| 88 | $(foreach o, $(libfdt_objs) atags_to_fdt.o, \ | ||
| 89 | $(eval CFLAGS_$(o) := -I $(srctree)/scripts/dtc/libfdt $(nossp-flags-y))) | ||
| 90 | |||
| 91 | # These were previously generated C files. When you are building the kernel | ||
| 92 | # with O=, make sure to remove the stale files in the output tree. Otherwise, | ||
| 93 | # the build system wrongly compiles the stale ones. | ||
| 94 | ifdef building_out_of_srctree | ||
| 95 | $(shell rm -f $(addprefix $(obj)/, fdt_rw.c fdt_ro.c fdt_wip.c fdt.c)) | ||
| 96 | endif | ||
| 97 | |||
| 96 | targets := vmlinux vmlinux.lds piggy_data piggy.o \ | 98 | targets := vmlinux vmlinux.lds piggy_data piggy.o \ |
| 97 | lib1funcs.o ashldi3.o bswapsdi2.o \ | 99 | lib1funcs.o ashldi3.o bswapsdi2.o \ |
| 98 | head.o $(OBJS) | 100 | head.o $(OBJS) |
| 99 | 101 | ||
| 100 | clean-files += piggy_data lib1funcs.S ashldi3.S bswapsdi2.S \ | 102 | clean-files += piggy_data lib1funcs.S ashldi3.S bswapsdi2.S hyp-stub.S |
| 101 | $(libfdt) $(libfdt_hdrs) hyp-stub.S | ||
| 102 | 103 | ||
| 103 | KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING | 104 | KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING |
| 104 | 105 | ||
| @@ -107,15 +108,6 @@ ORIG_CFLAGS := $(KBUILD_CFLAGS) · 2 unmodified lines | |||
| 107 | KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS)) | 108 | KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS)) |
| 108 | endif | 109 | endif |
| 109 | 110 | ||
| 110 | # -fstack-protector-strong triggers protection checks in this code, | ||
| 111 | # but it is being used too early to link to meaningful stack_chk logic. | ||
| 112 | nossp-flags-$(CONFIG_CC_HAS_STACKPROTECTOR_NONE) := -fno-stack-protector | ||
| 113 | CFLAGS_atags_to_fdt.o := $(nossp-flags-y) | ||
| 114 | CFLAGS_fdt.o := $(nossp-flags-y) | ||
| 115 | CFLAGS_fdt_ro.o := $(nossp-flags-y) | ||
| 116 | CFLAGS_fdt_rw.o := $(nossp-flags-y) | ||
| 117 | CFLAGS_fdt_wip.o := $(nossp-flags-y) | ||
| 118 | |||
| 119 | ccflags-y := -fpic $(call cc-option,-mno-single-pic-base,) -fno-builtin \ | 111 | ccflags-y := -fpic $(call cc-option,-mno-single-pic-base,) -fno-builtin \ |
| 120 | -I$(obj) $(DISABLE_ARM_SSP_PER_TASK_PLUGIN) | 112 | -I$(obj) $(DISABLE_ARM_SSP_PER_TASK_PLUGIN) |
| 121 | asflags-y := -DZIMAGE | 113 | asflags-y := -DZIMAGE |
| @@ -1,4 +1,5 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0 | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | #include <linux/libfdt_env.h> | ||
| 2 | #include <asm/setup.h> | 3 | #include <asm/setup.h> |
| 3 | #include <libfdt.h> | 4 | #include <libfdt.h> |
| 4 | 5 | ||
| @@ -0,0 +1,2 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0-only | ||
| 2 | #include "../../../../lib/fdt.c" | ||
| @@ -0,0 +1,2 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0-only | ||
| 2 | #include "../../../../lib/fdt_ro.c" | ||
| @@ -0,0 +1,2 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0-only | ||
| 2 | #include "../../../../lib/fdt_rw.c" | ||
| @@ -0,0 +1,2 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0-only | ||
| 2 | #include "../../../../lib/fdt_wip.c" | ||
| @@ -287,28 +287,22 @@ not_angel: · 286 unmodified lines | |||
| 287 | */ | 287 | */ |
| 288 | mov r0, pc | 288 | mov r0, pc |
| 289 | cmp r0, r4 | 289 | cmp r0, r4 |
| 290 | ldrcc r0, LC0+28 | 290 | ldrcc r0, .Lheadroom |
| 291 | addcc r0, r0, pc | 291 | addcc r0, r0, pc |
| 292 | cmpcc r4, r0 | 292 | cmpcc r4, r0 |
| 293 | orrcc r4, r4, #1 @ remember we skipped cache_on | 293 | orrcc r4, r4, #1 @ remember we skipped cache_on |
| 294 | blcs cache_on | 294 | blcs cache_on |
| 295 | 295 | ||
| 296 | restart: adr r0, LC0 | 296 | restart: adr r0, LC1 |
| 297 | ldmia r0, {r1, r2, r3, r6, r11, r12} | 297 | ldr sp, [r0] |
| 298 | ldr sp, [r0, #24] | 298 | ldr r6, [r0, #4] |
| 299 | 299 | add sp, sp, r0 | |
| 300 | /* | 300 | add r6, r6, r0 |
| 301 | * We might be running at a different address. We need | ||
| 302 | * to fix up various pointers. | ||
| 303 | */ | ||
| 304 | sub r0, r0, r1 @ calculate the delta offset | ||
| 305 | add r6, r6, r0 @ _edata | ||
| 306 | 301 | ||
| 307 | get_inflated_image_size r9, r10, lr | 302 | get_inflated_image_size r9, r10, lr |
| 308 | 303 | ||
| 309 | #ifndef CONFIG_ZBOOT_ROM | 304 | #ifndef CONFIG_ZBOOT_ROM |
| 310 | /* malloc space is above the relocated stack (64k max) */ | 305 | /* malloc space is above the relocated stack (64k max) */ |
| 311 | add sp, sp, r0 | ||
| 312 | add r10, sp, #0x10000 | 306 | add r10, sp, #0x10000 |
| 313 | #else | 307 | #else |
| 314 | /* | 308 | /* |
| @@ -322,9 +316,6 @@ restart: adr r0, LC0 · 7 unmodified lines | |||
| 322 | mov r5, #0 @ init dtb size to 0 | 316 | mov r5, #0 @ init dtb size to 0 |
| 323 | #ifdef CONFIG_ARM_APPENDED_DTB | 317 | #ifdef CONFIG_ARM_APPENDED_DTB |
| 324 | /* | 318 | /* |
| 325 | * r0 = delta | ||
| 326 | * r2 = BSS start | ||
| 327 | * r3 = BSS end | ||
| 328 | * r4 = final kernel address (possibly with LSB set) | 319 | * r4 = final kernel address (possibly with LSB set) |
| 329 | * r5 = appended dtb size (still unknown) | 320 | * r5 = appended dtb size (still unknown) |
| 330 | * r6 = _edata | 321 | * r6 = _edata |
| @@ -332,8 +323,6 @@ restart: adr r0, LC0 · 1 unmodified line | |||
| 332 | * r8 = atags/device tree pointer | 323 | * r8 = atags/device tree pointer |
| 333 | * r9 = size of decompressed image | 324 | * r9 = size of decompressed image |
| 334 | * r10 = end of this image, including bss/stack/malloc space if non XIP | 325 | * r10 = end of this image, including bss/stack/malloc space if non XIP |
| 335 | * r11 = GOT start | ||
| 336 | * r12 = GOT end | ||
| 337 | * sp = stack pointer | 326 | * sp = stack pointer |
| 338 | * | 327 | * |
| 339 | * if there are device trees (dtb) appended to zImage, advance r10 so that the | 328 | * if there are device trees (dtb) appended to zImage, advance r10 so that the |
| @@ -381,7 +370,6 @@ restart: adr r0, LC0 · 41 unmodified lines | |||
| 381 | /* temporarily relocate the stack past the DTB work space */ | 370 | /* temporarily relocate the stack past the DTB work space */ |
| 382 | add sp, sp, r5 | 371 | add sp, sp, r5 |
| 383 | 372 | ||
| 384 | stmfd sp!, {r0-r3, ip, lr} | ||
| 385 | mov r0, r8 | 373 | mov r0, r8 |
| 386 | mov r1, r6 | 374 | mov r1, r6 |
| 387 | mov r2, r5 | 375 | mov r2, r5 |
| @@ -400,7 +388,6 @@ restart: adr r0, LC0 · 12 unmodified lines | |||
| 400 | mov r2, r5 | 388 | mov r2, r5 |
| 401 | bleq atags_to_fdt | 389 | bleq atags_to_fdt |
| 402 | 390 | ||
| 403 | ldmfd sp!, {r0-r3, ip, lr} | ||
| 404 | sub sp, sp, r5 | 391 | sub sp, sp, r5 |
| 405 | #endif | 392 | #endif |
| 406 | 393 | ||
| @@ -537,6 +524,10 @@ dtb_check_done: · 130 unmodified lines | |||
| 537 | mov pc, r0 | 524 | mov pc, r0 |
| 538 | 525 | ||
| 539 | wont_overwrite: | 526 | wont_overwrite: |
| 527 | adr r0, LC0 | ||
| 528 | ldmia r0, {r1, r2, r3, r11, r12} | ||
| 529 | sub r0, r0, r1 @ calculate the delta offset | ||
| 530 | |||
| 540 | /* | 531 | /* |
| 541 | * If delta is zero, we are running at the address we were linked at. | 532 | * If delta is zero, we are running at the address we were linked at. |
| 542 | * r0 = delta | 533 | * r0 = delta |
| @@ -660,13 +651,18 @@ not_relocated: mov r0, #0 · 117 unmodified lines | |||
| 660 | LC0: .word LC0 @ r1 | 651 | LC0: .word LC0 @ r1 |
| 661 | .word __bss_start @ r2 | 652 | .word __bss_start @ r2 |
| 662 | .word _end @ r3 | 653 | .word _end @ r3 |
| 663 | .word _edata @ r6 | ||
| 664 | .word _got_start @ r11 | 654 | .word _got_start @ r11 |
| 665 | .word _got_end @ ip | 655 | .word _got_end @ ip |
| 666 | .word .L_user_stack_end @ sp | ||
| 667 | .word _end - restart + 16384 + 1024*1024 | ||
| 668 | .size LC0, . - LC0 | 656 | .size LC0, . - LC0 |
| 669 | 657 | ||
| 658 | .type LC1, #object | ||
| 659 | LC1: .word .L_user_stack_end - LC1 @ sp | ||
| 660 | .word _edata - LC1 @ r6 | ||
| 661 | .size LC1, . - LC1 | ||
| 662 | |||
| 663 | .Lheadroom: | ||
| 664 | .word _end - restart + 16384 + 1024*1024 | ||
| 665 | |||
| 670 | .Linflated_image_size_offset: | 666 | .Linflated_image_size_offset: |
| 671 | .long (input_data_end - 4) - . | 667 | .long (input_data_end - 4) - . |
| 672 | 668 | ||
| @@ -1434,38 +1430,26 @@ reloc_code_end: · 761 unmodified lines | |||
| 1434 | 1430 | ||
| 1435 | #ifdef CONFIG_EFI_STUB | 1431 | #ifdef CONFIG_EFI_STUB |
| 1436 | ENTRY(efi_enter_kernel) | 1432 | ENTRY(efi_enter_kernel) |
| 1437 | mov r7, r0 @ preserve image base | 1433 | mov r4, r0 @ preserve image base |
| 1438 | mov r4, r1 @ preserve DT pointer | 1434 | mov r8, r1 @ preserve DT pointer |
| 1439 | 1435 | ||
| 1440 | mov r0, r4 @ DT start | 1436 | mrc p15, 0, r0, c1, c0, 0 @ read SCTLR |
| 1441 | add r1, r4, r2 @ DT end | 1437 | tst r0, #0x1 @ MMU enabled? |
| 1442 | bl cache_clean_flush | 1438 | orreq r4, r4, #1 @ set LSB if not |
| 1443 | 1439 | ||
| 1444 | mov r0, r7 @ relocated zImage | 1440 | mov r0, r8 @ DT start |
| 1445 | ldr r1, =_edata @ size of zImage | 1441 | add r1, r8, r2 @ DT end |
| 1446 | add r1, r1, r0 @ end of zImage | ||
| 1447 | bl cache_clean_flush | 1442 | bl cache_clean_flush |
| 1448 | 1443 | ||
| 1449 | @ The PE/COFF loader might not have cleaned the code we are | 1444 | adr r0, 0f @ switch to our stack |
| 1450 | @ running beyond the PoU, and so calling cache_off below from | 1445 | ldr sp, [r0] |
| 1451 | @ inside the PE/COFF loader allocated region is unsafe unless | 1446 | add sp, sp, r0 |
| 1452 | @ we explicitly clean it to the PoC. | ||
| 1453 | ARM( adrl r0, call_cache_fn ) | ||
| 1454 | THUMB( adr r0, call_cache_fn ) @ region of code we will | ||
| 1455 | adr r1, 0f @ run with MMU off | ||
| 1456 | bl cache_clean_flush | ||
| 1457 | bl cache_off | ||
| 1458 | 1447 | ||
| 1459 | @ Set parameters for booting zImage according to boot protocol | 1448 | mov r5, #0 @ appended DTB size |
| 1460 | @ put FDT address in r2, it was returned by efi_entry() | 1449 | mov r7, #0xFFFFFFFF @ machine ID |
| 1461 | @ r1 is the machine type, and r0 needs to be 0 | 1450 | b wont_overwrite |
| 1462 | mov r0, #0 | ||
| 1463 | mov r1, #0xFFFFFFFF | ||
| 1464 | mov r2, r4 | ||
| 1465 | add r7, r7, #(__efi_start - start) | ||
| 1466 | mov pc, r7 @ no mode switch | ||
| 1467 | ENDPROC(efi_enter_kernel) | 1451 | ENDPROC(efi_enter_kernel) |
| 1468 | 0: | 1452 | 0: .long .L_user_stack_end - . |
| 1469 | #endif | 1453 | #endif |
| 1470 | 1454 | ||
| 1471 | .align | 1455 | .align |
| @@ -1,24 +0,0 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
| 2 | #ifndef _ARM_LIBFDT_ENV_H | ||
| 3 | #define _ARM_LIBFDT_ENV_H | ||
| 4 | |||
| 5 | #include <linux/limits.h> | ||
| 6 | #include <linux/types.h> | ||
| 7 | #include <linux/string.h> | ||
| 8 | #include <asm/byteorder.h> | ||
| 9 | |||
| 10 | #define INT32_MAX S32_MAX | ||
| 11 | #define UINT32_MAX U32_MAX | ||
| 12 | |||
| 13 | typedef __be16 fdt16_t; | ||
| 14 | typedef __be32 fdt32_t; | ||
| 15 | typedef __be64 fdt64_t; | ||
| 16 | |||
| 17 | #define fdt16_to_cpu(x) be16_to_cpu(x) | ||
| 18 | #define cpu_to_fdt16(x) cpu_to_be16(x) | ||
| 19 | #define fdt32_to_cpu(x) be32_to_cpu(x) | ||
| 20 | #define cpu_to_fdt32(x) cpu_to_be32(x) | ||
| 21 | #define fdt64_to_cpu(x) be64_to_cpu(x) | ||
| 22 | #define cpu_to_fdt64(x) cpu_to_be64(x) | ||
| 23 | |||
| 24 | #endif | ||
| @@ -63,9 +63,11 @@ SECTIONS · 62 unmodified lines | |||
| 63 | _etext = .; | 63 | _etext = .; |
| 64 | 64 | ||
| 65 | .got.plt : { *(.got.plt) } | 65 | .got.plt : { *(.got.plt) } |
| 66 | #ifndef CONFIG_EFI_STUB | ||
| 66 | _got_start = .; | 67 | _got_start = .; |
| 67 | .got : { *(.got) } | 68 | .got : { *(.got) } |
| 68 | _got_end = .; | 69 | _got_end = .; |
| 70 | #endif | ||
| 69 | 71 | ||
| 70 | /* ensure the zImage file size is always a multiple of 64 bits */ | 72 | /* ensure the zImage file size is always a multiple of 64 bits */ |
| 71 | /* (without a dummy byte, ld just ignores the empty section) */ | 73 | /* (without a dummy byte, ld just ignores the empty section) */ |
| @@ -74,6 +76,9 @@ SECTIONS · 2 unmodified lines | |||
| 74 | #ifdef CONFIG_EFI_STUB | 76 | #ifdef CONFIG_EFI_STUB |
| 75 | .data : ALIGN(4096) { | 77 | .data : ALIGN(4096) { |
| 76 | __pecoff_data_start = .; | 78 | __pecoff_data_start = .; |
| 79 | _got_start = .; | ||
| 80 | *(.got) | ||
| 81 | _got_end = .; | ||
| 77 | /* | 82 | /* |
| 78 | * The EFI stub always executes from RAM, and runs strictly before the | 83 | * The EFI stub always executes from RAM, and runs strictly before the |
| 79 | * decompressor, so we can make an exception for its r/w data, and keep it | 84 | * decompressor, so we can make an exception for its r/w data, and keep it |
| @@ -269,10 +269,9 @@ · 268 unmodified lines | |||
| 269 | .endif ;\ | 269 | .endif ;\ |
| 270 | .popsection | 270 | .popsection |
| 271 | #define ALT_UP_B(label) \ | 271 | #define ALT_UP_B(label) \ |
| 272 | .equ up_b_offset, label - 9998b ;\ | ||
| 273 | .pushsection ".alt.smp.init", "a" ;\ | 272 | .pushsection ".alt.smp.init", "a" ;\ |
| 274 | .long 9998b ;\ | 273 | .long 9998b ;\ |
| 275 | W(b) . + up_b_offset ;\ | 274 | W(b) . + (label - 9998b) ;\ |
| 276 | .popsection | 275 | .popsection |
| 277 | #else | 276 | #else |
| 278 | #define ALT_SMP(instr...) | 277 | #define ALT_SMP(instr...) |
| @@ -55,6 +55,13 @@ void *module_alloc(unsigned long size) · 54 unmodified lines | |||
| 55 | } | 55 | } |
| 56 | #endif | 56 | #endif |
| 57 | 57 | ||
| 58 | bool module_init_section(const char *name) | ||
| 59 | { | ||
| 60 | return strstarts(name, ".init") || | ||
| 61 | strstarts(name, ".ARM.extab.init") || | ||
| 62 | strstarts(name, ".ARM.exidx.init"); | ||
| 63 | } | ||
| 64 | |||
| 58 | bool module_exit_section(const char *name) | 65 | bool module_exit_section(const char *name) |
| 59 | { | 66 | { |
| 60 | return strstarts(name, ".exit") || | 67 | return strstarts(name, ".exit") || |
| @@ -409,8 +416,17 @@ module_arch_cleanup(struct module *mod) · 348 unmodified lines | |||
| 409 | #ifdef CONFIG_ARM_UNWIND | 416 | #ifdef CONFIG_ARM_UNWIND |
| 410 | int i; | 417 | int i; |
| 411 | 418 | ||
| 412 | for (i = 0; i < ARM_SEC_MAX; i++) | 419 | for (i = 0; i < ARM_SEC_MAX; i++) { |
| 413 | if (mod->arch.unwind[i]) | 420 | unwind_table_del(mod->arch.unwind[i]); |
| 414 | unwind_table_del(mod->arch.unwind[i]); | 421 | mod->arch.unwind[i] = NULL; |
| 422 | } | ||
| 423 | #endif | ||
| 424 | } | ||
| 425 | |||
| 426 | void __weak module_arch_freeing_init(struct module *mod) | ||
| 427 | { | ||
| 428 | #ifdef CONFIG_ARM_UNWIND | ||
| 429 | unwind_table_del(mod->arch.unwind[ARM_SEC_INIT]); | ||
| 430 | mod->arch.unwind[ARM_SEC_INIT] = NULL; | ||
| 415 | #endif | 431 | #endif |
| 416 | } | 432 | } |
| @@ -253,20 +253,15 @@ asmlinkage long sys_oabi_epoll_ctl(int epfd, int op, int fd, · 252 unmodified lines | |||
| 253 | { | 253 | { |
| 254 | struct oabi_epoll_event user; | 254 | struct oabi_epoll_event user; |
| 255 | struct epoll_event kernel; | 255 | struct epoll_event kernel; |
| 256 | mm_segment_t fs; | ||
| 257 | long ret; | ||
| 258 | 256 | ||
| 259 | if (op == EPOLL_CTL_DEL) | 257 | if (ep_op_has_event(op) && |
| 260 | return sys_epoll_ctl(epfd, op, fd, NULL); | 258 | copy_from_user(&user, event, sizeof(user))) |
| 261 | if (copy_from_user(&user, event, sizeof(user))) | ||
| 262 | return -EFAULT; | 259 | return -EFAULT; |
| 260 | |||
| 263 | kernel.events = user.events; | 261 | kernel.events = user.events; |
| 264 | kernel.data = user.data; | 262 | kernel.data = user.data; |
| 265 | fs = get_fs(); | 263 | |
| 266 | set_fs(KERNEL_DS); | 264 | return do_epoll_ctl(epfd, op, fd, &kernel, false); |
| 267 | ret = sys_epoll_ctl(epfd, op, fd, &kernel); | ||
| 268 | set_fs(fs); | ||
| 269 | return ret; | ||
| 270 | } | 265 | } |
| 271 | 266 | ||
| 272 | asmlinkage long sys_oabi_epoll_wait(int epfd, | 267 | asmlinkage long sys_oabi_epoll_wait(int epfd, |
| @@ -5,6 +5,7 @@ · 4 unmodified lines | |||
| 5 | * VMA_VM_FLAGS | 5 | * VMA_VM_FLAGS |
| 6 | * VM_EXEC | 6 | * VM_EXEC |
| 7 | */ | 7 | */ |
| 8 | #include <linux/const.h> | ||
| 8 | #include <asm/asm-offsets.h> | 9 | #include <asm/asm-offsets.h> |
| 9 | #include <asm/thread_info.h> | 10 | #include <asm/thread_info.h> |
| 10 | 11 | ||
| @@ -30,7 +31,7 @@ · 19 unmodified lines | |||
| 30 | * act_mm - get current->active_mm | 31 | * act_mm - get current->active_mm |
| 31 | */ | 32 | */ |
| 32 | .macro act_mm, rd | 33 | .macro act_mm, rd |
| 33 | bic \rd, sp, #8128 | 34 | bic \rd, sp, #(THREAD_SIZE - 1) & ~63 |
| 34 | bic \rd, \rd, #63 | 35 | bic \rd, \rd, #63 |
| 35 | ldr \rd, [\rd, #TI_TASK] | 36 | ldr \rd, [\rd, #TI_TASK] |
| 36 | .if (TSK_ACTIVE_MM > IMM12_MASK) | 37 | .if (TSK_ACTIVE_MM > IMM12_MASK) |
| @@ -199,14 +199,8 @@ efi_status_t handle_kernel_image(unsigned long *image_addr, · 198 unmodified lines | |||
| 199 | unsigned long kernel_base; | 199 | unsigned long kernel_base; |
| 200 | efi_status_t status; | 200 | efi_status_t status; |
| 201 | 201 | ||
| 202 | /* | 202 | /* use a 16 MiB aligned base for the decompressed kernel */ |
| 203 | * Verify that the DRAM base address is compatible with the ARM | 203 | kernel_base = round_up(dram_base, SZ_16M) + TEXT_OFFSET; |
| 204 | * boot protocol, which determines the base of DRAM by masking | ||
| 205 | * off the low 27 bits of the address at which the zImage is | ||
| 206 | * loaded. These assumptions are made by the decompressor, | ||
| 207 | * before any memory map is available. | ||
| 208 | */ | ||
| 209 | kernel_base = round_up(dram_base, SZ_128M); | ||
| 210 | 204 | ||
| 211 | /* | 205 | /* |
| 212 | * Note that some platforms (notably, the Raspberry Pi 2) put | 206 | * Note that some platforms (notably, the Raspberry Pi 2) put |
| @@ -215,41 +209,14 @@ efi_status_t handle_kernel_image(unsigned long *image_addr, · 2 unmodified lines | |||
| 215 | * base of the kernel image is only partially used at the moment. | 209 | * base of the kernel image is only partially used at the moment. |
| 216 | * (Up to 5 pages are used for the swapper page tables) | 210 | * (Up to 5 pages are used for the swapper page tables) |
| 217 | */ | 211 | */ |
| 218 | kernel_base += TEXT_OFFSET - 5 * PAGE_SIZE; | 212 | status = reserve_kernel_base(kernel_base - 5 * PAGE_SIZE, reserve_addr, |
| 219 | 213 | reserve_size); | |
| 220 | status = reserve_kernel_base(kernel_base, reserve_addr, reserve_size); | ||
| 221 | if (status != EFI_SUCCESS) { | 214 | if (status != EFI_SUCCESS) { |
| 222 | efi_err("Unable to allocate memory for uncompressed kernel.\n"); | 215 | efi_err("Unable to allocate memory for uncompressed kernel.\n"); |
| 223 | return status; | 216 | return status; |
| 224 | } | 217 | } |
| 225 | 218 | ||
| 226 | /* | 219 | *image_addr = kernel_base; |
| 227 | * Relocate the zImage, so that it appears in the lowest 128 MB | 220 | *image_size = 0; |
| 228 | * memory window. | ||
| 229 | */ | ||
| 230 | *image_addr = (unsigned long)image->image_base; | ||
| 231 | *image_size = image->image_size; | ||
| 232 | status = efi_relocate_kernel(image_addr, *image_size, *image_size, | ||
| 233 | kernel_base + MAX_UNCOMP_KERNEL_SIZE, 0, 0); | ||
| 234 | if (status != EFI_SUCCESS) { | ||
| 235 | efi_err("Failed to relocate kernel.\n"); | ||
| 236 | efi_free(*reserve_size, *reserve_addr); | ||
| 237 | *reserve_size = 0; | ||
| 238 | return status; | ||
| 239 | } | ||
| 240 | |||
| 241 | /* | ||
| 242 | * Check to see if we were able to allocate memory low enough | ||
| 243 | * in memory. The kernel determines the base of DRAM from the | ||
| 244 | * address at which the zImage is loaded. | ||
| 245 | */ | ||
| 246 | if (*image_addr + *image_size > dram_base + ZIMAGE_OFFSET_LIMIT) { | ||
| 247 | efi_err("Failed to relocate kernel, no low memory available.\n"); | ||
| 248 | efi_free(*reserve_size, *reserve_addr); | ||
| 249 | *reserve_size = 0; | ||
| 250 | efi_free(*image_size, *image_addr); | ||
| 251 | *image_size = 0; | ||
| 252 | return EFI_LOAD_ERROR; | ||
| 253 | } | ||
| 254 | return EFI_SUCCESS; | 221 | return EFI_SUCCESS; |
| 255 | } | 222 | } |
| @@ -311,7 +311,7 @@ static void __exit armada_drm_exit(void) · 310 unmodified lines | |||
| 311 | } | 311 | } |
| 312 | module_exit(armada_drm_exit); | 312 | module_exit(armada_drm_exit); |
| 313 | 313 | ||
| 314 | MODULE_AUTHOR("Russell King <rmk+kernel@arm.linux.org.uk>"); | 314 | MODULE_AUTHOR("Russell King <rmk+kernel@armlinux.org.uk>"); |
| 315 | MODULE_DESCRIPTION("Armada DRM Driver"); | 315 | MODULE_DESCRIPTION("Armada DRM Driver"); |
| 316 | MODULE_LICENSE("GPL"); | 316 | MODULE_LICENSE("GPL"); |
| 317 | MODULE_ALIAS("platform:armada-drm"); | 317 | MODULE_ALIAS("platform:armada-drm"); |
| @@ -630,7 +630,7 @@ static struct platform_driver snd_dw_hdmi_driver = { · 629 unmodified lines | |||
| 630 | 630 | ||
| 631 | module_platform_driver(snd_dw_hdmi_driver); | 631 | module_platform_driver(snd_dw_hdmi_driver); |
| 632 | 632 | ||
| 633 | MODULE_AUTHOR("Russell King <rmk+kernel@arm.linux.org.uk>"); | 633 | MODULE_AUTHOR("Russell King <rmk+kernel@armlinux.org.uk>"); |
| 634 | MODULE_DESCRIPTION("Synopsis Designware HDMI AHB ALSA interface"); | 634 | MODULE_DESCRIPTION("Synopsis Designware HDMI AHB ALSA interface"); |
| 635 | MODULE_LICENSE("GPL v2"); | 635 | MODULE_LICENSE("GPL v2"); |
| 636 | MODULE_ALIAS("platform:" DRIVER_NAME); | 636 | MODULE_ALIAS("platform:" DRIVER_NAME); |
| @@ -736,7 +736,7 @@ static void __exit etnaviv_exit(void) · 735 unmodified lines | |||
| 736 | module_exit(etnaviv_exit); | 736 | module_exit(etnaviv_exit); |
| 737 | 737 | ||
| 738 | MODULE_AUTHOR("Christian Gmeiner <christian.gmeiner@gmail.com>"); | 738 | MODULE_AUTHOR("Christian Gmeiner <christian.gmeiner@gmail.com>"); |
| 739 | MODULE_AUTHOR("Russell King <rmk+kernel@arm.linux.org.uk>"); | 739 | MODULE_AUTHOR("Russell King <rmk+kernel@armlinux.org.uk>"); |
| 740 | MODULE_AUTHOR("Lucas Stach <l.stach@pengutronix.de>"); | 740 | MODULE_AUTHOR("Lucas Stach <l.stach@pengutronix.de>"); |
| 741 | MODULE_DESCRIPTION("etnaviv DRM Driver"); | 741 | MODULE_DESCRIPTION("etnaviv DRM Driver"); |
| 742 | MODULE_LICENSE("GPL v2"); | 742 | MODULE_LICENSE("GPL v2"); |
| @@ -2,7 +2,7 @@ · 1 unmodified line | |||
| 2 | /* | 2 | /* |
| 3 | * cec-notifier.c - notify CEC drivers of physical address changes | 3 | * cec-notifier.c - notify CEC drivers of physical address changes |
| 4 | * | 4 | * |
| 5 | * Copyright 2016 Russell King <rmk+kernel@arm.linux.org.uk> | 5 | * Copyright 2016 Russell King. |
| 6 | * Copyright 2016-2017 Cisco Systems, Inc. and/or its affiliates. All rights reserved. | 6 | * Copyright 2016-2017 Cisco Systems, Inc. and/or its affiliates. All rights reserved. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| @@ -2,7 +2,7 @@ · 1 unmodified line | |||
| 2 | /* | 2 | /* |
| 3 | * Software PHY emulation | 3 | * Software PHY emulation |
| 4 | * | 4 | * |
| 5 | * Code taken from fixed_phy.c by Russell King <rmk+kernel@arm.linux.org.uk> | 5 | * Code taken from fixed_phy.c by Russell King. |
| 6 | * | 6 | * |
| 7 | * Author: Vitaly Bordug <vbordug@ru.mvista.com> | 7 | * Author: Vitaly Bordug <vbordug@ru.mvista.com> |
| 8 | * Anton Vorontsov <avorontsov@ru.mvista.com> | 8 | * Anton Vorontsov <avorontsov@ru.mvista.com> |
| @@ -29,6 +29,11 @@ void *module_alloc(unsigned long size); · 28 unmodified lines | |||
| 29 | /* Free memory returned from module_alloc. */ | 29 | /* Free memory returned from module_alloc. */ |
| 30 | void module_memfree(void *module_region); | 30 | void module_memfree(void *module_region); |
| 31 | 31 | ||
| 32 | /* Determines if the section name is an init section (that is only used during | ||
| 33 | * module loading). | ||
| 34 | */ | ||
| 35 | bool module_init_section(const char *name); | ||
| 36 | |||
| 32 | /* Determines if the section name is an exit section (that is only used during | 37 | /* Determines if the section name is an exit section (that is only used during |
| 33 | * module unloading) | 38 | * module unloading) |
| 34 | */ | 39 | */ |
| @@ -2,7 +2,7 @@ · 1 unmodified line | |||
| 2 | /* | 2 | /* |
| 3 | * cec-notifier.h - notify CEC drivers of physical address changes | 3 | * cec-notifier.h - notify CEC drivers of physical address changes |
| 4 | * | 4 | * |
| 5 | * Copyright 2016 Russell King <rmk+kernel@arm.linux.org.uk> | 5 | * Copyright 2016 Russell King. |
| 6 | * Copyright 2016-2017 Cisco Systems, Inc. and/or its affiliates. All rights reserved. | 6 | * Copyright 2016-2017 Cisco Systems, Inc. and/or its affiliates. All rights reserved. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| @@ -2400,7 +2400,7 @@ static void layout_sections(struct module *mod, struct load_info *info) · 2399 unmodified lines | |||
| 2400 | if ((s->sh_flags & masks[m][0]) != masks[m][0] | 2400 | if ((s->sh_flags & masks[m][0]) != masks[m][0] |
| 2401 | || (s->sh_flags & masks[m][1]) | 2401 | || (s->sh_flags & masks[m][1]) |
| 2402 | || s->sh_entsize != ~0UL | 2402 | || s->sh_entsize != ~0UL |
| 2403 | || strstarts(sname, ".init")) | 2403 | || module_init_section(sname)) |
| 2404 | continue; | 2404 | continue; |
| 2405 | s->sh_entsize = get_offset(mod, &mod->core_layout.size, s, i); | 2405 | s->sh_entsize = get_offset(mod, &mod->core_layout.size, s, i); |
| 2406 | pr_debug("\t%s\n", sname); | 2406 | pr_debug("\t%s\n", sname); |
| @@ -2433,7 +2433,7 @@ static void layout_sections(struct module *mod, struct load_info *info) · 26 unmodified lines | |||
| 2433 | if ((s->sh_flags & masks[m][0]) != masks[m][0] | 2433 | if ((s->sh_flags & masks[m][0]) != masks[m][0] |
| 2434 | || (s->sh_flags & masks[m][1]) | 2434 | || (s->sh_flags & masks[m][1]) |
| 2435 | || s->sh_entsize != ~0UL | 2435 | || s->sh_entsize != ~0UL |
| 2436 | || !strstarts(sname, ".init")) | 2436 | || !module_init_section(sname)) |
| 2437 | continue; | 2437 | continue; |
| 2438 | s->sh_entsize = (get_offset(mod, &mod->init_layout.size, s, i) | 2438 | s->sh_entsize = (get_offset(mod, &mod->init_layout.size, s, i) |
| 2439 | | INIT_OFFSET_MASK); | 2439 | | INIT_OFFSET_MASK); |
| @@ -2768,6 +2768,11 @@ void * __weak module_alloc(unsigned long size) · 328 unmodified lines | |||
| 2768 | return vmalloc_exec(size); | 2768 | return vmalloc_exec(size); |
| 2769 | } | 2769 | } |
| 2770 | 2770 | ||
| 2771 | bool __weak module_init_section(const char *name) | ||
| 2772 | { | ||
| 2773 | return strstarts(name, ".init"); | ||
| 2774 | } | ||
| 2775 | |||
| 2771 | bool __weak module_exit_section(const char *name) | 2776 | bool __weak module_exit_section(const char *name) |
| 2772 | { | 2777 | { |
| 2773 | return strstarts(name, ".exit"); | 2778 | return strstarts(name, ".exit"); |