Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm

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()

+123 -171
+10 -3
arch/arm/Kconfig
··· 313 313 config ARCH_MULTIPLATFORM 314 314 bool "Allow multiple platforms to be selected" 315 315 depends on MMU 316 + select ARCH_FLATMEM_ENABLE 317 + select ARCH_SPARSEMEM_ENABLE 318 + select ARCH_SELECT_MEMORY_MODEL 316 319 select ARM_HAS_SG_CHAIN 317 320 select ARM_PATCH_PHYS_VIRT 318 321 select AUTO_ZRELADDR ··· 1519 1516 config ARCH_HAS_HOLES_MEMORYMODEL 1520 1517 bool 1521 1518 1522 - config ARCH_SPARSEMEM_ENABLE 1519 + config ARCH_SELECT_MEMORY_MODEL 1523 1520 bool 1524 1521 1525 - config ARCH_SPARSEMEM_DEFAULT 1526 - def_bool ARCH_SPARSEMEM_ENABLE 1522 + config ARCH_FLATMEM_ENABLE 1523 + bool 1524 + 1525 + config ARCH_SPARSEMEM_ENABLE 1526 + bool 1527 + select SPARSEMEM_STATIC if SPARSEMEM 1527 1528 1528 1529 config HAVE_ARCH_PFN_VALID 1529 1530 def_bool ARCH_HAS_HOLES_MEMORYMODEL || !SPARSEMEM
-9
arch/arm/boot/compressed/.gitignore
··· 7 7 piggy_data 8 8 vmlinux 9 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
+15 -23
arch/arm/boot/compressed/Makefile
··· 76 76 compress-$(CONFIG_KERNEL_XZ) = xzkern 77 77 compress-$(CONFIG_KERNEL_LZ4) = lz4 78 78 79 - # Borrowed libfdt files for the ATAG compatibility mode 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)) 79 + libfdt_objs := fdt_rw.o fdt_ro.o fdt_wip.o fdt.o 91 80 92 81 ifeq ($(CONFIG_ARM_ATAG_DTB_COMPAT),y) 93 82 OBJS += $(libfdt_objs) atags_to_fdt.o 83 + endif 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)) 94 96 endif 95 97 96 98 targets := vmlinux vmlinux.lds piggy_data piggy.o \ 97 99 lib1funcs.o ashldi3.o bswapsdi2.o \ 98 100 head.o $(OBJS) 99 101 100 - clean-files += piggy_data lib1funcs.S ashldi3.S bswapsdi2.S \ 101 - $(libfdt) $(libfdt_hdrs) hyp-stub.S 102 + clean-files += piggy_data lib1funcs.S ashldi3.S bswapsdi2.S hyp-stub.S 102 103 103 104 KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING 104 105 ··· 107 106 ORIG_CFLAGS := $(KBUILD_CFLAGS) 108 107 KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS)) 109 108 endif 110 - 111 - # -fstack-protector-strong triggers protection checks in this code, 112 - # but it is being used too early to link to meaningful stack_chk logic. 113 - nossp-flags-$(CONFIG_CC_HAS_STACKPROTECTOR_NONE) := -fno-stack-protector 114 - CFLAGS_atags_to_fdt.o := $(nossp-flags-y) 115 - CFLAGS_fdt.o := $(nossp-flags-y) 116 - CFLAGS_fdt_ro.o := $(nossp-flags-y) 117 - CFLAGS_fdt_rw.o := $(nossp-flags-y) 118 - CFLAGS_fdt_wip.o := $(nossp-flags-y) 119 109 120 110 ccflags-y := -fpic $(call cc-option,-mno-single-pic-base,) -fno-builtin \ 121 111 -I$(obj) $(DISABLE_ARM_SSP_PER_TASK_PLUGIN)
+1
arch/arm/boot/compressed/atags_to_fdt.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 + #include <linux/libfdt_env.h> 2 3 #include <asm/setup.h> 3 4 #include <libfdt.h> 4 5
+2
arch/arm/boot/compressed/fdt.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + #include "../../../../lib/fdt.c"
+2
arch/arm/boot/compressed/fdt_ro.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + #include "../../../../lib/fdt_ro.c"
+2
arch/arm/boot/compressed/fdt_rw.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + #include "../../../../lib/fdt_rw.c"
+2
arch/arm/boot/compressed/fdt_wip.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + #include "../../../../lib/fdt_wip.c"
+33 -49
arch/arm/boot/compressed/head.S
··· 287 287 */ 288 288 mov r0, pc 289 289 cmp r0, r4 290 - ldrcc r0, LC0+28 290 + ldrcc r0, .Lheadroom 291 291 addcc r0, r0, pc 292 292 cmpcc r4, r0 293 293 orrcc r4, r4, #1 @ remember we skipped cache_on 294 294 blcs cache_on 295 295 296 - restart: adr r0, LC0 297 - ldmia r0, {r1, r2, r3, r6, r11, r12} 298 - ldr sp, [r0, #24] 299 - 300 - /* 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 296 + restart: adr r0, LC1 297 + ldr sp, [r0] 298 + ldr r6, [r0, #4] 299 + add sp, sp, r0 300 + add r6, r6, r0 306 301 307 302 get_inflated_image_size r9, r10, lr 308 303 309 304 #ifndef CONFIG_ZBOOT_ROM 310 305 /* malloc space is above the relocated stack (64k max) */ 311 - add sp, sp, r0 312 306 add r10, sp, #0x10000 313 307 #else 314 308 /* ··· 316 322 mov r5, #0 @ init dtb size to 0 317 323 #ifdef CONFIG_ARM_APPENDED_DTB 318 324 /* 319 - * r0 = delta 320 - * r2 = BSS start 321 - * r3 = BSS end 322 325 * r4 = final kernel address (possibly with LSB set) 323 326 * r5 = appended dtb size (still unknown) 324 327 * r6 = _edata ··· 323 332 * r8 = atags/device tree pointer 324 333 * r9 = size of decompressed image 325 334 * r10 = end of this image, including bss/stack/malloc space if non XIP 326 - * r11 = GOT start 327 - * r12 = GOT end 328 335 * sp = stack pointer 329 336 * 330 337 * if there are device trees (dtb) appended to zImage, advance r10 so that the ··· 370 381 /* temporarily relocate the stack past the DTB work space */ 371 382 add sp, sp, r5 372 383 373 - stmfd sp!, {r0-r3, ip, lr} 374 384 mov r0, r8 375 385 mov r1, r6 376 386 mov r2, r5 ··· 388 400 mov r2, r5 389 401 bleq atags_to_fdt 390 402 391 - ldmfd sp!, {r0-r3, ip, lr} 392 403 sub sp, sp, r5 393 404 #endif 394 405 ··· 524 537 mov pc, r0 525 538 526 539 wont_overwrite: 540 + adr r0, LC0 541 + ldmia r0, {r1, r2, r3, r11, r12} 542 + sub r0, r0, r1 @ calculate the delta offset 543 + 527 544 /* 528 545 * If delta is zero, we are running at the address we were linked at. 529 546 * r0 = delta ··· 651 660 LC0: .word LC0 @ r1 652 661 .word __bss_start @ r2 653 662 .word _end @ r3 654 - .word _edata @ r6 655 663 .word _got_start @ r11 656 664 .word _got_end @ ip 657 - .word .L_user_stack_end @ sp 658 - .word _end - restart + 16384 + 1024*1024 659 665 .size LC0, . - LC0 666 + 667 + .type LC1, #object 668 + LC1: .word .L_user_stack_end - LC1 @ sp 669 + .word _edata - LC1 @ r6 670 + .size LC1, . - LC1 671 + 672 + .Lheadroom: 673 + .word _end - restart + 16384 + 1024*1024 660 674 661 675 .Linflated_image_size_offset: 662 676 .long (input_data_end - 4) - . ··· 1430 1434 1431 1435 #ifdef CONFIG_EFI_STUB 1432 1436 ENTRY(efi_enter_kernel) 1433 - mov r7, r0 @ preserve image base 1434 - mov r4, r1 @ preserve DT pointer 1437 + mov r4, r0 @ preserve image base 1438 + mov r8, r1 @ preserve DT pointer 1435 1439 1436 - mov r0, r4 @ DT start 1437 - add r1, r4, r2 @ DT end 1440 + mrc p15, 0, r0, c1, c0, 0 @ read SCTLR 1441 + tst r0, #0x1 @ MMU enabled? 1442 + orreq r4, r4, #1 @ set LSB if not 1443 + 1444 + mov r0, r8 @ DT start 1445 + add r1, r8, r2 @ DT end 1438 1446 bl cache_clean_flush 1439 1447 1440 - mov r0, r7 @ relocated zImage 1441 - ldr r1, =_edata @ size of zImage 1442 - add r1, r1, r0 @ end of zImage 1443 - bl cache_clean_flush 1448 + adr r0, 0f @ switch to our stack 1449 + ldr sp, [r0] 1450 + add sp, sp, r0 1444 1451 1445 - @ The PE/COFF loader might not have cleaned the code we are 1446 - @ running beyond the PoU, and so calling cache_off below from 1447 - @ inside the PE/COFF loader allocated region is unsafe unless 1448 - @ we explicitly clean it to the PoC. 1449 - ARM( adrl r0, call_cache_fn ) 1450 - THUMB( adr r0, call_cache_fn ) @ region of code we will 1451 - adr r1, 0f @ run with MMU off 1452 - bl cache_clean_flush 1453 - bl cache_off 1454 - 1455 - @ Set parameters for booting zImage according to boot protocol 1456 - @ put FDT address in r2, it was returned by efi_entry() 1457 - @ r1 is the machine type, and r0 needs to be 0 1458 - mov r0, #0 1459 - mov r1, #0xFFFFFFFF 1460 - mov r2, r4 1461 - add r7, r7, #(__efi_start - start) 1462 - mov pc, r7 @ no mode switch 1452 + mov r5, #0 @ appended DTB size 1453 + mov r7, #0xFFFFFFFF @ machine ID 1454 + b wont_overwrite 1463 1455 ENDPROC(efi_enter_kernel) 1464 - 0: 1456 + 0: .long .L_user_stack_end - . 1465 1457 #endif 1466 1458 1467 1459 .align
-24
arch/arm/boot/compressed/libfdt_env.h
··· 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
+5
arch/arm/boot/compressed/vmlinux.lds.S
··· 63 63 _etext = .; 64 64 65 65 .got.plt : { *(.got.plt) } 66 + #ifndef CONFIG_EFI_STUB 66 67 _got_start = .; 67 68 .got : { *(.got) } 68 69 _got_end = .; 70 + #endif 69 71 70 72 /* ensure the zImage file size is always a multiple of 64 bits */ 71 73 /* (without a dummy byte, ld just ignores the empty section) */ ··· 76 74 #ifdef CONFIG_EFI_STUB 77 75 .data : ALIGN(4096) { 78 76 __pecoff_data_start = .; 77 + _got_start = .; 78 + *(.got) 79 + _got_end = .; 79 80 /* 80 81 * The EFI stub always executes from RAM, and runs strictly before the 81 82 * decompressor, so we can make an exception for its r/w data, and keep it
+1 -2
arch/arm/include/asm/assembler.h
··· 269 269 .endif ;\ 270 270 .popsection 271 271 #define ALT_UP_B(label) \ 272 - .equ up_b_offset, label - 9998b ;\ 273 272 .pushsection ".alt.smp.init", "a" ;\ 274 273 .long 9998b ;\ 275 - W(b) . + up_b_offset ;\ 274 + W(b) . + (label - 9998b) ;\ 276 275 .popsection 277 276 #else 278 277 #define ALT_SMP(instr...)
+19 -3
arch/arm/kernel/module.c
··· 55 55 } 56 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 65 bool module_exit_section(const char *name) 59 66 { 60 67 return strstarts(name, ".exit") || ··· 416 409 #ifdef CONFIG_ARM_UNWIND 417 410 int i; 418 411 419 - for (i = 0; i < ARM_SEC_MAX; i++) 420 - if (mod->arch.unwind[i]) 421 - unwind_table_del(mod->arch.unwind[i]); 412 + for (i = 0; i < ARM_SEC_MAX; i++) { 413 + unwind_table_del(mod->arch.unwind[i]); 414 + mod->arch.unwind[i] = NULL; 415 + } 416 + #endif 417 + } 418 + 419 + void __weak module_arch_freeing_init(struct module *mod) 420 + { 421 + #ifdef CONFIG_ARM_UNWIND 422 + unwind_table_del(mod->arch.unwind[ARM_SEC_INIT]); 423 + mod->arch.unwind[ARM_SEC_INIT] = NULL; 422 424 #endif 423 425 }
+5 -10
arch/arm/kernel/sys_oabi-compat.c
··· 253 253 { 254 254 struct oabi_epoll_event user; 255 255 struct epoll_event kernel; 256 - mm_segment_t fs; 257 - long ret; 258 256 259 - if (op == EPOLL_CTL_DEL) 260 - return sys_epoll_ctl(epfd, op, fd, NULL); 261 - if (copy_from_user(&user, event, sizeof(user))) 257 + if (ep_op_has_event(op) && 258 + copy_from_user(&user, event, sizeof(user))) 262 259 return -EFAULT; 260 + 263 261 kernel.events = user.events; 264 262 kernel.data = user.data; 265 - fs = get_fs(); 266 - set_fs(KERNEL_DS); 267 - ret = sys_epoll_ctl(epfd, op, fd, &kernel); 268 - set_fs(fs); 269 - return ret; 263 + 264 + return do_epoll_ctl(epfd, op, fd, &kernel, false); 270 265 } 271 266 272 267 asmlinkage long sys_oabi_epoll_wait(int epfd,
+2 -1
arch/arm/mm/proc-macros.S
··· 5 5 * VMA_VM_FLAGS 6 6 * VM_EXEC 7 7 */ 8 + #include <linux/const.h> 8 9 #include <asm/asm-offsets.h> 9 10 #include <asm/thread_info.h> 10 11 ··· 31 30 * act_mm - get current->active_mm 32 31 */ 33 32 .macro act_mm, rd 34 - bic \rd, sp, #8128 33 + bic \rd, sp, #(THREAD_SIZE - 1) & ~63 35 34 bic \rd, \rd, #63 36 35 ldr \rd, [\rd, #TI_TASK] 37 36 .if (TSK_ACTIVE_MM > IMM12_MASK)
+6 -39
drivers/firmware/efi/libstub/arm32-stub.c
··· 199 199 unsigned long kernel_base; 200 200 efi_status_t status; 201 201 202 - /* 203 - * Verify that the DRAM base address is compatible with the ARM 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); 202 + /* use a 16 MiB aligned base for the decompressed kernel */ 203 + kernel_base = round_up(dram_base, SZ_16M) + TEXT_OFFSET; 210 204 211 205 /* 212 206 * Note that some platforms (notably, the Raspberry Pi 2) put ··· 209 215 * base of the kernel image is only partially used at the moment. 210 216 * (Up to 5 pages are used for the swapper page tables) 211 217 */ 212 - kernel_base += TEXT_OFFSET - 5 * PAGE_SIZE; 213 - 214 - status = reserve_kernel_base(kernel_base, reserve_addr, reserve_size); 218 + status = reserve_kernel_base(kernel_base - 5 * PAGE_SIZE, reserve_addr, 219 + reserve_size); 215 220 if (status != EFI_SUCCESS) { 216 221 efi_err("Unable to allocate memory for uncompressed kernel.\n"); 217 222 return status; 218 223 } 219 224 220 - /* 221 - * Relocate the zImage, so that it appears in the lowest 128 MB 222 - * memory window. 223 - */ 224 - *image_addr = (unsigned long)image->image_base; 225 - *image_size = image->image_size; 226 - status = efi_relocate_kernel(image_addr, *image_size, *image_size, 227 - kernel_base + MAX_UNCOMP_KERNEL_SIZE, 0, 0); 228 - if (status != EFI_SUCCESS) { 229 - efi_err("Failed to relocate kernel.\n"); 230 - efi_free(*reserve_size, *reserve_addr); 231 - *reserve_size = 0; 232 - return status; 233 - } 234 - 235 - /* 236 - * Check to see if we were able to allocate memory low enough 237 - * in memory. The kernel determines the base of DRAM from the 238 - * address at which the zImage is loaded. 239 - */ 240 - if (*image_addr + *image_size > dram_base + ZIMAGE_OFFSET_LIMIT) { 241 - efi_err("Failed to relocate kernel, no low memory available.\n"); 242 - efi_free(*reserve_size, *reserve_addr); 243 - *reserve_size = 0; 244 - efi_free(*image_size, *image_addr); 245 - *image_size = 0; 246 - return EFI_LOAD_ERROR; 247 - } 225 + *image_addr = kernel_base; 226 + *image_size = 0; 248 227 return EFI_SUCCESS; 249 228 }
+1 -1
drivers/gpu/drm/armada/armada_drv.c
··· 311 311 } 312 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 315 MODULE_DESCRIPTION("Armada DRM Driver"); 316 316 MODULE_LICENSE("GPL"); 317 317 MODULE_ALIAS("platform:armada-drm");
+1 -1
drivers/gpu/drm/bridge/synopsys/dw-hdmi-ahb-audio.c
··· 630 630 631 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 634 MODULE_DESCRIPTION("Synopsis Designware HDMI AHB ALSA interface"); 635 635 MODULE_LICENSE("GPL v2"); 636 636 MODULE_ALIAS("platform:" DRIVER_NAME);
+1 -1
drivers/gpu/drm/etnaviv/etnaviv_drv.c
··· 736 736 module_exit(etnaviv_exit); 737 737 738 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 740 MODULE_AUTHOR("Lucas Stach <l.stach@pengutronix.de>"); 741 741 MODULE_DESCRIPTION("etnaviv DRM Driver"); 742 742 MODULE_LICENSE("GPL v2");
+1 -1
drivers/media/cec/cec-notifier.c
··· 2 2 /* 3 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 6 * Copyright 2016-2017 Cisco Systems, Inc. and/or its affiliates. All rights reserved. 7 7 */ 8 8
+1 -1
drivers/net/phy/swphy.c
··· 2 2 /* 3 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 7 * Author: Vitaly Bordug <vbordug@ru.mvista.com> 8 8 * Anton Vorontsov <avorontsov@ru.mvista.com>
+5
include/linux/moduleloader.h
··· 29 29 /* Free memory returned from module_alloc. */ 30 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 37 /* Determines if the section name is an exit section (that is only used during 33 38 * module unloading) 34 39 */
+1 -1
include/media/cec-notifier.h
··· 2 2 /* 3 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 6 * Copyright 2016-2017 Cisco Systems, Inc. and/or its affiliates. All rights reserved. 7 7 */ 8 8
+7 -2
kernel/module.c
··· 2400 2400 if ((s->sh_flags & masks[m][0]) != masks[m][0] 2401 2401 || (s->sh_flags & masks[m][1]) 2402 2402 || s->sh_entsize != ~0UL 2403 - || strstarts(sname, ".init")) 2403 + || module_init_section(sname)) 2404 2404 continue; 2405 2405 s->sh_entsize = get_offset(mod, &mod->core_layout.size, s, i); 2406 2406 pr_debug("\t%s\n", sname); ··· 2433 2433 if ((s->sh_flags & masks[m][0]) != masks[m][0] 2434 2434 || (s->sh_flags & masks[m][1]) 2435 2435 || s->sh_entsize != ~0UL 2436 - || !strstarts(sname, ".init")) 2436 + || !module_init_section(sname)) 2437 2437 continue; 2438 2438 s->sh_entsize = (get_offset(mod, &mod->init_layout.size, s, i) 2439 2439 | INIT_OFFSET_MASK); ··· 2766 2766 void * __weak module_alloc(unsigned long size) 2767 2767 { 2768 2768 return vmalloc_exec(size); 2769 + } 2770 + 2771 + bool __weak module_init_section(const char *name) 2772 + { 2773 + return strstarts(name, ".init"); 2769 2774 } 2770 2775 2771 2776 bool __weak module_exit_section(const char *name)